aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore51
-rw-r--r--ABOUT-NLS1282
-rw-r--r--AUTHORS62
-rw-r--r--COPYING340
-rw-r--r--COPYING.LIB510
-rw-r--r--ChangeLog16
-rw-r--r--ChangeLog-20111211
-rw-r--r--INSTALL236
-rw-r--r--Makefile.am98
-rw-r--r--NEWS764
-rw-r--r--README167
-rw-r--r--README.GIT49
-rw-r--r--THANKS16
-rw-r--r--autogen.rc23
-rwxr-xr-xautogen.sh489
-rwxr-xr-xbuild-aux/compile347
-rwxr-xr-xbuild-aux/config.guess1456
-rwxr-xr-xbuild-aux/config.rpath684
-rwxr-xr-xbuild-aux/config.sub1823
-rwxr-xr-xbuild-aux/depcomp791
-rw-r--r--build-aux/git-log-fix3
-rw-r--r--build-aux/git-log-footer14
-rwxr-xr-xbuild-aux/install-sh527
-rw-r--r--build-aux/ltmain.sh9677
-rwxr-xr-xbuild-aux/mdate-sh224
-rwxr-xr-xbuild-aux/missing215
-rw-r--r--build-aux/texinfo.tex8638
-rw-r--r--configure.ac593
-rw-r--r--contrib/ChangeLog-201125
-rwxr-xr-xcontrib/conf-w32ce-msc/build.mk144
-rwxr-xr-xcontrib/conf-w32ce-msc/config.h153
-rwxr-xr-xcontrib/conf-w32ce-msc/stdint.h9
-rw-r--r--doc/HACKING25
-rw-r--r--doc/Makefile.am93
-rw-r--r--doc/errorref.txt1122
-rw-r--r--doc/gpgrt.texi435
-rw-r--r--doc/gpl.texi392
-rw-r--r--doc/ldap2gpgerr.c184
-rw-r--r--doc/lgpl.texi560
-rw-r--r--doc/yat2m.c1644
-rw-r--r--lang/Makefile.am22
-rw-r--r--lang/README8
-rw-r--r--lang/cl/Makefile.am40
-rw-r--r--lang/cl/README22
-rw-r--r--lang/cl/gpg-error-package.lisp64
-rw-r--r--lang/cl/gpg-error.asd.in36
-rw-r--r--lang/cl/gpg-error.lisp233
-rw-r--r--lang/cl/mkerrcodes.awk154
-rw-r--r--libgpg-error.spec.in57
-rw-r--r--m4/ChangeLog-2011113
-rw-r--r--m4/Makefile.am3
-rw-r--r--m4/ac_prog_cc_for_build.m4149
-rw-r--r--m4/autobuild.m434
-rw-r--r--m4/codeset.m421
-rw-r--r--m4/estream.m449
-rw-r--r--m4/gettext.m4401
-rw-r--r--m4/glibc2.m430
-rw-r--r--m4/glibc21.m430
-rw-r--r--m4/iconv.m4268
-rw-r--r--m4/intdiv0.m470
-rw-r--r--m4/intmax.m430
-rw-r--r--m4/inttypes-h.m425
-rw-r--r--m4/inttypes-pri.m430
-rw-r--r--m4/inttypes.m425
-rw-r--r--m4/inttypes_h.m426
-rw-r--r--m4/isc-posix.m424
-rw-r--r--m4/lcmessage.m430
-rw-r--r--m4/lib-ld.m4119
-rw-r--r--m4/lib-link.m4777
-rw-r--r--m4/lib-prefix.m4224
-rw-r--r--m4/libtool.m48027
-rw-r--r--m4/lock.m442
-rw-r--r--m4/longdouble.m431
-rw-r--r--m4/longlong.m423
-rw-r--r--m4/ltoptions.m4384
-rw-r--r--m4/ltsugar.m4123
-rw-r--r--m4/ltversion.m423
-rw-r--r--m4/lt~obsolete.m498
-rw-r--r--m4/nls.m432
-rw-r--r--m4/po.m4453
-rw-r--r--m4/printf-posix.m444
-rw-r--r--m4/progtest.m491
-rw-r--r--m4/signed.m417
-rw-r--r--m4/size_max.m460
-rw-r--r--m4/stdint_h.m426
-rw-r--r--m4/threadlib.m4349
-rw-r--r--m4/uintmax_t.m430
-rw-r--r--m4/ulonglong.m423
-rw-r--r--m4/visibility.m452
-rw-r--r--m4/wchar_t.m420
-rw-r--r--m4/wint_t.m420
-rw-r--r--m4/xsize.m413
-rwxr-xr-xmkinstalldirs162
-rw-r--r--po/.gitattributes7
-rw-r--r--po/ChangeLog-2011146
-rw-r--r--po/LINGUAS20
-rw-r--r--po/Makefile.in.in475
-rw-r--r--po/Makevars79
-rw-r--r--po/POTFILES.in14
-rw-r--r--po/Rules-quot58
-rw-r--r--po/boldquot.sed10
-rw-r--r--po/cs.po1480
-rw-r--r--po/da.po1475
-rw-r--r--po/de.po1320
-rw-r--r--po/[email protected]25
-rw-r--r--po/[email protected]22
-rw-r--r--po/eo.po1529
-rw-r--r--po/fr.po1472
-rw-r--r--po/hu.po1527
-rw-r--r--po/insert-header.sin23
-rw-r--r--po/it.po1470
-rw-r--r--po/ja.po1304
-rw-r--r--po/nl.po1471
-rw-r--r--po/pl.po1329
-rw-r--r--po/pt.po1471
-rw-r--r--po/quot.sed6
-rw-r--r--po/remove-potcdate.sin19
-rw-r--r--po/ro.po1523
-rw-r--r--po/ru.po1335
-rw-r--r--po/sr.po1526
-rw-r--r--po/sv.po1514
-rw-r--r--po/uk.po1366
-rw-r--r--po/vi.po1516
-rw-r--r--po/zh_CN.po1511
-rw-r--r--po/zh_TW.po1473
-rwxr-xr-xpotomo64
-rw-r--r--src/Makefile.am317
-rw-r--r--src/README47
-rw-r--r--src/b64dec.c280
-rw-r--r--src/code-from-errno.c69
-rw-r--r--src/code-to-errno.c42
-rw-r--r--src/err-codes.h.in481
-rw-r--r--src/err-sources.h.in61
-rw-r--r--src/errnos.in172
-rw-r--r--src/estream-printf.c1875
-rw-r--r--src/estream-printf.h151
-rw-r--r--src/estream.c5208
-rw-r--r--src/estream.h30
-rw-r--r--src/gen-posix-lock-obj.c175
-rw-r--r--src/gen-w32-lock-obj.c55
-rw-r--r--src/gettext.h76
-rw-r--r--src/gpg-error-config.in102
-rw-r--r--src/gpg-error.c639
-rw-r--r--src/gpg-error.def.in159
-rw-r--r--src/gpg-error.h.in873
-rw-r--r--src/gpg-error.m4121
-rw-r--r--src/gpg-error.vers135
-rw-r--r--src/gpg-error.w32-manifest.in17
-rw-r--r--src/gpgrt-int.h376
-rw-r--r--src/init.c528
-rw-r--r--src/init.h70
-rw-r--r--src/lock.h26
-rw-r--r--src/mkerrcodes.awk99
-rw-r--r--src/mkerrcodes.c78
-rw-r--r--src/mkerrcodes1.awk96
-rw-r--r--src/mkerrcodes2.awk134
-rw-r--r--src/mkerrnos.awk104
-rw-r--r--src/mkheader.c658
-rw-r--r--src/mkstrtable.awk189
-rw-r--r--src/mkw32errmap.c178
-rw-r--r--src/posix-lock-obj.h42
-rw-r--r--src/posix-lock.c284
-rw-r--r--src/posix-thread.c89
-rw-r--r--src/strerror-sym.c56
-rw-r--r--src/strerror.c169
-rw-r--r--src/strsource-sym.c43
-rw-r--r--src/strsource.c37
-rw-r--r--src/syscfg/lock-obj-pub.aarch64-apple-darwin.h28
-rw-r--r--src/syscfg/lock-obj-pub.aarch64-unknown-linux-gnu.h26
-rw-r--r--src/syscfg/lock-obj-pub.alpha-unknown-linux-gnu.h25
-rw-r--r--src/syscfg/lock-obj-pub.arm-apple-darwin.h26
-rw-r--r--src/syscfg/lock-obj-pub.arm-unknown-linux-androideabi.h21
-rw-r--r--src/syscfg/lock-obj-pub.arm-unknown-linux-gnueabi.h23
-rw-r--r--src/syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h27
-rw-r--r--src/syscfg/lock-obj-pub.i386-apple-darwin.h26
-rw-r--r--src/syscfg/lock-obj-pub.i686-pc-gnu.h24
-rw-r--r--src/syscfg/lock-obj-pub.i686-pc-kfreebsd-gnu.h23
-rw-r--r--src/syscfg/lock-obj-pub.i686-pc-linux-gnu.h23
-rw-r--r--src/syscfg/lock-obj-pub.ia64-unknown-linux-gnu.h25
-rw-r--r--src/syscfg/lock-obj-pub.m68k-unknown-linux-gnu.h23
-rw-r--r--src/syscfg/lock-obj-pub.mingw32.h44
-rw-r--r--src/syscfg/lock-obj-pub.mips-unknown-linux-gnu.h23
-rw-r--r--src/syscfg/lock-obj-pub.mips64el-unknown-linux-gnuabi64.h25
-rw-r--r--src/syscfg/lock-obj-pub.mipsel-unknown-linux-gnu.h23
-rw-r--r--src/syscfg/lock-obj-pub.nios2-unknown-linux-gnu.h23
-rw-r--r--src/syscfg/lock-obj-pub.or1k-unknown-linux-gnu.h24
-rw-r--r--src/syscfg/lock-obj-pub.powerpc-unknown-linux-gnu.h23
-rw-r--r--src/syscfg/lock-obj-pub.powerpc-unknown-linux-gnuspe.h23
-rw-r--r--src/syscfg/lock-obj-pub.powerpc64-unknown-linux-gnu.h25
-rw-r--r--src/syscfg/lock-obj-pub.powerpc64le-unknown-linux-gnu.h25
-rw-r--r--src/syscfg/lock-obj-pub.s390x-ibm-linux-gnu.h25
-rw-r--r--src/syscfg/lock-obj-pub.sh3-unknown-linux-gnu.h23
-rw-r--r--src/syscfg/lock-obj-pub.sh4-unknown-linux-gnu.h23
-rw-r--r--src/syscfg/lock-obj-pub.sparc-unknown-linux-gnu.h23
-rw-r--r--src/syscfg/lock-obj-pub.sparc64-unknown-linux-gnu.h25
-rw-r--r--src/syscfg/lock-obj-pub.tilegx-unknown-linux-gnu.h25
-rw-r--r--src/syscfg/lock-obj-pub.x86_64-apple-darwin.h28
-rw-r--r--src/syscfg/lock-obj-pub.x86_64-pc-kfreebsd-gnu.h25
-rw-r--r--src/syscfg/lock-obj-pub.x86_64-pc-linux-gnu.h25
-rw-r--r--src/syscfg/lock-obj-pub.x86_64-pc-linux-gnux32.h24
-rw-r--r--src/syscfg/lock-obj-pub.x86_64-pc-linux-musl.h25
-rw-r--r--src/thread.h26
-rw-r--r--src/version.c121
-rw-r--r--src/versioninfo.rc.in53
-rw-r--r--src/visibility.c732
-rw-r--r--src/visibility.h268
-rw-r--r--src/w32-add.h58
-rw-r--r--src/w32-estream.c1075
-rw-r--r--src/w32-gettext.c1958
-rw-r--r--src/w32-iconv.c1795
-rw-r--r--src/w32-lock-obj.h38
-rw-r--r--src/w32-lock.c182
-rw-r--r--src/w32-thread.c66
-rw-r--r--src/w32ce-add.h8
-rw-r--r--tests/Makefile.am41
-rw-r--r--tests/t-b64dec.c123
-rw-r--r--tests/t-common.h102
-rw-r--r--tests/t-lock.c333
-rw-r--r--tests/t-poll.c440
-rw-r--r--tests/t-printf.c429
-rw-r--r--tests/t-strerror.c63
-rw-r--r--tests/t-syserror.c87
-rw-r--r--tests/t-version.c98
223 files changed, 100215 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..fa9b999
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,51 @@
+*.lo
+*.o
+.deps/
+.libs/
+po/*.gmo
+po/messages.mo
+Makefile.in
+aclocal.m4
+autom4te.cache/
+configure
+config.h.in
+src/err-codes.h
+src/err-sources.h
+/po/libgpg-error.pot
+/lang/Makefile
+/lang/cl/Makefile
+/lang/cl/gpg-error-codes.lisp
+/lang/cl/gpg-error.asd
+/libtool
+/m4/Makefile
+/po/Makefile
+/po/POTFILES
+/po/stamp-po
+/config.log
+/config.status
+/config.h
+/Makefile
+/src/Makefile
+/src/code-from-errno.h
+/src/code-to-errno.h
+/src/err-codes-sym.h
+/src/err-sources-sym.h
+/src/errnos-sym.h
+/src/extra-h.in
+/src/gpg-error
+/src/gpg-error-config
+/src/gpg-error.def
+/src/gpg-error.h
+/src/libgpg-error.la
+/src/mkerrcodes
+/src/mkerrcodes.h
+/src/mkw32errmap.map.c
+/src/versioninfo.rc
+/stamp-h1
+/tests/Makefile
+/tests/t-strerror
+/tests/t-syserror
+/doc/gpgrt.info
+/doc/stamp-vti
+/doc/version.texi
+/VERSION
diff --git a/ABOUT-NLS b/ABOUT-NLS
new file mode 100644
index 0000000..3b879cb
--- /dev/null
+++ b/ABOUT-NLS
@@ -0,0 +1,1282 @@
+1 Notes on the Free Translation Project
+***************************************
+
+Free software is going international! The Free Translation Project is
+a way to get maintainers of free software, translators, and users all
+together, so that free software will gradually become able to speak many
+languages. A few packages already provide translations for their
+messages.
+
+ If you found this `ABOUT-NLS' file inside a distribution, you may
+assume that the distributed package does use GNU `gettext' internally,
+itself available at your nearest GNU archive site. But you do _not_
+need to install GNU `gettext' prior to configuring, installing or using
+this package with messages translated.
+
+ Installers will find here some useful hints. These notes also
+explain how users should proceed for getting the programs to use the
+available translations. They tell how people wanting to contribute and
+work on translations can contact the appropriate team.
+
+1.1 INSTALL Matters
+===================
+
+Some packages are "localizable" when properly installed; the programs
+they contain can be made to speak your own native language. Most such
+packages use GNU `gettext'. Other packages have their own ways to
+internationalization, predating GNU `gettext'.
+
+ By default, this package will be installed to allow translation of
+messages. It will automatically detect whether the system already
+provides the GNU `gettext' functions. Installers may use special
+options at configuration time for changing the default behaviour. The
+command:
+
+ ./configure --disable-nls
+
+will _totally_ disable translation of messages.
+
+ When you already have GNU `gettext' installed on your system and run
+configure without an option for your new package, `configure' will
+probably detect the previously built and installed `libintl' library
+and will decide to use it. If not, you may have to to use the
+`--with-libintl-prefix' option to tell `configure' where to look for it.
+
+ Internationalized packages usually have many `po/LL.po' files, where
+LL gives an ISO 639 two-letter code identifying the language. Unless
+translations have been forbidden at `configure' time by using the
+`--disable-nls' switch, all available translations are installed
+together with the package. However, the environment variable `LINGUAS'
+may be set, prior to configuration, to limit the installed set.
+`LINGUAS' should then contain a space separated list of two-letter
+codes, stating which languages are allowed.
+
+1.2 Using This Package
+======================
+
+As a user, if your language has been installed for this package, you
+only have to set the `LANG' environment variable to the appropriate
+`LL_CC' combination. If you happen to have the `LC_ALL' or some other
+`LC_xxx' environment variables set, you should unset them before
+setting `LANG', otherwise the setting of `LANG' will not have the
+desired effect. Here `LL' is an ISO 639 two-letter language code, and
+`CC' is an ISO 3166 two-letter country code. For example, let's
+suppose that you speak German and live in Germany. At the shell
+prompt, merely execute `setenv LANG de_DE' (in `csh'),
+`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
+This can be done from your `.login' or `.profile' file, once and for
+all.
+
+ You might think that the country code specification is redundant.
+But in fact, some languages have dialects in different countries. For
+example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
+country code serves to distinguish the dialects.
+
+ The locale naming convention of `LL_CC', with `LL' denoting the
+language and `CC' denoting the country, is the one use on systems based
+on GNU libc. On other systems, some variations of this scheme are
+used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
+locales supported by your system for your language by running the
+command `locale -a | grep '^LL''.
+
+ Not all programs have translations for all languages. By default, an
+English message is shown in place of a nonexistent translation. If you
+understand other languages, you can set up a priority list of languages.
+This is done through a different environment variable, called
+`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
+for the purpose of message handling, but you still need to have `LANG'
+set to the primary language; this is required by other parts of the
+system libraries. For example, some Swedish users who would rather
+read translations in German than English for when Swedish is not
+available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
+
+ Special advice for Norwegian users: The language code for Norwegian
+bokma*l changed from `no' to `nb' recently (in 2003). During the
+transition period, while some message catalogs for this language are
+installed under `nb' and some older ones under `no', it's recommended
+for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
+older translations are used.
+
+ In the `LANGUAGE' environment variable, but not in the `LANG'
+environment variable, `LL_CC' combinations can be abbreviated as `LL'
+to denote the language's main dialect. For example, `de' is equivalent
+to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
+(Portuguese as spoken in Portugal) in this context.
+
+1.3 Translating Teams
+=====================
+
+For the Free Translation Project to be a success, we need interested
+people who like their own language and write it well, and who are also
+able to synergize with other translators speaking the same language.
+Each translation team has its own mailing list. The up-to-date list of
+teams can be found at the Free Translation Project's homepage,
+`https://translationproject.org/', in the "Teams" area.
+
+ If you'd like to volunteer to _work_ at translating messages, you
+should become a member of the translating team for your own language.
+The subscribing address is _not_ the same as the list itself, it has
+`-request' appended. For example, speakers of Swedish can send a
+message to `[email protected]', having this message body:
+
+ subscribe
+
+ Keep in mind that team members are expected to participate
+_actively_ in translations, or at solving translational difficulties,
+rather than merely lurking around. If your team does not exist yet and
+you want to start one, or if you are unsure about what to do or how to
+get started, please write to `[email protected]' to
+reach the coordinator for all translator teams.
+
+ The English team is special. It works at improving and uniformizing
+the terminology in use. Proven linguistic skills are praised more than
+programming skills, here.
+
+1.4 Available Packages
+======================
+
+Languages are not equally supported in all packages. The following
+matrix shows the current state of internationalization, as of June
+2010. The matrix shows, in regard of each package, for which languages
+PO files have been submitted to translation coordination, with a
+translation percentage of at least 50%.
+
+ Ready PO files af am an ar as ast az be be@latin bg bn_IN bs ca
+ +--------------------------------------------------+
+ a2ps | [] [] |
+ aegis | |
+ ant-phone | |
+ anubis | |
+ aspell | [] [] |
+ bash | |
+ bfd | |
+ bibshelf | [] |
+ binutils | |
+ bison | |
+ bison-runtime | [] |
+ bluez-pin | [] [] |
+ bombono-dvd | |
+ buzztard | |
+ cflow | |
+ clisp | |
+ coreutils | [] [] |
+ cpio | |
+ cppi | |
+ cpplib | [] |
+ cryptsetup | |
+ dfarc | |
+ dialog | [] [] |
+ dico | |
+ diffutils | [] |
+ dink | |
+ doodle | |
+ e2fsprogs | [] |
+ enscript | [] |
+ exif | |
+ fetchmail | [] |
+ findutils | [] |
+ flex | [] |
+ freedink | |
+ gas | |
+ gawk | [] [] |
+ gcal | [] |
+ gcc | |
+ gettext-examples | [] [] [] [] |
+ gettext-runtime | [] [] |
+ gettext-tools | [] [] |
+ gip | [] |
+ gjay | |
+ gliv | [] |
+ glunarclock | [] [] |
+ gnubiff | |
+ gnucash | [] |
+ gnuedu | |
+ gnulib | |
+ gnunet | |
+ gnunet-gtk | |
+ gnutls | |
+ gold | |
+ gpe-aerial | |
+ gpe-beam | |
+ gpe-bluetooth | |
+ gpe-calendar | |
+ gpe-clock | [] |
+ gpe-conf | |
+ gpe-contacts | |
+ gpe-edit | |
+ gpe-filemanager | |
+ gpe-go | |
+ gpe-login | |
+ gpe-ownerinfo | [] |
+ gpe-package | |
+ gpe-sketchbook | |
+ gpe-su | [] |
+ gpe-taskmanager | [] |
+ gpe-timesheet | [] |
+ gpe-today | [] |
+ gpe-todo | |
+ gphoto2 | |
+ gprof | [] |
+ gpsdrive | |
+ gramadoir | |
+ grep | |
+ grub | [] [] |
+ gsasl | |
+ gss | |
+ gst-plugins-bad | [] |
+ gst-plugins-base | [] |
+ gst-plugins-good | [] |
+ gst-plugins-ugly | [] |
+ gstreamer | [] [] [] |
+ gtick | |
+ gtkam | [] |
+ gtkorphan | [] |
+ gtkspell | [] [] [] |
+ gutenprint | |
+ hello | [] |
+ help2man | |
+ hylafax | |
+ idutils | |
+ indent | [] [] |
+ iso_15924 | |
+ iso_3166 | [] [] [] [] [] [] [] |
+ iso_3166_2 | |
+ iso_4217 | |
+ iso_639 | [] [] [] [] |
+ iso_639_3 | |
+ jwhois | |
+ kbd | |
+ keytouch | [] |
+ keytouch-editor | |
+ keytouch-keyboa... | [] |
+ klavaro | [] |
+ latrine | |
+ ld | [] |
+ leafpad | [] [] |
+ libc | [] [] |
+ libexif | () |
+ libextractor | |
+ libgnutls | |
+ libgpewidget | |
+ libgpg-error | |
+ libgphoto2 | |
+ libgphoto2_port | |
+ libgsasl | |
+ libiconv | [] |
+ libidn | |
+ lifelines | |
+ liferea | [] [] |
+ lilypond | |
+ linkdr | [] |
+ lordsawar | |
+ lprng | |
+ lynx | [] |
+ m4 | |
+ mailfromd | |
+ mailutils | |
+ make | |
+ man-db | |
+ man-db-manpages | |
+ minicom | |
+ mkisofs | |
+ myserver | |
+ nano | [] [] |
+ opcodes | |
+ parted | |
+ pies | |
+ popt | |
+ psmisc | |
+ pspp | [] |
+ pwdutils | |
+ radius | [] |
+ recode | [] [] |
+ rosegarden | |
+ rpm | |
+ rush | |
+ sarg | |
+ screem | |
+ scrollkeeper | [] [] [] |
+ sed | [] [] |
+ sharutils | [] [] |
+ shishi | |
+ skencil | |
+ solfege | |
+ solfege-manual | |
+ soundtracker | |
+ sp | |
+ sysstat | |
+ tar | [] |
+ texinfo | |
+ tin | |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux-ng | [] |
+ vice | |
+ vmm | |
+ vorbis-tools | |
+ wastesedge | |
+ wdiff | |
+ wget | [] [] |
+ wyslij-po | |
+ xchat | [] [] [] [] |
+ xdg-user-dirs | [] [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] |
+ +--------------------------------------------------+
+ af am an ar as ast az be be@latin bg bn_IN bs ca
+ 6 0 1 2 3 19 1 10 3 28 3 1 38
+
+ crh cs da de el en en_GB en_ZA eo es et eu fa
+ +-------------------------------------------------+
+ a2ps | [] [] [] [] [] [] [] |
+ aegis | [] [] [] |
+ ant-phone | [] () |
+ anubis | [] [] |
+ aspell | [] [] [] [] [] |
+ bash | [] [] [] |
+ bfd | [] |
+ bibshelf | [] [] [] |
+ binutils | [] |
+ bison | [] [] |
+ bison-runtime | [] [] [] [] |
+ bluez-pin | [] [] [] [] [] [] |
+ bombono-dvd | [] |
+ buzztard | [] [] [] |
+ cflow | [] [] |
+ clisp | [] [] [] [] |
+ coreutils | [] [] [] [] |
+ cpio | |
+ cppi | |
+ cpplib | [] [] [] |
+ cryptsetup | [] |
+ dfarc | [] [] [] |
+ dialog | [] [] [] [] [] |
+ dico | |
+ diffutils | [] [] [] [] [] [] |
+ dink | [] [] [] |
+ doodle | [] |
+ e2fsprogs | [] [] [] |
+ enscript | [] [] [] |
+ exif | () [] [] |
+ fetchmail | [] [] () [] [] [] |
+ findutils | [] [] [] |
+ flex | [] [] |
+ freedink | [] [] [] |
+ gas | [] |
+ gawk | [] [] [] |
+ gcal | [] |
+ gcc | [] [] |
+ gettext-examples | [] [] [] [] |
+ gettext-runtime | [] [] [] [] |
+ gettext-tools | [] [] [] |
+ gip | [] [] [] [] |
+ gjay | [] |
+ gliv | [] [] [] |
+ glunarclock | [] [] |
+ gnubiff | () |
+ gnucash | [] () () () () |
+ gnuedu | [] [] |
+ gnulib | [] [] |
+ gnunet | |
+ gnunet-gtk | [] |
+ gnutls | [] [] |
+ gold | [] |
+ gpe-aerial | [] [] [] [] |
+ gpe-beam | [] [] [] [] |
+ gpe-bluetooth | [] [] |
+ gpe-calendar | [] |
+ gpe-clock | [] [] [] [] |
+ gpe-conf | [] [] [] |
+ gpe-contacts | [] [] [] |
+ gpe-edit | [] [] |
+ gpe-filemanager | [] [] [] |
+ gpe-go | [] [] [] [] |
+ gpe-login | [] [] |
+ gpe-ownerinfo | [] [] [] [] |
+ gpe-package | [] [] [] |
+ gpe-sketchbook | [] [] [] [] |
+ gpe-su | [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] |
+ gpe-timesheet | [] [] [] [] |
+ gpe-today | [] [] [] [] |
+ gpe-todo | [] [] [] |
+ gphoto2 | [] [] () [] [] [] |
+ gprof | [] [] [] |
+ gpsdrive | [] [] [] |
+ gramadoir | [] [] [] |
+ grep | [] |
+ grub | [] [] |
+ gsasl | [] |
+ gss | |
+ gst-plugins-bad | [] [] [] [] [] |
+ gst-plugins-base | [] [] [] [] [] |
+ gst-plugins-good | [] [] [] [] [] [] |
+ gst-plugins-ugly | [] [] [] [] [] [] |
+ gstreamer | [] [] [] [] [] |
+ gtick | [] () [] |
+ gtkam | [] [] () [] [] |
+ gtkorphan | [] [] [] [] |
+ gtkspell | [] [] [] [] [] [] [] |
+ gutenprint | [] [] [] |
+ hello | [] [] [] [] |
+ help2man | [] |
+ hylafax | [] [] |
+ idutils | [] [] |
+ indent | [] [] [] [] [] [] [] |
+ iso_15924 | [] () [] [] |
+ iso_3166 | [] [] [] [] () [] [] [] () |
+ iso_3166_2 | () |
+ iso_4217 | [] [] [] () [] [] |
+ iso_639 | [] [] [] [] () [] [] |
+ iso_639_3 | [] |
+ jwhois | [] |
+ kbd | [] [] [] [] [] |
+ keytouch | [] [] |
+ keytouch-editor | [] [] |
+ keytouch-keyboa... | [] |
+ klavaro | [] [] [] [] |
+ latrine | [] () |
+ ld | [] [] |
+ leafpad | [] [] [] [] [] [] |
+ libc | [] [] [] [] |
+ libexif | [] [] () |
+ libextractor | |
+ libgnutls | [] |
+ libgpewidget | [] [] |
+ libgpg-error | [] [] |
+ libgphoto2 | [] () |
+ libgphoto2_port | [] () [] |
+ libgsasl | |
+ libiconv | [] [] [] [] [] |
+ libidn | [] [] [] |
+ lifelines | [] () |
+ liferea | [] [] [] [] [] |
+ lilypond | [] [] [] |
+ linkdr | [] [] [] |
+ lordsawar | [] |
+ lprng | |
+ lynx | [] [] [] [] |
+ m4 | [] [] [] [] |
+ mailfromd | |
+ mailutils | [] |
+ make | [] [] [] |
+ man-db | |
+ man-db-manpages | |
+ minicom | [] [] [] [] |
+ mkisofs | |
+ myserver | |
+ nano | [] [] [] |
+ opcodes | [] [] |
+ parted | [] [] |
+ pies | |
+ popt | [] [] [] [] [] |
+ psmisc | [] [] [] |
+ pspp | [] |
+ pwdutils | [] |
+ radius | [] |
+ recode | [] [] [] [] [] [] |
+ rosegarden | () () () |
+ rpm | [] [] [] |
+ rush | |
+ sarg | |
+ screem | |
+ scrollkeeper | [] [] [] [] [] |
+ sed | [] [] [] [] [] [] |
+ sharutils | [] [] [] [] |
+ shishi | |
+ skencil | [] () [] |
+ solfege | [] [] [] |
+ solfege-manual | [] [] |
+ soundtracker | [] [] [] |
+ sp | [] |
+ sysstat | [] [] [] |
+ tar | [] [] [] [] |
+ texinfo | [] [] [] |
+ tin | [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux-ng | [] [] [] [] |
+ vice | () () |
+ vmm | [] |
+ vorbis-tools | [] [] |
+ wastesedge | [] |
+ wdiff | [] [] |
+ wget | [] [] [] |
+ wyslij-po | |
+ xchat | [] [] [] [] [] |
+ xdg-user-dirs | [] [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] [] [] [] |
+ +-------------------------------------------------+
+ crh cs da de el en en_GB en_ZA eo es et eu fa
+ 5 64 105 117 18 1 8 0 28 89 18 19 0
+
+ fi fr ga gl gu he hi hr hu hy id is it ja ka kn
+ +----------------------------------------------------+
+ a2ps | [] [] [] [] |
+ aegis | [] [] |
+ ant-phone | [] [] |
+ anubis | [] [] [] [] |
+ aspell | [] [] [] [] |
+ bash | [] [] [] [] |
+ bfd | [] [] [] |
+ bibshelf | [] [] [] [] [] |
+ binutils | [] [] [] |
+ bison | [] [] [] [] |
+ bison-runtime | [] [] [] [] [] [] |
+ bluez-pin | [] [] [] [] [] [] [] [] |
+ bombono-dvd | [] |
+ buzztard | [] |
+ cflow | [] [] [] |
+ clisp | [] |
+ coreutils | [] [] [] [] [] |
+ cpio | [] [] [] [] |
+ cppi | [] [] |
+ cpplib | [] [] [] |
+ cryptsetup | [] [] [] |
+ dfarc | [] [] [] |
+ dialog | [] [] [] [] [] [] [] |
+ dico | |
+ diffutils | [] [] [] [] [] [] [] [] [] |
+ dink | [] |
+ doodle | [] [] |
+ e2fsprogs | [] [] |
+ enscript | [] [] [] [] |
+ exif | [] [] [] [] [] [] |
+ fetchmail | [] [] [] [] |
+ findutils | [] [] [] [] [] [] |
+ flex | [] [] [] |
+ freedink | [] [] [] |
+ gas | [] [] |
+ gawk | [] [] [] [] () [] |
+ gcal | [] |
+ gcc | [] |
+ gettext-examples | [] [] [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] [] |
+ gettext-tools | [] [] [] [] |
+ gip | [] [] [] [] [] [] |
+ gjay | [] |
+ gliv | [] () |
+ glunarclock | [] [] [] [] |
+ gnubiff | () [] () |
+ gnucash | () () () () () [] |
+ gnuedu | [] [] |
+ gnulib | [] [] [] [] [] [] |
+ gnunet | |
+ gnunet-gtk | [] |
+ gnutls | [] [] |
+ gold | [] [] |
+ gpe-aerial | [] [] [] |
+ gpe-beam | [] [] [] [] |
+ gpe-bluetooth | [] [] [] [] |
+ gpe-calendar | [] [] |
+ gpe-clock | [] [] [] [] [] |
+ gpe-conf | [] [] [] [] |
+ gpe-contacts | [] [] [] [] |
+ gpe-edit | [] [] [] |
+ gpe-filemanager | [] [] [] [] |
+ gpe-go | [] [] [] [] [] |
+ gpe-login | [] [] [] |
+ gpe-ownerinfo | [] [] [] [] [] |
+ gpe-package | [] [] [] |
+ gpe-sketchbook | [] [] [] [] |
+ gpe-su | [] [] [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] [] |
+ gpe-timesheet | [] [] [] [] [] |
+ gpe-today | [] [] [] [] [] [] [] |
+ gpe-todo | [] [] [] |
+ gphoto2 | [] [] [] [] [] [] |
+ gprof | [] [] [] [] |
+ gpsdrive | [] [] [] |
+ gramadoir | [] [] [] |
+ grep | [] [] |
+ grub | [] [] [] [] |
+ gsasl | [] [] [] [] [] |
+ gss | [] [] [] [] [] |
+ gst-plugins-bad | [] [] [] [] [] [] |
+ gst-plugins-base | [] [] [] [] [] [] |
+ gst-plugins-good | [] [] [] [] [] [] |
+ gst-plugins-ugly | [] [] [] [] [] [] |
+ gstreamer | [] [] [] [] [] |
+ gtick | [] [] [] [] [] |
+ gtkam | [] [] [] [] [] |
+ gtkorphan | [] [] [] |
+ gtkspell | [] [] [] [] [] [] [] [] [] |
+ gutenprint | [] [] [] [] |
+ hello | [] [] [] |
+ help2man | [] [] |
+ hylafax | [] |
+ idutils | [] [] [] [] [] [] |
+ indent | [] [] [] [] [] [] [] [] |
+ iso_15924 | [] () [] [] |
+ iso_3166 | [] () [] [] [] [] [] [] [] [] [] [] |
+ iso_3166_2 | () [] [] [] |
+ iso_4217 | [] () [] [] [] [] |
+ iso_639 | [] () [] [] [] [] [] [] [] |
+ iso_639_3 | () [] [] |
+ jwhois | [] [] [] [] [] |
+ kbd | [] [] |
+ keytouch | [] [] [] [] [] [] |
+ keytouch-editor | [] [] [] [] [] |
+ keytouch-keyboa... | [] [] [] [] [] |
+ klavaro | [] [] |
+ latrine | [] [] [] |
+ ld | [] [] [] [] |
+ leafpad | [] [] [] [] [] [] [] () |
+ libc | [] [] [] [] [] |
+ libexif | [] |
+ libextractor | |
+ libgnutls | [] [] |
+ libgpewidget | [] [] [] [] |
+ libgpg-error | [] [] |
+ libgphoto2 | [] [] [] |
+ libgphoto2_port | [] [] [] |
+ libgsasl | [] [] [] [] [] |
+ libiconv | [] [] [] [] [] [] |
+ libidn | [] [] [] [] |
+ lifelines | () |
+ liferea | [] [] [] [] |
+ lilypond | [] [] |
+ linkdr | [] [] [] [] [] |
+ lordsawar | |
+ lprng | [] |
+ lynx | [] [] [] [] [] |
+ m4 | [] [] [] [] [] [] |
+ mailfromd | |
+ mailutils | [] [] |
+ make | [] [] [] [] [] [] [] [] [] |
+ man-db | [] [] |
+ man-db-manpages | [] |
+ minicom | [] [] [] [] [] |
+ mkisofs | [] [] [] [] |
+ myserver | |
+ nano | [] [] [] [] [] [] |
+ opcodes | [] [] [] [] |
+ parted | [] [] [] [] |
+ pies | |
+ popt | [] [] [] [] [] [] [] [] [] |
+ psmisc | [] [] [] |
+ pspp | |
+ pwdutils | [] [] |
+ radius | [] [] |
+ recode | [] [] [] [] [] [] [] [] |
+ rosegarden | () () () () () |
+ rpm | [] [] |
+ rush | |
+ sarg | [] |
+ screem | [] [] |
+ scrollkeeper | [] [] [] [] |
+ sed | [] [] [] [] [] [] [] [] |
+ sharutils | [] [] [] [] [] [] [] |
+ shishi | [] |
+ skencil | [] |
+ solfege | [] [] [] [] |
+ solfege-manual | [] [] |
+ soundtracker | [] [] |
+ sp | [] () |
+ sysstat | [] [] [] [] [] |
+ tar | [] [] [] [] [] [] [] |
+ texinfo | [] [] [] [] |
+ tin | [] |
+ unicode-han-tra... | |
+ unicode-transla... | [] [] |
+ util-linux-ng | [] [] [] [] [] [] |
+ vice | () () () |
+ vmm | [] |
+ vorbis-tools | [] |
+ wastesedge | () () |
+ wdiff | [] |
+ wget | [] [] [] [] [] [] [] [] |
+ wyslij-po | [] [] [] |
+ xchat | [] [] [] [] [] [] [] [] [] |
+ xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] [] [] |
+ +----------------------------------------------------+
+ fi fr ga gl gu he hi hr hu hy id is it ja ka kn
+ 105 121 53 20 4 8 3 5 53 2 120 5 84 67 0 4
+
+ ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne
+ +-----------------------------------------------+
+ a2ps | [] |
+ aegis | |
+ ant-phone | |
+ anubis | [] [] |
+ aspell | [] |
+ bash | |
+ bfd | |
+ bibshelf | [] [] |
+ binutils | |
+ bison | [] |
+ bison-runtime | [] [] [] [] [] |
+ bluez-pin | [] [] [] [] [] |
+ bombono-dvd | |
+ buzztard | |
+ cflow | |
+ clisp | |
+ coreutils | [] |
+ cpio | |
+ cppi | |
+ cpplib | |
+ cryptsetup | |
+ dfarc | [] |
+ dialog | [] [] [] [] [] |
+ dico | |
+ diffutils | [] [] |
+ dink | |
+ doodle | |
+ e2fsprogs | |
+ enscript | |
+ exif | [] |
+ fetchmail | |
+ findutils | |
+ flex | |
+ freedink | [] |
+ gas | |
+ gawk | |
+ gcal | |
+ gcc | |
+ gettext-examples | [] [] [] [] |
+ gettext-runtime | [] |
+ gettext-tools | [] |
+ gip | [] [] |
+ gjay | |
+ gliv | |
+ glunarclock | [] |
+ gnubiff | |
+ gnucash | () () () () |
+ gnuedu | |
+ gnulib | |
+ gnunet | |
+ gnunet-gtk | |
+ gnutls | [] |
+ gold | |
+ gpe-aerial | [] |
+ gpe-beam | [] |
+ gpe-bluetooth | [] [] |
+ gpe-calendar | [] |
+ gpe-clock | [] [] [] [] [] |
+ gpe-conf | [] [] |
+ gpe-contacts | [] [] |
+ gpe-edit | [] |
+ gpe-filemanager | [] [] |
+ gpe-go | [] [] [] |
+ gpe-login | [] |
+ gpe-ownerinfo | [] [] |
+ gpe-package | [] [] |
+ gpe-sketchbook | [] [] |
+ gpe-su | [] [] [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] [] [] |
+ gpe-timesheet | [] [] |
+ gpe-today | [] [] [] [] |
+ gpe-todo | [] [] |
+ gphoto2 | |
+ gprof | [] |
+ gpsdrive | |
+ gramadoir | |
+ grep | |
+ grub | |
+ gsasl | |
+ gss | |
+ gst-plugins-bad | [] [] [] [] |
+ gst-plugins-base | [] [] |
+ gst-plugins-good | [] [] |
+ gst-plugins-ugly | [] [] [] [] [] |
+ gstreamer | |
+ gtick | |
+ gtkam | [] |
+ gtkorphan | [] [] |
+ gtkspell | [] [] [] [] [] [] [] |
+ gutenprint | |
+ hello | [] [] [] |
+ help2man | |
+ hylafax | |
+ idutils | |
+ indent | |
+ iso_15924 | [] [] |
+ iso_3166 | [] [] () [] [] [] [] [] |
+ iso_3166_2 | |
+ iso_4217 | [] [] |
+ iso_639 | [] [] |
+ iso_639_3 | [] |
+ jwhois | [] |
+ kbd | |
+ keytouch | [] |
+ keytouch-editor | [] |
+ keytouch-keyboa... | [] |
+ klavaro | [] |
+ latrine | [] |
+ ld | |
+ leafpad | [] [] [] |
+ libc | [] |
+ libexif | |
+ libextractor | |
+ libgnutls | [] |
+ libgpewidget | [] [] |
+ libgpg-error | |
+ libgphoto2 | |
+ libgphoto2_port | |
+ libgsasl | |
+ libiconv | |
+ libidn | |
+ lifelines | |
+ liferea | |
+ lilypond | |
+ linkdr | |
+ lordsawar | |
+ lprng | |
+ lynx | |
+ m4 | |
+ mailfromd | |
+ mailutils | |
+ make | [] |
+ man-db | |
+ man-db-manpages | |
+ minicom | [] |
+ mkisofs | |
+ myserver | |
+ nano | [] [] |
+ opcodes | |
+ parted | |
+ pies | |
+ popt | [] [] [] |
+ psmisc | |
+ pspp | |
+ pwdutils | |
+ radius | |
+ recode | |
+ rosegarden | |
+ rpm | |
+ rush | |
+ sarg | |
+ screem | |
+ scrollkeeper | [] [] |
+ sed | |
+ sharutils | |
+ shishi | |
+ skencil | |
+ solfege | [] |
+ solfege-manual | |
+ soundtracker | |
+ sp | |
+ sysstat | [] |
+ tar | [] |
+ texinfo | [] |
+ tin | |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux-ng | |
+ vice | |
+ vmm | |
+ vorbis-tools | |
+ wastesedge | |
+ wdiff | |
+ wget | [] |
+ wyslij-po | |
+ xchat | [] [] [] |
+ xdg-user-dirs | [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] |
+ +-----------------------------------------------+
+ ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne
+ 20 5 10 1 13 48 4 2 2 4 24 10 20 3 1
+
+ nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr
+ +---------------------------------------------------+
+ a2ps | [] [] [] [] [] [] [] [] |
+ aegis | [] [] [] |
+ ant-phone | [] [] |
+ anubis | [] [] [] |
+ aspell | [] [] [] [] [] |
+ bash | [] [] |
+ bfd | [] |
+ bibshelf | [] [] |
+ binutils | [] [] |
+ bison | [] [] [] |
+ bison-runtime | [] [] [] [] [] [] [] |
+ bluez-pin | [] [] [] [] [] [] [] [] |
+ bombono-dvd | [] () |
+ buzztard | [] [] |
+ cflow | [] |
+ clisp | [] [] |
+ coreutils | [] [] [] [] [] [] |
+ cpio | [] [] [] |
+ cppi | [] |
+ cpplib | [] |
+ cryptsetup | [] |
+ dfarc | [] |
+ dialog | [] [] [] [] |
+ dico | [] |
+ diffutils | [] [] [] [] [] [] |
+ dink | () |
+ doodle | [] [] |
+ e2fsprogs | [] [] |
+ enscript | [] [] [] [] [] |
+ exif | [] [] [] () [] |
+ fetchmail | [] [] [] [] |
+ findutils | [] [] [] [] [] |
+ flex | [] [] [] [] [] |
+ freedink | [] [] |
+ gas | |
+ gawk | [] [] [] [] |
+ gcal | |
+ gcc | [] |
+ gettext-examples | [] [] [] [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] [] [] [] [] |
+ gettext-tools | [] [] [] [] [] [] |
+ gip | [] [] [] [] [] |
+ gjay | |
+ gliv | [] [] [] [] [] [] |
+ glunarclock | [] [] [] [] [] |
+ gnubiff | [] () |
+ gnucash | [] () () () |
+ gnuedu | [] |
+ gnulib | [] [] [] [] |
+ gnunet | |
+ gnunet-gtk | |
+ gnutls | [] [] |
+ gold | |
+ gpe-aerial | [] [] [] [] [] [] [] |
+ gpe-beam | [] [] [] [] [] [] [] |
+ gpe-bluetooth | [] [] |
+ gpe-calendar | [] [] [] [] |
+ gpe-clock | [] [] [] [] [] [] [] [] |
+ gpe-conf | [] [] [] [] [] [] [] |
+ gpe-contacts | [] [] [] [] [] |
+ gpe-edit | [] [] [] |
+ gpe-filemanager | [] [] [] |
+ gpe-go | [] [] [] [] [] [] [] [] |
+ gpe-login | [] [] |
+ gpe-ownerinfo | [] [] [] [] [] [] [] [] |
+ gpe-package | [] [] |
+ gpe-sketchbook | [] [] [] [] [] [] [] |
+ gpe-su | [] [] [] [] [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] [] [] [] [] |
+ gpe-timesheet | [] [] [] [] [] [] [] [] |
+ gpe-today | [] [] [] [] [] [] [] [] |
+ gpe-todo | [] [] [] [] [] |
+ gphoto2 | [] [] [] [] [] [] [] [] |
+ gprof | [] [] [] |
+ gpsdrive | [] [] |
+ gramadoir | [] [] |
+ grep | [] [] [] [] |
+ grub | [] [] [] |
+ gsasl | [] [] [] [] |
+ gss | [] [] [] |
+ gst-plugins-bad | [] [] [] [] [] [] |
+ gst-plugins-base | [] [] [] [] [] |
+ gst-plugins-good | [] [] [] [] [] |
+ gst-plugins-ugly | [] [] [] [] [] [] |
+ gstreamer | [] [] [] [] [] |
+ gtick | [] [] [] |
+ gtkam | [] [] [] [] [] [] |
+ gtkorphan | [] |
+ gtkspell | [] [] [] [] [] [] [] [] [] [] |
+ gutenprint | [] [] |
+ hello | [] [] [] [] |
+ help2man | [] [] |
+ hylafax | [] |
+ idutils | [] [] [] [] [] |
+ indent | [] [] [] [] [] [] [] |
+ iso_15924 | [] [] [] [] |
+ iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] |
+ iso_3166_2 | [] [] [] |
+ iso_4217 | [] [] [] [] [] [] [] [] |
+ iso_639 | [] [] [] [] [] [] [] [] [] |
+ iso_639_3 | [] [] |
+ jwhois | [] [] [] [] |
+ kbd | [] [] [] |
+ keytouch | [] [] [] |
+ keytouch-editor | [] [] [] |
+ keytouch-keyboa... | [] [] [] |
+ klavaro | [] [] |
+ latrine | [] [] |
+ ld | |
+ leafpad | [] [] [] [] [] [] [] [] [] |
+ libc | [] [] [] [] |
+ libexif | [] [] () [] |
+ libextractor | |
+ libgnutls | [] [] |
+ libgpewidget | [] [] [] |
+ libgpg-error | [] [] |
+ libgphoto2 | [] [] |
+ libgphoto2_port | [] [] [] [] [] |
+ libgsasl | [] [] [] [] [] |
+ libiconv | [] [] [] [] [] |
+ libidn | [] [] |
+ lifelines | [] [] |
+ liferea | [] [] [] [] [] () () [] |
+ lilypond | [] |
+ linkdr | [] [] [] |
+ lordsawar | |
+ lprng | [] |
+ lynx | [] [] [] |
+ m4 | [] [] [] [] [] |
+ mailfromd | [] |
+ mailutils | [] |
+ make | [] [] [] [] |
+ man-db | [] [] [] |
+ man-db-manpages | [] [] [] |
+ minicom | [] [] [] [] |
+ mkisofs | [] [] [] |
+ myserver | |
+ nano | [] [] [] [] |
+ opcodes | [] [] |
+ parted | [] [] [] [] |
+ pies | [] |
+ popt | [] [] [] [] |
+ psmisc | [] [] [] |
+ pspp | [] [] |
+ pwdutils | [] |
+ radius | [] [] [] |
+ recode | [] [] [] [] [] [] [] [] |
+ rosegarden | () () |
+ rpm | [] [] [] |
+ rush | [] [] |
+ sarg | |
+ screem | |
+ scrollkeeper | [] [] [] [] [] [] [] [] |
+ sed | [] [] [] [] [] [] [] [] [] |
+ sharutils | [] [] [] [] |
+ shishi | [] |
+ skencil | [] [] |
+ solfege | [] [] [] [] |
+ solfege-manual | [] [] [] |
+ soundtracker | [] |
+ sp | |
+ sysstat | [] [] [] [] |
+ tar | [] [] [] [] |
+ texinfo | [] [] [] [] |
+ tin | [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux-ng | [] [] [] [] [] |
+ vice | [] |
+ vmm | [] |
+ vorbis-tools | [] [] |
+ wastesedge | [] |
+ wdiff | [] [] |
+ wget | [] [] [] [] [] [] [] |
+ wyslij-po | [] [] [] |
+ xchat | [] [] [] [] [] [] [] [] [] |
+ xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] |
+ xkeyboard-config | [] [] [] |
+ +---------------------------------------------------+
+ nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr
+ 135 10 4 7 105 1 29 62 47 91 3 54 46 9 37
+
+ sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW
+ +---------------------------------------------------+
+ a2ps | [] [] [] [] [] | 27
+ aegis | [] | 9
+ ant-phone | [] [] [] [] | 9
+ anubis | [] [] [] [] | 15
+ aspell | [] [] [] | 20
+ bash | [] [] [] | 12
+ bfd | [] | 6
+ bibshelf | [] [] [] | 16
+ binutils | [] [] | 8
+ bison | [] [] | 12
+ bison-runtime | [] [] [] [] [] [] | 29
+ bluez-pin | [] [] [] [] [] [] [] [] | 37
+ bombono-dvd | [] | 4
+ buzztard | [] | 7
+ cflow | [] [] [] | 9
+ clisp | | 10
+ coreutils | [] [] [] [] | 22
+ cpio | [] [] [] [] [] [] | 13
+ cppi | [] [] | 5
+ cpplib | [] [] [] [] [] [] | 14
+ cryptsetup | [] [] | 7
+ dfarc | [] | 9
+ dialog | [] [] [] [] [] [] [] | 30
+ dico | [] | 2
+ diffutils | [] [] [] [] [] [] | 30
+ dink | | 4
+ doodle | [] [] | 7
+ e2fsprogs | [] [] [] | 11
+ enscript | [] [] [] [] | 17
+ exif | [] [] [] | 16
+ fetchmail | [] [] [] | 17
+ findutils | [] [] [] [] [] | 20
+ flex | [] [] [] [] | 15
+ freedink | [] | 10
+ gas | [] | 4
+ gawk | [] [] [] [] | 18
+ gcal | [] [] | 5
+ gcc | [] [] [] | 7
+ gettext-examples | [] [] [] [] [] [] [] | 34
+ gettext-runtime | [] [] [] [] [] [] [] | 29
+ gettext-tools | [] [] [] [] [] [] | 22
+ gip | [] [] [] [] | 22
+ gjay | [] | 3
+ gliv | [] [] [] | 14
+ glunarclock | [] [] [] [] [] | 19
+ gnubiff | [] [] | 4
+ gnucash | () [] () [] () | 10
+ gnuedu | [] [] | 7
+ gnulib | [] [] [] [] | 16
+ gnunet | [] | 1
+ gnunet-gtk | [] [] [] | 5
+ gnutls | [] [] [] | 10
+ gold | [] | 4
+ gpe-aerial | [] [] [] | 18
+ gpe-beam | [] [] [] | 19
+ gpe-bluetooth | [] [] [] | 13
+ gpe-calendar | [] [] [] [] | 12
+ gpe-clock | [] [] [] [] [] | 28
+ gpe-conf | [] [] [] [] | 20
+ gpe-contacts | [] [] [] | 17
+ gpe-edit | [] [] [] | 12
+ gpe-filemanager | [] [] [] [] | 16
+ gpe-go | [] [] [] [] [] | 25
+ gpe-login | [] [] [] | 11
+ gpe-ownerinfo | [] [] [] [] [] | 25
+ gpe-package | [] [] [] | 13
+ gpe-sketchbook | [] [] [] | 20
+ gpe-su | [] [] [] [] [] | 30
+ gpe-taskmanager | [] [] [] [] [] | 29
+ gpe-timesheet | [] [] [] [] [] | 25
+ gpe-today | [] [] [] [] [] [] | 30
+ gpe-todo | [] [] [] [] | 17
+ gphoto2 | [] [] [] [] [] | 24
+ gprof | [] [] [] | 15
+ gpsdrive | [] [] [] | 11
+ gramadoir | [] [] [] | 11
+ grep | [] [] [] | 10
+ grub | [] [] [] | 14
+ gsasl | [] [] [] [] | 14
+ gss | [] [] [] | 11
+ gst-plugins-bad | [] [] [] [] | 26
+ gst-plugins-base | [] [] [] [] [] | 24
+ gst-plugins-good | [] [] [] [] | 24
+ gst-plugins-ugly | [] [] [] [] [] | 29
+ gstreamer | [] [] [] [] | 22
+ gtick | [] [] [] | 13
+ gtkam | [] [] [] | 20
+ gtkorphan | [] [] [] | 14
+ gtkspell | [] [] [] [] [] [] [] [] [] | 45
+ gutenprint | [] | 10
+ hello | [] [] [] [] [] [] | 21
+ help2man | [] [] | 7
+ hylafax | [] | 5
+ idutils | [] [] [] [] | 17
+ indent | [] [] [] [] [] [] | 30
+ iso_15924 | () [] () [] [] | 16
+ iso_3166 | [] [] () [] [] () [] [] [] () | 53
+ iso_3166_2 | () [] () [] | 9
+ iso_4217 | [] () [] [] () [] [] | 26
+ iso_639 | [] [] [] () [] () [] [] [] [] | 38
+ iso_639_3 | [] () | 8
+ jwhois | [] [] [] [] [] | 16
+ kbd | [] [] [] [] [] | 15
+ keytouch | [] [] [] | 16
+ keytouch-editor | [] [] [] | 14
+ keytouch-keyboa... | [] [] [] | 14
+ klavaro | [] | 11
+ latrine | [] [] [] | 10
+ ld | [] [] [] [] | 11
+ leafpad | [] [] [] [] [] [] | 33
+ libc | [] [] [] [] [] | 21
+ libexif | [] () | 7
+ libextractor | [] | 1
+ libgnutls | [] [] [] | 9
+ libgpewidget | [] [] [] | 14
+ libgpg-error | [] [] [] | 9
+ libgphoto2 | [] [] | 8
+ libgphoto2_port | [] [] [] [] | 14
+ libgsasl | [] [] [] | 13
+ libiconv | [] [] [] [] | 21
+ libidn | () [] [] | 11
+ lifelines | [] | 4
+ liferea | [] [] [] | 21
+ lilypond | [] | 7
+ linkdr | [] [] [] [] [] | 17
+ lordsawar | | 1
+ lprng | [] | 3
+ lynx | [] [] [] [] | 17
+ m4 | [] [] [] [] | 19
+ mailfromd | [] [] | 3
+ mailutils | [] | 5
+ make | [] [] [] [] | 21
+ man-db | [] [] [] | 8
+ man-db-manpages | | 4
+ minicom | [] [] | 16
+ mkisofs | [] [] | 9
+ myserver | | 0
+ nano | [] [] [] [] | 21
+ opcodes | [] [] [] | 11
+ parted | [] [] [] [] [] | 15
+ pies | [] [] | 3
+ popt | [] [] [] [] [] [] | 27
+ psmisc | [] [] | 11
+ pspp | | 4
+ pwdutils | [] [] | 6
+ radius | [] [] | 9
+ recode | [] [] [] [] | 28
+ rosegarden | () | 0
+ rpm | [] [] [] | 11
+ rush | [] [] | 4
+ sarg | | 1
+ screem | [] | 3
+ scrollkeeper | [] [] [] [] [] | 27
+ sed | [] [] [] [] [] | 30
+ sharutils | [] [] [] [] [] | 22
+ shishi | [] | 3
+ skencil | [] [] | 7
+ solfege | [] [] [] [] | 16
+ solfege-manual | [] | 8
+ soundtracker | [] [] [] | 9
+ sp | [] | 3
+ sysstat | [] [] | 15
+ tar | [] [] [] [] [] [] | 23
+ texinfo | [] [] [] [] [] | 17
+ tin | | 4
+ unicode-han-tra... | | 0
+ unicode-transla... | | 2
+ util-linux-ng | [] [] [] [] | 20
+ vice | () () | 1
+ vmm | [] | 4
+ vorbis-tools | [] | 6
+ wastesedge | | 2
+ wdiff | [] [] | 7
+ wget | [] [] [] [] [] | 26
+ wyslij-po | [] [] | 8
+ xchat | [] [] [] [] [] [] | 36
+ xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | 63
+ xkeyboard-config | [] [] [] | 22
+ +---------------------------------------------------+
+ 85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW
+ 178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618
+
+ Some counters in the preceding matrix are higher than the number of
+visible blocks let us expect. This is because a few extra PO files are
+used for implementing regional variants of languages, or language
+dialects.
+
+ For a PO file in the matrix above to be effective, the package to
+which it applies should also have been internationalized and
+distributed as such by its maintainer. There might be an observable
+lag between the mere existence a PO file and its wide availability in a
+distribution.
+
+ If June 2010 seems to be old, you may fetch a more recent copy of
+this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
+matrix with full percentage details can be found at
+`https://translationproject.org/extra/matrix.html'.
+
+1.5 Using `gettext' in new packages
+===================================
+
+If you are writing a freely available program and want to
+internationalize it you are welcome to use GNU `gettext' in your
+package. Of course you have to respect the GNU Library General Public
+License which covers the use of the GNU `gettext' library. This means
+in particular that even non-free programs can use `libintl' as a shared
+library, whereas only free software can use `libintl' as a static
+library or use modified versions of `libintl'.
+
+ Once the sources are changed appropriately and the setup can handle
+the use of `gettext' the only thing missing are the translations. The
+Free Translation Project is also available for packages which are not
+developed inside the GNU project. Therefore the information given above
+applies also for every other Free Software Project. Contact
+`[email protected]' to make the `.pot' files available
+to the translation teams.
+
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..a8e8abe
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,62 @@
+Package: libgpg-error
+Maintainer: Werner Koch <[email protected]>
+Bug reports: [email protected]
+Mailing list: [email protected]
+Security related bug reports: [email protected]
+License (library): LGPLv2.1+
+License (manual tools): GPLv2+ with exception
+
+Libgpg-error is free software. See the files COPYING.LIB and COPYING
+for copying conditions. License copyright years may be listed using
+range notation, e.g., 2000-2013, indicating that every year in the
+range, inclusive, is a copyrightable year that would otherwise be
+listed individually.
+
+
+Authors with a DCO
+==================
+
+We do not collect DCOs for libgpg-error. As a supporting library for
+GnuPG, Libgcrypt, and GPGME a DCO for any of these projects is
+sufficient.
+
+
+Translators
+===========
+
+cs - Petr Pisar <petr.pisar at atlas.cz>
+da - Joe Hansen <joedalton2 at yahoo.dk>
+de - Werner Koch <wk at gnupg.org>
+eo - Felipe Castro <fefcas at gmail.com>
+fr - David Prévot <david at tilapin.org>
+ Stephane Roy <sroy at j2n.net>
+it - Francesco Groccia <fgr at anche.no>
+jp - Takeshi Hamasaki <hmatrjp at users.sourceforge.jp>
+ Yasuaki Taniguchi <yasuakit at gmail.com>
+nl - Freek de Kruijf <f.de.kruijf at gmail.com>
+pl - Jakub Bogusz <qboosh at pld-linux.org>
+ro - Laurentiu Buzdugan <lbuz at rolix.org>
+sv - Daniel Nylander <po at danielnylander.se>
+uk - Yuri Chornoivan <yurchor at ukr.net>
+vi - Clytie Siddall <clytie at riverland.net.au>
+zh_CN - Aron Xu <happyaron.xu at gmail.com>
+
+
+More credits
+============
+
+Robert Schiele <rschiele at uni-mannheim.de> wrote libgpg-error.spec.
+
+Thanks to Yukihiro Nakadaira for his public domain iconv
+implementation for Windows.
+
+
+ Copyright 2003-2007, 2013-2017 g10 Code GmbH
+
+ This file is free software; as a special exception the author gives
+ unlimited permission to copy and/or distribute it, with or without
+ modifications, as long as this notice is preserved.
+
+ This file 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.
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..623b625
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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
+
+
+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.
+
+ <signature of Ty Coon>, 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/COPYING.LIB b/COPYING.LIB
new file mode 100644
index 0000000..2d2d780
--- /dev/null
+++ b/COPYING.LIB
@@ -0,0 +1,510 @@
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations
+below.
+
+ When we speak of free software, we are referring to freedom of use,
+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 and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it
+becomes a de-facto standard. To achieve this, non-free programs must
+be allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, 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 library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete 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 distribute a copy of this License along with the
+Library.
+
+ 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 Library or any portion
+of it, thus forming a work based on the Library, 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) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+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 Library, 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 Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you 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.
+
+ If distribution of 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 satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at least
+ three years, to give the same user the materials specified in
+ Subsection 6a, above, for a charge no more than the cost of
+ performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be 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.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library 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.
+
+ 9. 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 Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+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 with
+this License.
+
+ 11. 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 Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library 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 Library.
+
+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.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library 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.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser 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 Library
+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 Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+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
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "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
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. 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 LIBRARY 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
+LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms
+of the ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library.
+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.
+
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or
+your school, if any, to sign a "copyright disclaimer" for the library,
+if necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James
+ Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..3994986
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,16 @@
+No more ChangeLog files
+========================
+
+Do not modify any of the ChangeLog files in Libgpg-error. Starting on
+December 1st, 2011 we put change information only in the GIT commit
+log, and generate a top-level ChangeLog file from logs at "make dist"
+time. As such, there are strict requirements on the form of the
+commit log messages. See doc/HACKING for details. The old ChangeLog
+files have all be renamed to ChangeLog-2011.
+
+
+
+Local Variables:
+buffer-read-only: t
+mode: text
+End:
diff --git a/ChangeLog-2011 b/ChangeLog-2011
new file mode 100644
index 0000000..474164c
--- /dev/null
+++ b/ChangeLog-2011
@@ -0,0 +1,1211 @@
+2011-12-01 Werner Koch <[email protected]>
+
+ NB: ChangeLog files are no longer manually maintained. Starting
+ on December 1st, 2011 we put change information only in the GIT
+ commit log, and generate a top-level ChangeLog file from logs at
+ "make dist". See doc/HACKING for details.
+
+2011-11-28 Jim Meyering <[email protected]>
+
+ accept --with-libgpg-error-prefix as well as --with-gpg-error-prefix
+ * src/gpg-error.m4 (AM_PATH_GPG_ERROR): Also accept
+ --with-libgpg-error-prefix=PFX, for consistency with our three
+ library sibling packages.
+
+2011-08-23 Werner Koch <[email protected]>
+
+ * src/err-codes.h.in: Add GPG_ERR_DUP_KEY and GPG_ERR_AMBIGUOUS.
+
+2011-04-06 Werner Koch <[email protected]>
+
+ * autogen.sh: Support option --build-w64.
+ * configure.ac (HAVE_W64_SYSTEM): New.
+
+ * src/gpg-error.m4: Test whether gpg-error-config exists.
+
+2011-02-23 Werner Koch <[email protected]>
+
+ * autogen.sh: Check git setup.
+
+ * src/gpg-error-config.in: Add option --host.
+ * configure.ac (GPG_ERROR_CONFIG_HOST): New.
+ * src/gpg-error.m4: Use AC_PATH_TOOL to look for
+ gpg-error-config. Print a warning if host does not match.
+
+2011-02-01 Werner Koch <[email protected]>
+
+ * src/err-codes.h.in: Add GPG_ERR_INV_CURVE and GPG_ERR_UNKNOWN_CURVE.
+
+2011-01-06 Werner Koch <[email protected]>
+
+ * src/err-codes.h.in: Add GPG_ERR_NO_KEYSERVER.
+
+2010-12-23 Werner Koch <[email protected]>
+
+ * configure.ac: Support git_revision.
+
+2010-11-01 Marcus Brinkmann <[email protected]>
+
+ * src/w32-gettext.c (CreateFileA): Rename to ...
+ (MyCreateFileA): ... this, but provide macro CreateFileA.
+
+2010-10-31 Werner Koch <[email protected]>
+
+ * src/init.c (abort): Use TerminateProcess; exit would call atexit
+ functions.
+
+2010-10-29 Marcus Brinkmann <[email protected]>
+
+ * src/w32-gettext.c: Guard include of <sys/types.h>. Do not
+ include <sys/stat.h>.
+ (CreateFileA) [HAVE_W32CE_SYSTEM]: New wrapper function.
+ (load_domain): Use native Windows API.
+
+ * src/init.c (TLS_OUT_OF_INDEXES) [HAVE_W32CE_SYSTEM,
+ !TLS_OUT_OF_INDEXES]: Define it.
+ (abort) [!__MINGW32CE__]: Define it.
+
+2010-10-28 Werner Koch <[email protected]>
+
+ * src/mkstrtable.awk: s/inline/GPG_ERR_INLINE/
+ * src/w32-gettext.c: Include gpg-error.h and replace all
+ __inline__ by GPG_ERR_INLINE.
+ (module_init): Use _GPG_ERR_CONSTRUCTOR.
+ (_gpg_w32__init_gettext_module): Build also if we don't have
+ constructors
+ * src/gpg-error.h.in (GPG_ERR_INLINE) [_MSC_VER]: Define as __inline.
+
+2010-10-26 Werner Koch <[email protected]>
+
+ Release 1.10.
+
+ * configure.ac: Set LT version to C8/A8/R0.
+ * config.guess: Update to version 2010-09-24.
+ * config.sub: Update to version 2010-09-11.
+
+2010-10-20 Werner Koch <[email protected]>
+
+ * potomo: New. Copied from GnuPG.
+ * Makefile.am (install-data-hook) [W32]: New.
+
+ * src/init.c (get_locale_dir): Strip the "bin" part.
+ * src/gpg-error.c (get_locale_dir): Ditto.
+
+2010-09-30 Werner Koch <[email protected]>
+
+ * src/err-codes.h.in: Add GPG_ERR_FULLY_CANCELED.
+
+2010-09-16 Werner Koch <[email protected]>
+
+ * src/w32-gettext.c (module_init): Do not set a constructur if not
+ build as DLL.
+ (_gpg_w32__init_gettext_module): New.
+
+2010-09-16 gettextize <[email protected]>
+
+ * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.17.
+
+2010-09-16 Werner Koch <[email protected]>
+
+ * src/err-codes.h.in: Add GPG_ERR_MISSING_ISSUER_CERT.
+
+ * src/Makefile.am (err-sources.h, err-codes.h): Built them in the
+ source directory.
+
+2010-09-02 Werner Koch <[email protected]>
+
+ * src/err-codes.h.in: Add GPG_ERR_NOT_INITIALIZED.
+
+2010-08-19 Werner Koch <[email protected]>
+
+ * configure.ac (AH_BOTTOM): Define GPG_ERR_ENABLE_ERRNO_MACROS.
+ * src/w32ce-add.h (strerror) [!GPG_ERR_ENABLE_ERRNO_MACROS]: Do
+ not define.
+
+2010-07-21 Werner Koch <[email protected]>
+
+ Release 1.9.
+
+ * configure.ac: Set LT version to C7/A7/R0.
+
+2010-07-20 Werner Koch <[email protected]>
+
+ * src/init.c (DllMain) [!DLL_EXPORT]: Do not build.
+ (gpg_err_init) [W32][!DLL_EXPORT]: Init TLS.
+ (gpg_err_deinit): New.
+ * src/gpg-error.def.in: Add gpg_err_deinit.
+ * src/gpg-error.h.in: Add gpg_err_deinit.
+
+2010-07-05 Werner Koch <[email protected]>
+
+ * src/err-codes.h.in (GPG_ERR_TOO_MANY, GPG_ERR_LIMIT_REACHED): New.
+
+2010-06-18 Werner Koch <[email protected]>
+
+ * src/err-codes.h.in (GPG_ERR_MISSING_KEY): New.
+
+2010-05-06 Werner Koch <[email protected]>
+
+ Release 1.8.
+
+ * configure.ac: Set LT version to C6/A6/R0.
+
+2010-04-14 Werner Koch <[email protected]>
+
+ * src/init.c (_gpg_w32ce_get_errno): Add native error mapping.
+ * src/Makefile.am (mkw32errmap.map.c): New.
+ * src/mkw32errmap.c (struct table_s): Add field W32CODE2.
+ (table): Init this field.
+ (main): Add option --map.
+
+2010-03-15 Werner Koch <[email protected]>
+
+ * src/mkheader.awk: Add emacs local-var line.
+
+ * src/w32-add.h (gettext_localename): Fix type in name.
+
+2010-03-09 Werner Koch <[email protected]>
+
+ * src/w32-add.h [!GPG_ERR_ENABLE_GETTEXT_MACROS]: Do not provide
+ gettext macros.
+
+2010-03-08 Werner Koch <[email protected]>
+
+ * src/w32-add.h (_GPG_ERR_ATTR_FORMAT_ARG): New.
+ (_gpg_w32_gettext, _gpg_w32_dgettext, _gpg_w32_dngettext): Use it.
+
+2010-03-01 Werner Koch <[email protected]>
+
+ * src/mkw32errmap.c: Map ESPIPE.
+
+2010-02-17 Werner Koch <[email protected]>
+
+ * src/Makefile.am: Revert last change.
+ (gpg_extra_headers): New.
+ (nobase_include_HEADERS): Rename to include_HEADERS and remove
+ extra_headers.
+ (mkerrcodes.h): Depend on gpg_extra_headers.
+ (install-data-local): New.
+ (gpg-extra/errno.h): Create gpg-extra dir if needed.
+
+2010-02-17 Werner Koch <[email protected]>
+
+ * src/Makefile.am (extra_headers): Remove.
+
+2010-01-21 Werner Koch <[email protected]>
+
+ * configure.ac (have_w32ce_system): Initialize to no.
+
+ * src/mkstrtable.awk (END): Do not print PREFIX before
+ LAST_MSGSTR.
+
+ * src/init.c (get_locale_dir): Rework to match what gnupg is doing.
+ (get_root_key, read_w32_registry_string): Remove.
+ * src/gpg-error.c (get_locale_dir): Replace by code from init.c
+ (get_root_key, read_w32_registry_string): Remove.
+
+2010-01-20 Werner Koch <[email protected]>
+
+ * src/init.c (gpg_err_init): Factor code out to ..
+ (real_init): .. new.
+
+ * src/Makefile.am (gpg_error_SOURCES): Remove arch_sources.
+ (export_symbols): Do not prefix gpg-error-def with srcdir.
+
+2010-01-19 Werner Koch <[email protected]>
+
+ * src/init.c (DllMain): Call _w32_gettext_init.
+ (get_tls): Use it also for standard Windows.
+ (DllMain): Ditto.
+ (struct tls_space_s): Move to ..
+ (get_tls): Make global.
+ * src/init.h: .. New.
+ * src/gettext.h: Do not include w32-gettext.h.
+ * src/w32-gettext.c: Replace by version from GnuPG.
+ (my_nl_locale_name) [W32CE]: Do not use getenv. Use
+ GetSystemDefaultLCID.
+ (struct loaded_domain): Use uint16_t for NSTRINGS and MAPPED to
+ save space.
+ (load_domain): Check for too large MO files.
+ (utf8_to_wchar): Use gpg_err_set_errno.
+ (bindtextdomain): Rename to _gpg_w32_bindtextdomain.
+ (textdomain): Rename to _gpg_w32_textdomain.
+ (gettext): Rename to _gpg_w32_gettext.
+ (dgettext): Rename to _gpg_w32_dgettext.
+ (ngettext): Remove.
+ (gettext_localename): Rename to _gpg_w32_gettext_localename.
+ (gettext_select_utf8): Rename to _gpg_w32_gettext_use_utf8.
+ (_gpg_w32_bindtextdomain): Change to only register the directory.
+ Return the current directory if asked to.
+ (do_gettext): Add DOMAINNAME arg and take care of it.
+ * src/w32-add.h: New.
+ * src/w32-gettext.h: Remove.
+ * src/Makefile.am (extra-h.in): Process w32-add.h.
+ (arch_sources): Remove w32-gettext.h.
+
+2010-01-18 Werner Koch <[email protected]>
+
+ * src/init.c (wchar_to_utf8, utf8_to_wchar): New.
+
+ * src/gpg-error.c (main): Add option --list.
+
+2010-01-18 Werner Koch <[email protected]>
+
+ * ltmain.sh (wrappers_required): Don't set for mingw32ce.
+
+ * tests/Makefile.am (extra_includes): New.
+ * tests/t-syserror.c (main): Use gpg_err_set_errno.
+
+ * src/w32ce-add.h: New.
+ * src/Makefile.am (EXTRA_DIST): Add it
+ (extra-h.in): New rule
+ (gpg-error.h): Pass extra-h.in to mkheader.
+ * src/mkheader.awk (extra_body): New.
+
+ * src/gpg-error.c (get_err_from_number): Use gpg_err_set_errno.
+
+ * src/mkw32errmap.c: New
+ * src/gpg-error.def: Rename to ..
+ * src/gpg-error.def.in: .. this.
+ (_gpg_errno_location): New.
+ * src/init.c (struct tls_space_s, tls_index): New.
+ (get_tls, _gpg_errno_location, DllMain): New.
+ (read_w32_registry_string) [W32CE]: Don't expand envvars.
+ (_gpg_w32ce_strerror): New.
+ * src/Makefile.am (extra_headers, extra_cppflags): New.
+ (include_HEADERS): Add extra_headers. Prefix with nobase_.
+ (libgpg_error_la_CPPFLAGS, gpg_error_CPPFLAGS)
+ (mkerrcodes.h): Add extra_cppflags.
+ (RCCOMPILE): Replace libgpg_error_la_CPPFLAGS by direct inclusion
+ of -DLOCALEDIR.
+ * configure.ac (HAVE_W32CE_SYSTEM): New AM_CONDITIONAL and
+ AC_DEFINE.
+ (GPG_ERROR_CONFIG_ISUBDIRAFTER): New.
+ * src/gpg-error-config.in <--libs>: Replace fixed -lgpg-error
+ by subst variable.
+ (isubdirafter): New.
+ <--cflags>: Take subst variable in account. Add idirafter stuff.
+
+2009-10-26 Marcus Brinkmann <[email protected]>
+
+ * src/gpg-error.h.in (GPG_ERR_SOURCE_DIM): Reduce to 128.
+
+2009-09-29 Werner Koch <[email protected]>
+
+ * src/err-codes.h.in (GPG_ERR_NO_ENGINE): New.
+
+2009-09-21 Werner Koch <[email protected]>
+
+ * src/err-sources.h.in (GPG_ERR_SOURCE_G13): New.
+
+2009-08-20 Werner Koch <[email protected]>
+
+ * src/err-codes.h.in: s/octadecimal/octal/. Reported by Petr Pisar.
+
+2009-07-23 Werner Koch <[email protected]>
+
+ * src/err-codes.h.in: Add GPG_ERR_NOT_ENABLED.
+
+2009-07-17 Marcus Brinkmann <[email protected]>
+
+ * src/mkerrnos.awk: Output code to cause WSA Errors to be found
+ from gpg error codes.
+ * README: Add problem of translating error codes back and forth.
+
+ * src/mkerrcodes1.awk: Output code to cause WSA Errors to be
+ transparently translated.
+ * src/code-from-errno.c [HAVE_W32_SYSTEM]: Don't include winsock2.h.
+ (w32_special_errnos) [HAVE_W32_SYSTEM]: Removed.
+ (gpg_err_code_from_errno) [HAVE_W32_SYSTEM]: Remove special case.
+ * README: Document problem with printing some WSA Errors.
+
+2009-06-23 Marcus Brinkmann <[email protected]>
+
+ Update to libtool 2.2.6a.
+ * configure.ac: Invoke AC_CONFIG_MACRO_DIR.
+ (AC_LIBTOOL_WIN32_DLL, AC_LIBTOOL_RC): Replace by ...
+ (LT_PREREQ, LT_INIT, LT_LANG): ... these.
+ * config.guess, config.sub, install-sh, ltmain.sh, m4/libtool.m4:
+ Updated to libtool 2.2.6a.
+ * m4/ltoptions.m4, m4/ltsugar.m4, m4/ltversion.m4,
+ m4/lt~obsolete.m4: New files from libtool 2.2.6a.
+ * src/Makefile.am (LTRCCOMPILE): Refactor with ...
+ (RCCOMPILE): ... this new macro. Add $(libgpg_error_la_CPPFLAGS).
+ (SUFFIXES): Add .lo.
+ (.rc.o): Change to ...
+ (.rc.lo): ... this implicit rule.
+ (gpg_error_res_ldflag): Removed.
+ (gpg_error_res): Use libtool object file name here.
+ (install-def-file): Fix typo.
+ (libgpg_error_la_LDFLAGS): Remove gpg_error_res_ldflag usage.
+ (libgpg_error_la_LIBADD): Add gpg_error_res.
+
+2008-11-26 Werner Koch <[email protected]>
+
+ Release 1.7.
+
+ * configure.ac: Set LT version to C5/A5/R0.
+
+2008-11-12 Werner Koch <[email protected]>
+
+ * src/err-codes.h.in: Add GPG_ERR_NO_PASSPHRASE and GPG_ERR_NO_PIN.
+
+2008-11-08 Moritz <[email protected]>
+
+ * lang/cl/gpg-error.lisp ("gpg_err_code_from_syserror"): Fix
+ defcfun: removed "(void)".
+
+ * lang/cl/gpg-error.lisp (size-t): Wrong call to defctype:
+ function accepts optional, not keyword argument.
+ (gpg-error-t): Likewise.
+
+2008-10-29 Marcus Brinkmann <[email protected]>
+
+ * src/mkstrtable.awk: Make generated code -W clean to silence gcc
+ warnings.
+
+2008-08-06 Werner Koch <[email protected]>
+
+ * src/err-codes.h.in (GPG_ERR_NOT_OPERATIONAL): New.
+
+2008-04-01 Werner Koch <[email protected]>
+
+ * configure.ac (AC_INIT): Fix m4 quoting.
+
+2007-12-11 Werner Koch <[email protected]>
+
+ * Makefile.am (EXTRA_DIST): Add COPYING.
+
+2007-10-29 Werner Koch <[email protected]>
+
+ Released 1.6.
+
+ * configure.ac: Set LT version to C4/A4/R0.
+
+ * config.guess, config.sub: Updated.
+
+ * src/err-sources.h.in: (GPG_ERR_SOURCE_KLEO): New.
+
+ * w32-gettext.c (SUBLANG_BENGALI_BANGLADESH): Fix to 2 as per MSDN.
+ (SUBLANG_PUNJABI_PAKISTAN): Remove as it is not in MSDN.
+ (SUBLANG_ROMANIAN_MOLDOVA): Remove as it is not in MSDN.
+ (SUBLANG_ROMANIAN_ROMANIA): Change to value 1 as per MSDN.
+
+2007-09-27 Marcus Brinkmann <[email protected]>
+
+ * src/Makefile.am (%.o): Replace pattern rule with suffix rule.
+ (SUFFIXES): New variable.
+
+2007-09-27 Werner Koch <[email protected]>
+
+ * src/err-sources.h.in (GPG_ERR_SOURCE_GPA): New.
+ * src/err-codes.h.in (GPG_ERR_UNFINISHED): New.
+
+2007-08-03 Marcus Brinkmann <[email protected]>
+
+ * configure.ac: Call AM_PROG_CC_C_O. Allow --disable-languages.
+ * autogen.sh: Use = not == in test.
+ * lang/cl/Makefile.am: Do not use :=, but =.
+ * Makefile.am [!LANGUAGES_SOME]: Don't add lang to subdirs.
+ * m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4: New files.
+
+2007-05-19 Marcus Brinkmann <[email protected]>
+
+ * lang/cl/gpg-error.lisp (gpg-err-source-t): Add
+ :gpg-err-source-any.
+
+2007-06-18 Werner Koch <[email protected]>
+
+ * src/code-from-errno.c (w32_special_errnos) [W32]: New. This is
+ to provide some common mappings for winsocket error codes.
+ (gpg_err_code_from_errno, gpg_err_code_from_syserror): Use it.
+
+2007-05-09 Werner Koch <[email protected]>
+
+ * src/gpg-error.m4: Print found version on success.
+
+2006-12-09 Marcus Brinkmann <[email protected]>
+
+ * src/Makefile.am (EXTRA_DIST): Add README.
+ * src/README: New file.
+
+2006-12-01 Marcus Brinkmann <[email protected]>
+
+ * src/gpg-error.c (get_err_from_number): Fix last change.
+
+ * src/gpg-error.c (get_err_from_number): Support source and code
+ number in split format like "7.17".
+
+2006-11-30 Werner Koch <[email protected]>
+
+ Released 1.5.
+
+ * configure.ac: Set LT version to C3/A3/R1.
+
+ * README: Switch to tar.bz2 and sha1sum.
+
+ * src/gpg-error.c (main): Add option --version.
+
+ * autogen.sh (FORCE): Add option --force.
+
+ * intl/: Removed.
+ * Makefile.am (SUBDIRS): Removed intl.
+ * configure.ac (AM_GNU_GETTEXT): Use external flag
+ * src/Makefile.am: Removed -I../intl.
+
+2006-11-23 Werner Koch <[email protected]>
+
+ * configure.ac: Display configuration status after AC_OUTPUT.
+ (AC_INIT): Use SVN revision magic.
+ (AC_GNU_SOURCE): New.
+
+2006-11-23 gettextize <[email protected]>
+
+ * configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.15.
+
+2006-11-15 Werner Koch <[email protected]>
+
+ * autogen.sh: Add convenience option --build-amd64.
+
+2006-10-20 Werner Koch <[email protected]>
+
+ * Makefile.am (stowinstall): New convenience target.
+
+2006-09-18 Werner Koch <[email protected]>
+
+ * src/gpg-error.def: Added gpg_err_code_from_syserror.
+
+2006-09-14 Werner Koch <[email protected]>
+
+ Released 1.4.
+
+ * configure.ac: Set LT version to C3/A3/R0.
+ (AB_INIT): New.
+
+ * autogen.sh (--build-w32): Better cross-compiler locating.
+
+ * src/strerror.c (system_strerror_r): Made static.
+
+ * tests/t-syserror.c: New.
+ * tests/Makefile.am (TESTS): Added new test.
+
+ * lang/cl/gpg-error.lisp ("gpg_err_code_from_syserror"): New.
+ (gpg-err-code-from-syserror): New.
+ (gpg-error-from-syserror): New.
+ * lang/cl/gpg-error-package.lisp: Export new functions
+
+ * src/gpg-error.h.in (gpg_error_from_syserror): New.
+ * src/code-from-errno.c (gpg_err_code_from_errno): Cosmetic change
+ to first check whether ERR is zero.
+ (gpg_err_code_from_syserror): New.
+
+2006-09-06 Werner Koch <[email protected]>
+
+ * src/err-codes.h.in: Add GPG_ERR_UNKNOWN_OPTION and
+ GPG_ERR_UNKNOWN_COMMAND.
+
+2006-09-05 Werner Koch <[email protected]>
+
+ * src/err-sources.h.in (GPG_ERR_SOURCE_ANY): New. This is so that
+ we have source distinguished from the Unknown one but declaring
+ that it is an gpg-error style error code.
+
+ * src/err-codes.h.in: Added GPG_ERR_ASS_* codes, rabnge 257-281.
+ (GPG_ERR_MISSING_ERRNO): New.
+
+2006-07-04 Marcus Brinkmann <[email protected]>
+
+ * src/init.c (get_locale_dir): Return NULL instead of garbage.
+ * src/gpg-error.c (get_locale_dir): Likewise.
+ Reported by Simon Josefsson <[email protected]>.
+
+2006-05-30 Marcus Brinkmann <[email protected]>
+
+ * lang/cl/gpg-error.asd.in (gpg-error): Add "depends-on" on cffi.
+
+2006-05-29 Marcus Brinkmann <[email protected]>
+
+ * src/init.c (gpg_err_init) [!ENABLE_NLS]: Do not initialize the
+ locale.
+ * src/gpg-error.c (i18n_init) [!ENABLE_NLS]: Likewise.
+ Patch submitted by Nils Durner <[email protected]>.
+
+2006-05-25 Marcus Brinkmann <[email protected]>
+
+ * lang/cl/gpg-error.asd: Renamed to ...
+ * lang/cl/gpg-error.asd.in: ... this.
+ * configure.ac (AC_CONFIG_FILES): Add lang/cl/gpg-error.asd.in.
+
+ * lang/cl/mkerrcodes.awk, lang/cl/gpg-error-package.lisp,
+ lang/cl/gpg-error.lisp, lang/cl/gpg-error.asd, lang/cl/Makefile.am
+ (clfilesdir): Fix package and file names.
+
+ * lang/cl/Makefile.am (clfilesdir): Use datadir, not prefix.
+
+2006-05-05 Marcus Brinkmann <[email protected]>
+
+ * configure.ac (AC_CONFIG_FILES): Add lang/Makefile and
+ lang/cl/Makefile.
+ * Makefile.am (SUBDIRS): Add lang.
+ * lang: New directory.
+ * lang/README, lang/Makefile.am: New files.
+ * lang/cl: New directory.
+ * lang/cl/Makefile.am, lang/cl/README, lang/cl/gpg-error.asd,
+ lang/cl/gpg-error-package.lisp, lang/cl/gpg-error.lisp,
+ lang/cl/mkerrcodes.awk: New files.
+
+2006-03-14 Marcus Brinkmann <[email protected]>
+
+ Released 1.3.
+
+ * configure.ac (LIBGPG_ERROR_LT_REVISION): Bump for release.
+
+ Many files regenerated.
+ * src/Makefile.am (gpg_error_CPPFLAGS, libgpg_error_la_CPPFLAGS):
+ Add -I../intl.
+ * Makefile.am (SUBDIRS): Add intl.
+ * configure.ac (AC_CONFIG_FILES): Add intl/Makefile.
+ (AM_GNU_GETTEXT_VERSION): Bump to 0.14.5.
+
+2006-03-06 Marcus Brinkmann <[email protected]>
+
+ * configure.ac (min_automake_version): Bump to 1.9.6.
+ * mkinstalldirs, depcomp, compile, INSTALL, COPYING, missing,
+ install-sh: Update from automake 1.9.6.
+ ltmain.sh: Update from libtool 1.5.22.
+
+2006-03-03 Marcus Brinkmann <[email protected]>
+
+ * configure.ac (LIBGPG_ERROR_LT_CURRENT, LIBGPG_ERROR_LT_AGE):
+ Bump for release.
+ (LIBGPG_ERROR_LT_REVISION): Reset to 0 for release.
+
+2005-11-02 Werner Koch <[email protected]>
+
+ * src/Makefile.am (gpg_error_SOURCES): Include ARCH_SOURCES.
+ * src/gpg-error.c [W32]: Include gettext.h instead of libintl.h.
+
+ * configure.ac (AH_BOTTOM): Define ENABLE_NLS for W32 builds.
+ * src/w32-gettext.h (dgettext): Changed prototype from
+ libintl_dgettext.
+ * src/w32-gettext.c: Replaced use of WIN32 by HAVE_W32_SYSTEM on
+ demand of the holy GNUquisition.
+ (bindtextdomain, textdomain, dgettext): Need to cast the const way
+ from the return value.
+
+2005-10-26 Werner Koch <[email protected]>
+
+ * Makefile.am: Used dist-bzip2 option.
+
+2005-10-25 Marcus Brinkmann <[email protected]>
+
+ * src/w32-gettext.c (get_string): Remove extra arguments to
+ utf8_to_native_invocation.
+ (utf8_to_wchar, wchar_to_native): New function.
+ (utf8_to_native): Rewritten.
+
+ * src/Makefile.am (gpg_error_CPPFLAGS): New variable.
+ * src/gpg-error.c (i18n_init): Don't return anything.
+
+ * src/Makefile.am (arch_sources): New variable.
+ (libgpg_error_la_SOURCES): Add $(arch_sources).
+ * src/gettext.h [HAVE_W32_SYSTEM]: Include w32-gettext.h.
+ * src/w32-gettext.h: New file.
+ * src/w32-gettext.c: New file.
+ * src/gpg-error.h.in: Check for gcc's constructor attribute.
+ Use it for gpg_err_init.
+ (GPG_ERR_INITIALIZED): Define if constructor is available.
+ * src/gpg-error.c (main) [GPG_ERR_INITIALIZED]: Don't invoke
+ gpg_err_init.
+ (i18n_init): Call bindtextdomain as well. Now that gpg-error has
+ its own gettext implementation, we can't rely on it anymore.
+ Also, repeat all the w32 stuff for fetching the registry.
+
+2005-10-23 Marcus Brinkmann <[email protected]>
+
+ * src/Makefile.am (libgpg_error_la_SOURCES): Add init.c.
+ * src/init.c: New file.
+ * src/gpg-error.h.in (gpg_error_init): New function.
+ * src/gpg-error.def: Add gpg_err_init.
+ * src/gpg-error.c: Remove SIMPLE_GETTEXT stuff.
+ (i18n_init): Don't bind text domain.
+ (main): Call gpg_err_init.
+
+2005-10-20 Marcus Brinkmann <[email protected]>
+
+ * configure.ac: Instead checking for windres and dlltool, invoke
+ AC_LIBTOOL_WIN32_DLL and AC_LIBTOOL_RC.
+ * src/Makefile.am [HAVE_W32_SYSTEM]: Use libtool, which simplifies
+ the rules.
+
+2005-10-02 Marcus Brinkmann <[email protected]>
+
+ * configure.ac: Escape arguments in AC_INIT invocation.
+ * config.guess, config.sub, ltmain.sh: Update.
+
+2005-08-19 Werner Koch <[email protected]>
+
+ * configure.ac: Add code to allow building a W32 DLL.
+ * src/Makefile.am: Changed to allow building for W32.
+ * src/versioninfo.rc.in: New.
+ * src/gpg-error.def: New.
+
+2005-06-20 Marcus Brinkmann <[email protected]>
+
+ Released 1.1.
+
+ * configure.ac: Bump up LIBGPG_ERROR_LT_REVISION, update version
+ field.
+
+2005-06-16 Marcus Brinkmann <[email protected]>
+
+ * src/mkerrcodes.awk: Fix comment. Allow any non-empty line to
+ start the processing, not only lines starting with numbers.
+ Reported by Guillaume Libersat <[email protected]>.
+
+2005-01-05 Marcus Brinkmann <[email protected]>
+
+ * configure.ac: Check for locale.h.
+
+2005-04-20 Werner Koch <[email protected]>
+
+ * src/err-codes.h.in: Add GPG_ERR_LOCKED.
+
+2005-04-18 Werner Koch <[email protected]>
+
+ * src/err-codes.h.in: Add GPG_ERR_UNKNOWN_EXTN and
+ GPG_ERR_UNKNOWN_CRIT_EXTN.
+
+2004-12-18 Werner Koch <[email protected]>
+
+ * autogen.sh: Add option --build-w32.
+
+2004-09-14 Marcus Brinkmann <[email protected]>
+
+ * src/gpg-error.m4: Add copyright note.
+
+ * configure.ac: Call AC_CANONICAL_HOST. Suppress warning about
+ lack of strerror_r on all Solaris platforms.
+
+2004-07-30 Werner Koch <[email protected]>
+
+ Released 1.0.
+
+ * configure.ac: Bumbed version to 1.0, LT to C1/A1/R3.
+
+2004-07-15 Werner Koch <[email protected]>
+
+ * src/err-codes.h.in: Renamed description for CARD_RESET.
+
+2004-06-28 Werner Koch <[email protected]>
+
+ * src/err-codes.h.in: Add GPG_ERR_INV_REQUEST.
+
+2004-06-08 Marcus Brinkmann <[email protected]>
+
+ * src/Makefile.am (mkerrcodes): Prefix mkerrcodes.c with $(srcdir)
+ to fix VPATH build.
+
+2004-05-25 Marcus Brinkmann <[email protected]>
+
+ * src/err-codes.h.in: Add GPG_ERR_PROTOCOL_VIOLATION and
+ GPG_ERR_INV_MAC.
+
+2004-04-23 Marcus Brinkmann <[email protected]>
+
+ * src/Makefile.am (mkerrcodes): Do not use $< in non-inference rule.
+ (code-from-errno.h): Likewise.
+
+2004-04-22 Marcus Brinkmann <[email protected]>
+
+ * src/Makefile.am (gpg_error_CPPFLAGS): New variable.
+ (localedir): Likewise.
+ * gpg-error.c: Include the gettext headers.
+ (init_i18n): New function.
+ (main): Call init_i18n, gettextize messages.
+
+2004-04-02 Thomas Schwinge <[email protected]>
+
+ * autogen.sh: Added ACLOCAL_FLAGS.
+
+2004-04-19 Marcus Brinkmann <[email protected]>
+
+ * src/gpg-error.m4: Quote first argument to AC_DEFUN.
+
+ * src/mkerrcodes.awk: Allow whitespace before expanded
+ preprocessor macro (ie, the error code value). Needed for Solaris 2.8.
+
+2004-04-08 Moritz Schulte <[email protected]>
+
+ * src/gpg-error.c (main): Return zero on success.
+
+2004-03-09 Marcus Brinkmann <[email protected]>
+
+ * libgpg-error.spec.in (%files): Add gpg-error. Submitted by
+ Albrecht Dreß <[email protected]>.
+
+ * src/mkerrcodes.c (main): Fix type of argv. Return something.
+
+2004-03-09 Werner Koch <[email protected]>
+
+ * Makefile.am (dist-hook): Create a VERSION file for use by mkdiff.
+
+ * src/Makefile.am (mkerrcodes.h): Let CPP work on a temporary file.
+ (CLEANFILES): Add that temporary file.
+ * configure.ac (AC_PROG_CPP): Added.
+
+ * src/err-codes.h.in: Removed trailing spaces from
+ GPG_ERR_NOT_LOCKED.
+
+2004-03-08 Werner Koch <[email protected]>
+
+ * src/err-sources.h.in: Added GPG_ERR_SOURCE_GSTI.
+
+2004-03-07 Marcus Brinkmann <[email protected]>
+
+ Released 0.7.
+
+ * configure.ac: Bumbed up LIBGPG_ERROR_LT_REVISON.
+
+ * src/gpg-error-config.in: Fix last change.
+ * src/gpg-error-config.in (Options): Do not emit include and lib
+ directory for prefix "/usr" or "".
+
+ * tests/Makefile.am (INCLUDES): Change to -I$(top_srcdir)/src to
+ -I$(top_builddir).
+
+2004-03-01 Marcus Brinkmann <[email protected]>
+
+ * configure.ac: Define CC_FOR_BUILD.
+ * src/Makefile.am (BUILT_SOURCES): Add gpg-error.h.
+ (EXTRA_DIST): Add mkerrcodes.awk and mkerrcodes.c.
+ (CLEANFILES): Add mkerrcodes.h and mkerrcodes.
+ (mkerrcodes.h): New target.
+ (mkerrcodes): New target.
+ (code-from-errno.h): Rewritten.
+
+ * src/errnos.in: Remove include statement (which was ignored
+ anyway).
+ * src/mkerrcodes.awk: New file.
+ * src/mkerrcodes.c: New file.
+
+2004-02-27 Marcus Brinkmann <[email protected]>
+
+ * src/Makefile.am (noinst_PROGRAMS): Rename to ...
+ (bin_PROGRAMS): ... this.
+
+ * src/gpg-error.h.in: Add extern "C" closure for C-- compilers.
+
+ * src/Makefile.am (noinst_PROGRAMS): New variable.
+ (gpg_error_LDADD): New variable.
+ (gpg_error_SOURCES): New variable.
+ (EXTRA_DIST): Add mkheader.awk and gpg-error.h.in.
+ (BUILT_SOURCES): Add err-sources-sym.h, err-codes-sym.h and
+ errnos-sym.h.
+ (CLEANFILES): Add err-sources-sym.h, err-codes-sym.h,
+ errnos-sym.h and gpg-error.h.
+ (err-codes.h, err-sources.h): Add -v textidx=3 to mkstrtable.awk
+ invocation.
+ (err-codes-sym.h): New target.
+ (err-sources-sym.h): New target.
+ (gpg-error.h): New rule.
+ * src/mkstrtable.awk: Skip the second field (which contains the
+ error code symbol).
+ (FS): Allow more than one tab as field separator.
+ Allow to specify the field to be used as text with the variable
+ textidx.
+ Allow to suppress gettext markers in the output.
+ Allow to specify a prefix to the messages.
+ Allow to specify a namespace for the variable and macro names.
+ * src/mkerrnos.awk (FS): Initialize. Understand variable
+ errnoidx, which defaults to 2, to cope with the error names being
+ in a different column than the first.
+ * src/mkerrcodes1.awk: Likewise. Use \t as separator.
+ * src/mkheader.awk: New file.
+ * src/errnos.in: Add error code numbers (relativ to
+ GPG_ERR_SYSTEM_ERROR).
+ * src/strerror-sym.c: New file.
+ * src/strsources-sym.c: New file.
+ * src/err-codes.h.in: Add the error code symbol for every error
+ code.
+ (GPG_ERR_BUFFER_TOO_SHORT): Fix error code (it is 200, not 199).
+ * src/err-sources.h.in: Likewise.
+ * src/gpg-error.h.in: New file.
+ * src/gpg-error.h: File removed.
+ * src/gpg-error.c: New file.
+
+2004-02-18 Werner Koch <[email protected]>
+
+ * src/gpg-error-config.in: Ignore setting of --prefix.
+
+2004-02-11 Werner Koch <[email protected]>
+
+ * autogen.sh (check_version): Removed bashism and simplified.
+
+2004-02-03 Werner Koch <[email protected]>
+
+ * src/gpg-error.h: Added GPG_ERR_NOT_LOCKED.
+
+2003-12-22 Werner Koch <[email protected]>
+
+ * src/gpg-error.h: Added GPG_ERR_LOCALE_PROBLEM.
+
+2003-12-12 Werner Koch <[email protected]>
+
+ * src/err-codes.h.in: s/revoced/revoked/.
+
+2003-12-08 Werner Koch <[email protected]>
+
+ * README.CVS: Enhanced.
+
+ * autogen.sh: New.
+ * Makefile.am (EXTRA_DIST): Added autogen.sh.
+
+2003-11-14 Werner Koch <[email protected]>
+
+ * configure.ac: Bumbed version number to 0.7.
+
+ Released 0.6.
+
+ * configure.ac: Bumbed up LIBGPG_ERROR_LT_REVISON.
+
+2003-11-13 Werner Koch <[email protected]>
+
+ * src/gpg-error.h, src/err-codes.h.in: Removed: GPG_ERR_IO_ERROR,
+ GPG_ERR_FILE_ERROR, GPG_ERR_READ_ERROR, GPG_ERR_WRITE_ERROR,
+ GPG_ERR_LOCK_ERROR.
+
+ * src/gpg-error.h (GPG_ERR_SOURCE_DIRMNGR): Fixed typo.
+
+2003-11-12 Werner Koch <[email protected]>
+
+ * src/gpg-error.h, src/err-codes.h.in: Added these codes:
+ GPG_ERR_INV_ATTR, GPG_ERR_NO_VALUE, GPG_ERR_NOT_FOUND,
+ GPG_ERR_VALUE_NOT_FOUND, GPG_ERR_SYNTAX, GPG_ERR_INV_CRL,
+ GPG_ERR_BAD_BER, GPG_ERR_INV_BER, GPG_ERR_ELEMENT_NOT_FOUND,
+ GPG_ERR_IDENTIFIER_NOT_FOUND, GPG_ERR_INV_TAG, GPG_ERR_INV_LENGTH,
+ GPG_ERR_INV_KEYINFO, GPG_ERR_UNEXPECTED_TAG, GPG_ERR_NOT_DER_ENCODED,
+ GPG_ERR_NO_CMS_OBJ, GPG_ERR_INV_CMS_OBJ, GPG_ERR_UNKNOWN_CMS_OBJ,
+ GPG_ERR_UNSUPPORTED_CMS_OBJ, GPG_ERR_UNSUPPORTED_ENCODING,
+ GPG_ERR_UNSUPPORTED_CMS_VERSION, GPG_ERR_UNKNOWN_ALGORITHM,
+ GPG_ERR_ENCODING_PROBLEM, GPG_ERR_INV_STATE, GPG_ERR_DUP_VALUE,
+ GPG_ERR_MISSING_ACTION, GPG_ERR_MODULE_NOT_FOUND,
+ GPG_ERR_INV_OID_STRING, GPG_ERR_INV_TIME, GPG_ERR_INV_CRL_OBJ,
+ GPG_ERR_UNSUPPORTED_CRL_VERSION, GPG_ERR_INV_CERT_OBJ,
+ GPG_ERR_UNKNOWN_NAME, GPG_ERR_IO_ERROR, GPG_ERR_FILE_ERROR,
+ GPG_ERR_READ_ERROR, GPG_ERR_WRITE_ERROR, GPG_ERR_LOCK_ERROR,
+ GPG_ERR_BUFFER_TOO_SHORT.
+
+2003-11-06 Werner Koch <[email protected]>
+
+ * src/gpg-error.h, src/err-sources.h.in: Added error sources for
+ Libksba and Dirmngr. Added GPG_ERR_TRUNCATED.
+
+2003-11-03 Werner Koch <[email protected]>
+
+ * src/gpg-error.h: Allow GPG_ERR_INLINE to get overriden, so that
+ one can use the -D flag to specify the inline keyword. Suggested
+ by Philip Brown.
+
+2003-10-28 Moritz Schulte <[email protected]>
+
+ * src/gpg-error.h (gpg_err_code_t): Added:
+ GPG_ERR_NO_ENCODING_METHOD, GPG_ERR_NO_ENCRYPTION_SCHEME,
+ GPG_ERR_NO_SIGNATURE_SCHEME.
+ * src/err-codes.h.in: Likewise.
+
+2003-10-25 Werner Koch <[email protected]>
+
+ * src/strerror.c: Include stdio.h for snprintf
+ prototype. Suggested by [email protected], fixes #gnupg/214.
+
+2003-10-11 Moritz Schulte <[email protected]>
+
+ * src/gpg-error.m4: Do not ask gpg-error-config to change the
+ prefix, if --with-gpg-error-prefix=... is used.
+
+2003-10-06 Marcus Brinkmann <[email protected]>
+
+ Released 0.5.
+
+ * configure.ac (LIBGPG_ERROR_LT_CURRENT, LIBGPG_ERROR_LT_AGE):
+ Bump up by one.
+
+2003-09-30 Marcus Brinkmann <[email protected]>
+
+ * src/gpg-error.h: Include <stddef.h>.
+ (gpg_strerror_r): Change prototype to match POSIX. Rewritten for
+ that prototype.
+ * src/strerror.c: Include <errno.h>.
+ (gpg_strerror_r, system_strerror_r): Change prototype to match
+ POSIX. Rewritten for that prototype. Rewritten for that
+ prototype.
+
+2003-09-30 Werner Koch <[email protected]>
+
+ * src/gpg-error.h: Add PIN_NOT_SYNCED.
+
+2003-09-13 Marcus Brinkmann <[email protected]>
+
+ * configure.ac: Invoke AC_FUNC_STRERROR_R.
+ * src/gpg-error.h (gpg_strerror_r): New prototype.
+ * src/strerror.c (system_strerror_r): New function.
+ (gpg_strerror_r): New function.
+
+2003-09-04 Marcus Brinkmann <[email protected]>
+
+ * libgpg-error.spec.in: New file.
+ * Makefile.am (EXTRA_DIST): Add libgpg-error.spec.in.
+ * AUTHORS (Maintainer): Add Robert Schiele as contributor.
+
+2003-09-03 Marcus Brinkmann <[email protected]>
+
+ * src/gpg-error-config.in: Rewritten.
+
+2003-09-03 Marcus Brinkmann <[email protected]>
+
+ * configure.ac (AC_INIT): Bump up version number.
+
+2003-09-03 Marcus Brinkmann <[email protected]>
+
+ Released 0.4.
+
+ * src/gpg-error.h: Define GPG_ERR_INLINE to nothing if the
+ compiler does not implement C99.
+ * configure.ac: (AC_INIT): Bump up version number.
+
+2003-09-02 Moritz Schulte <[email protected]>
+
+ * src/gpg-error.h (gpg_err_code_t): Added: GPG_ERR_NO_PRIME.
+ * src/err-codes.h.in: Likewise.
+
+2003-08-19 Marcus Brinkmann <[email protected]>
+
+ * src/gpg-error.h (GPG_ERR_SYSTEM_ERROR): Fix value (should have
+ been 2^15, was 2^14).
+ (GPG_ERR_CODE_DIM): Fix value (should have been 65536, was 32768).
+ Change the error codes of all system errors to have the
+ GPG_ERR_SYSTEM_ERROR bit set.
+
+2003-08-06 Marcus Brinkmann <[email protected]>
+
+ * code-from-errno.c, code-to-errno.c, err-codes.h.in,
+ err-sources.h.in, errnos.in, gpg-error.h, strerror.c, strsource.c:
+ Fix typo in copyright notice.
+
+2003-07-31 Marcus Brinkmann <[email protected]>
+
+ * README: Clarify copyright conditions.
+ * src/mkstrtable.awk: Don't claim in the copyright information
+ that this program is part of libgpg-error.
+ * src/mkerrnos.awk: Likewise.
+ * src/mkerrcodes1.awk: Likewise.
+ * src/mkerrcodes2.awk: Likewise.
+
+2003-07-31 Marcus Brinkmann <[email protected]>
+
+ * src/strerror.c (gpg_strerror): Use CODE, not ERR to map error
+ code to errno.
+
+ * configure.ac (AC_INIT): Bump version to 0.3.
+
+ Released 0.3.
+
+2003-07-30 Marcus Brinkmann <[email protected]>
+
+ * configure.ac (AC_INIT): Bump version to 0.2.
+
+ Released 0.2.
+
+2003-07-17 Werner Koch <[email protected]>
+
+ * src/gpg-error.h: Add HARDWARE, PIN_BLOCKED and USE_CONDITIONS.
+
+2003-07-16 Moritz Schulte <[email protected]>
+
+ * src/gpg-error.h (gpg_err_code): Cast return value to
+ gpg_err_code_t. Thanks to Ralf Schneider
+ (gpg_err_source): Cast return value to gpg_err_source_t. Thanks
+ to Ralf Schneider <[email protected]>.
+
+2003-07-15 Moritz Schulte <[email protected]>
+
+ * src/gpg-error.m4 (AM_PATH_GPG_ERROR): Use `0.0' instead of
+ `0.0.0' in case no version number is given, since the following
+ sed commands expect the former form, not a triplet.
+
+2003-07-06 Marcus Brinkmann <[email protected]>
+
+ * src/gpg-error.h (GPG_ERR_INLINE): Define macro. Use it instead
+ of __inline__ in this file.
+
+2003-06-30 Werner Koch <[email protected]>
+
+ * src/gpg-error.h: Add WRONG_CARD.
+
+2003-06-22 Marcus Brinkmann <[email protected]>
+
+ * src/gpg-error.h: Fix value of GPG_ERR_CANCELED.
+
+2003-06-06 Marcus Brinkmann <[email protected]>
+
+ * configure.ac: Define GPG_ERROR_CONFIG_LIBS and
+ GPG_ERROR_CONFIG_CFLAGS.
+ Add src/gpg-error-config to config files.
+ * src/Makefile.am (EXTRA_DIST): Add gpg-error-config.in and
+ gpg-error.m4.
+ (bin_SCRIPTS): New variable.
+ (m4datadir, m4data_DATA): New variables.
+ * src/gpg-error-config.in: New file.
+ * src/gpg-error.m4: New file.
+
+ Released 0.1.
+
+2003-06-05 Marcus Brinkmann <[email protected]>
+
+ * src/gpg-error.h (gpg_err_make_from_errno): Fix implementation.
+
+ * src/gpg-error.h (gpg_err_code_t): Add GPG_ERR_SIG_EXPIRED.
+ (err-codes.h.in): Likewise.
+
+ * src/gpg-error.h (gpg_error_from_errno): Change return type to
+ gpg_error_t.
+
+2003-06-04 Marcus Brinkmann <[email protected]>
+
+ * src/gpg-error.h (gpg_err_code_t): Add GPG_ERR_INV_ENGINE,
+ GPG_ERR_PUBKEY_NOT_TRUSTED, GPG_ERR_DECRYPT_FAILED,
+ GPG_ERR_KEY_EXPIRED.
+ (gpg_make_error): Rename to gpg_err_make.
+ (gpg_error): Use here.
+ * tests/t-strerror.c (main): And here.
+ (gpg_make_error_from_errno): Rename to gpg_err_make_from_errno.
+
+ * src/gpg-error.h (gpg_make_error_from_errno): New inline function.
+ (gpg_error_from_errno): Likewise.
+
+ * src/code-from-errno.c (gpg_err_code_from_errno): Handle the case
+ of no error at all.
+
+2003-06-04 Marcus Brinkmann <[email protected]>
+
+ * src/gpg-error.h (gpg_err_source_t): Add GPG_ERR_SOURCE_USER_1 to
+ GPG_ERR_SOURCE_USER_4.
+ (gpg_err_code_t): Add GPG_ERR_USER_1 to GPG_ERR_USER_16.
+ * src/err-sources.h.in: Likewise.
+ * src/err-codes.h.in: Likewise.
+
+ * src/gpg-error.h: Rename GPG_ERR_INVALID_RESPONSE to
+ GPG_ERR_INV_RESPONSE, GPG_ERR_INVALID_CARD to GPG_ERR_INV_CARD,
+ GPG_ERR_INVALID_INDEX to GPG_ERR_INV_INDEX, GPG_ERR_INVALID_ID to
+ GPG_ERR_INV_ID, GPG_ERR_AGENT_ERROR to GPG_ERR_AGENT,
+ GPG_ERR_ASSUAN_ERROR to GPG_ERR_ASSUAN, GPG_ERR_PIN_ENTRY_ERROR to
+ GPG_ERR_PIN_ENTRY, GPG_ERR_DIRMNGR_ERROR to GPG_ERR_DIRMNGR,
+ GPG_ERR_CARD_ERROR to GPG_ERR_CARD, GPG_ERR_CONFIGURATION_ERROR to
+ GPG_ERR_CONFIGURATION, GPG_ERR_SCDAEMON_ERROR to GPG_ERR_SCDAEMON.
+
+2003-06-03 Werner Koch <[email protected]>
+
+ * src/gpg-error.h, src/err-codes.h.in: Add codes for TIMEOUT,
+ INV_HANDLE, NOTHING_FOUND, WRONG_BLOB_TYPE and MISSING_VALUE.
+ * src/gpg-error.h, src/err-sources.h.in: Add KEYBOX which is the
+ keybox subsystem of GnuPG.
+
+2003-06-02 Moritz Schulte <[email protected]>
+
+ * src/gpg-error.h: Fix description of gpg_err_code_to_errno
+ (i.e. substitute `ERR' with `CODE').
+ * src/code-to-errno.c: Likewise.
+
+ * tests/t-strerror.c: Include <gpg-error.h> instead of
+ <gpg/error.h>.
+
+2003-06-01 Marcus Brinkmann <[email protected]>
+
+ * src/strerror.c: Include <string.h>.
+
+ * src/gpg-error.h (gpg_err_code_t): Remove GPG_ERR_FILE_READ,
+ GPG_ERR_FILE_WRITE, GPG_ERR_FILE_OPEN, GPG_ERR_FILE_CREATE,
+ GPG_ERR_FILE_CLOSE, GPG_ERR_FILE_DELETE, GPG_ERR_FILE_EXISTS,
+ GPG_ERR_FILE, GPG_ERR_IO, GPG_ERR_OUT_OF_CORE, GPG_ERR_READ_ERROR,
+ GPG_ERR_WRITE_ERROR.
+ * src/err-codes.h.in: Likewise.
+
+ * src/Makefile.am (EXTRA_DIST): Add err-sources.h and err-codes.h.
+
+ * src/mkerrcodes1.awk: New file.
+ * src/mkerrcodes2.awk: New file.
+ * src/mkerrnos.awk: New file.
+ * src/errnos.in: New file.
+ * src/code-from-errno.c: New file.
+ * src/code-to-errno.c: New file.
+ * src/Makefile.am (libgpg_error_la_SOURCES): Remove err-sources.h
+ and err-codes.h. Add code-to-errno.c and code-from-errno.c.
+ (code-to-errno.h): New target.
+ (code-from-errno.h): Likewise.
+ (EXTRA_DIST): Add mkerrnos.awk, errnos.in, and mkerrcodes1.awk.
+ (BUILT_SOURCES): Add code-to-errno.h and code-from-errno.h.
+ (CLEANFILES): Likewise.
+ * src/strerror.c (gpg_strerror): Use strerror for system errors.
+ * src/err-codes.h.in: Add 16382 (Unknown system error).
+ * src/gpg-error.h (gpg_err_code_t): Add system errors.
+ (GPG_ERR_CODE_DIM): Change to 32768.
+ (GPG_ERR_SYSTEM_ERROR): New macro.
+ (gpg_err_code_from_errno): New prototype.
+ (gpg_err_code_to_errno): Likewise.
+
+ * src/Makefile.am (nobase_include_HEADERS): Rename target to ...
+ (include_HEADERS): ... this. Change file to gpg-error.h
+ (libgpg_error_la_SOURCES): Change gpg/error.h to gpg-error.h.
+ * src/gpg/error.h: Move to ...
+ * src/gpg-error.h: ... here. New file.
+ * src/strerror.c: Include <gpg-error.h>, not <gpg/error.h>.
+ * src/strsource.c: Likewise.
+
+ * src/gpg/error.h (gpg_error_t): Change type to unsigned int, not
+ long.
+
+2003-05-26 Marcus Brinkmann <[email protected]>
+
+ * src/gpg/error.h (gpg_make_error): Only OR in the error source if
+ there is an error, this allows to test for success with "if (!err)"
+ and similar tests.
+
+2003-05-15 Marcus Brinkmann <[email protected]>
+
+ * src/mkstrtable.awk: Add exception clause to license about the
+ output of the script.
+ * configure.ac: Change license to LGPL 2.1 or later.
+ * Makefile.am: Likewise.
+ * src/Makefile.am: Likewise.
+ * src/err-codes.h.in: Likewise.
+ * src/err-sources.h.in: Likewise.
+ * src/strsource.c: Likewise.
+ * src/strerror.c: Likewise.
+ * src/gpg/error.h: Likewise.
+ * tests/Makefile.am: Likewise.
+
+ * src/mkstrtable.awk: New variable HEADER. Copy input until first
+ line with an actual code and description occurs.
+ * src/err-codes.h.in: Uncomment license, so it is copied into the
+ output.
+ * src/err-sources.h.in: Likewise.
+
+2003-05-15 Marcus Brinkmann <[email protected]>
+
+ * COPYING.LIB: New file.
+
+2003-05-15 Marcus Brinkmann <[email protected]>
+
+ * Initial check-in.
+
+ Copyright 2003, 2004, 2005, 2006, 2007, 2010, 2011 g10 Code GmbH
+
+ This file is free software; as a special exception the author gives
+ unlimited permission to copy and/or distribute it, with or without
+ modifications, as long as this notice is preserved.
+
+ This file 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.
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..23e5f25
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,236 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 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' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc. You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ 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 option `--target=TYPE' to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+If you want to set default values for `configure' scripts to share, you
+can create a site shell script called `config.site' that gives default
+values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script). Here is a another example:
+
+ /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
+configuration-related scripts to be executed by `/bin/bash'.
+
+`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 100644
index 0000000..f5d0b81
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,98 @@
+# Makefile.am for libgpg-error.
+# Copyright (C) 2003, 2006, 2007, 2013 g10 Code GmbH
+#
+# This file is part of libgpg-error.
+#
+# libgpg-error is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of the
+# License, or (at your option) any later version.
+#
+# libgpg-error is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, see <https://www.gnu.org/licenses/>.
+
+ACLOCAL_AMFLAGS = -I m4
+DISTCHECK_CONFIGURE_FLAGS = --enable-doc
+
+# (A suitable gitlog-to-changelog script can be found in GnuPG master.)
+GITLOG_TO_CHANGELOG=gitlog-to-changelog
+
+EXTRA_DIST = autogen.sh autogen.rc libgpg-error.spec.in \
+ VERSION COPYING COPYING.LIB potomo doc/HACKING ChangeLog-2011 \
+ po/ChangeLog-2011 m4/ChangeLog-2011 contrib/ChangeLog-2011 \
+ build-aux/git-log-footer build-aux/git-log-fix
+
+if LANGUAGES_SOME
+lang_subdirs = lang
+else
+lang_subdirs =
+endif
+
+if BUILD_DOC
+doc = doc
+else
+doc =
+endif
+
+if BUILD_TESTS
+tests = tests
+else
+tests =
+endif
+
+SUBDIRS = m4 src $(doc) $(tests) po $(lang_subdirs)
+
+
+dist-hook: gen-ChangeLog
+ sed -e 's/@pkg_version@/$(VERSION)/g' \
+ $(top_srcdir)/libgpg-error.spec.in > $(distdir)/libgpg-error.spec
+
+distcheck-hook:
+ set -e; ( \
+ pref="#+macro: $$(echo $(PACKAGE_NAME)|tr '-' '_')_" ;\
+ reldate="$$(date -u +%Y-%m-%d)" ;\
+ echo "$${pref}ver $(PACKAGE_VERSION)" ;\
+ echo "$${pref}date $${reldate}" ;\
+ list='$(DIST_ARCHIVES)'; for i in $$list; do \
+ case "$$i" in *.tar.bz2) \
+ echo "$${pref}size $$(wc -c <$$i|awk '{print int($$1/1024)}')k" ;\
+ echo "$${pref}sha1 $$(sha1sum <$$i|cut -d' ' -f1)" ;\
+ echo "$${pref}sha2 $$(sha256sum <$$i|cut -d' ' -f1)" ;;\
+ esac;\
+ done ) | tee $(distdir).swdb
+
+
+gen_start_date = 2011-12-01T00:00:00
+.PHONY: gen-ChangeLog
+gen-ChangeLog:
+ set -e; \
+ if test -d $(top_srcdir)/.git; then \
+ (cd $(top_srcdir) && \
+ $(GITLOG_TO_CHANGELOG) --append-dot --tear-off \
+ --amend=build-aux/git-log-fix --tear-off \
+ --since=$(gen_start_date) ) > $(distdir)/cl-t; \
+ cat $(top_srcdir)/build-aux/git-log-footer >> $(distdir)/cl-t;\
+ rm -f $(distdir)/ChangeLog; \
+ mv $(distdir)/cl-t $(distdir)/ChangeLog; \
+ fi
+
+
+if HAVE_W32_SYSTEM
+install-data-hook:
+ set -e; \
+ for i in $$($(top_srcdir)/potomo --get-linguas $(top_srcdir)/po); do \
+ $(MKDIR_P) "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES" || true; \
+ rm -f "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES/libgpg-error.mo" \
+ 2>/dev/null || true; \
+ $(top_srcdir)/potomo $(top_srcdir)/po/$$i.po \
+ "$(DESTDIR)$(localedir)/$$i/LC_MESSAGES/libgpg-error.mo" ; \
+ done
+endif
+
+stowinstall:
+ $(MAKE) $(AM_MAKEFLAGS) install prefix=/usr/local/stow/libgpg-error
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..687e185
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,764 @@
+Noteworthy changes in version 1.28 (unreleased) [C22/A22/R_]
+-----------------------------------------------
+
+ * The formerly internal yat2m tool is now installed during a native
+ build.
+
+ * Interface changes relative to the 1.27 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+Noteworthy changes in version 1.27 (2017-02-28) [C22/A22/R0]
+-----------------------------------------------
+
+ * Added a Base64 decoder.
+
+ * Added support for the sh3 architecture.
+
+ * Added header gpgrt.h as an alias for gpg-error.h.
+
+ * Fixed macro GPGRT_GCC_VERSION.
+
+ * Fixed a race in non-blocking I/O on Windows.
+
+ * Interface changes relative to the 1.26 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ gpgrt_b64state_t NEW type.
+ gpgrt_b64dec_start NEW.
+ gpgrt_b64dec_proc NEW.
+ gpgrt_b64dec_finish NEW.
+ GPG_ERR_WRONG_NAME NEW.
+ gpgrt.h NEW header.
+
+
+Noteworthy changes in version 1.26 (2016-12-21) [C21/A21/R0]
+-----------------------------------------------
+
+ * New option --desc for gpg-error.
+
+ * Interface changes relative to the 1.25 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPG_ERR_UNKNOWN_FLAG NEW.
+ GPG_ERR_INV_ORDER NEW.
+ GPG_ERR_ALREADY_FETCHED NEW.
+ GPG_ERR_TRY_LATER NEW.
+ GPG_ERR_SYSTEM_BUG NEW.
+ GPG_ERR_DNS_UNKNOWN NEW.
+ GPG_ERR_DNS_SECTION NEW.
+ GPG_ERR_DNS_ADDRESS NEW.
+ GPG_ERR_DNS_NO_QUERY NEW.
+ GPG_ERR_DNS_NO_ANSWER NEW.
+ GPG_ERR_DNS_CLOSED NEW.
+ GPG_ERR_DNS_VERIFY NEW.
+ GPG_ERR_DNS_TIMEOUT NEW.
+
+
+Noteworthy changes in version 1.25 (2016-11-14) [C20/A20/R0]
+-----------------------------------------------
+
+ * New interface gpgrt_get_syscall_clamp to allow libaries to make use
+ of Libgpg-error's system call wrapper functions.
+
+ * gpgrt_poll does now work under Windows.
+
+ * Fixed bug in the locking code when used with the nPth threading
+ library.
+
+ * Added support for {i686,x86_64}-apple-darwin.
+
+ * Added new error codes.
+
+ * Interface changes relative to the 1.23 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ gpgrt_get_syscall_clamp NEW.
+ GPG_ERR_ENGINE_TOO_OLD NEW.
+ GPG_ERR_WINDOW_TOO_SMALL NEW.
+ GPG_ERR_WINDOW_TOO_LARGE NEW.
+ GPG_ERR_MISSING_ENVVAR NEW.
+ GPG_ERR_USER_ID_EXISTS NEW.
+ GPG_ERR_NAME_EXISTS NEW.
+ GPG_ERR_DUP_NAME NEW.
+ GPG_ERR_TOO_OLD NEW.
+ GPG_ERR_TOO_YOUNG NEW.
+
+
+Noteworthy changes in version 1.24 (2016-07-14) [C19/A19/R1]
+-----------------------------------------------
+
+ * Fixes a bug in es_fclose_snatch when used used after es_fseek.
+
+ * Fixes building without thread support.
+
+ * New configure option --disable-tests.
+
+
+Noteworthy changes in version 1.23 (2016-06-15) [C19/A19/R0]
+-----------------------------------------------
+
+ * Fixes an assertion failure due to es_flush on read/write streams.
+
+ * Fixes a bug with a too short memory limit is es_fopenmen.
+
+ * Cross-build support for powerpc-unknown-linux-gnuspe and
+ tilegx-unknown-linux-gnu architectures.
+
+ * Interface changes relative to the 1.22 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPG_ERR_SUBKEYS_EXP_OR_REV NEW.
+
+
+Noteworthy changes in version 1.22 (2016-04-25) [C18/A18/R0]
+-----------------------------------------------
+
+ * New functions and macros to to provide iconv(3) on Windows.
+
+ * Support for LeakSanitizer with the gpgrt_annotate_leaked_object
+ inline function.
+
+ * Interface changes relative to the 1.21 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPG_ERR_DB_CORRUPTED NEW.
+ gpgrt_annotate_leaked_object NEW inline func.
+ GPGRT_ENABLE_W32_ICONV_MACROS NEW.
+ gpgrt_w32_iconv_open NEW.
+ gpgrt_w32_iconv_close NEW.
+ gpgrt_w32_iconv NEW.
+
+
+Noteworthy changes in version 1.21 (2015-12-12) [C17/A17/R0]
+-----------------------------------------------
+
+ * New functions gpgrt_poll and gpgrt_set_nonblock. For now only
+ pipes and sockets on Unix are supported.
+
+ * Fixes gettext output encoding problems on Windows.
+
+ * Interface changes relative to the 1.20 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ gpgrt_set_nonblock NEW.
+ gpgrt_get_nonblock NEW.
+ gpgrt_poll NEW.
+ gpgrt_poll_t NEW type.
+ es_poll_t NEW type.
+ es_set_nonblock NEW macro.
+ es_get_nonblock NEW macro.
+ es_poll NEW macro.
+ GPG_ERR_TRUE NEW.
+ GPG_ERR_FALSE NEW.
+ GPG_ERR_NO_NAME NEW.
+ GPG_ERR_NO_KEY NEW.
+ GPG_ERR_SERVER_FAILED NEW.
+
+
+Noteworthy changes in version 1.20 (2015-08-26) [C16/A16/R0]
+-----------------------------------------------
+
+ * New macros for GCC attributes.
+
+ * Make es_set_binary actually work for Windows.
+
+ * Allow building without thread support.
+
+ * Build without a build timestamp by default.
+
+ * Interface changes relative to the 1.19 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPGRT_VERSION NEW macro.
+ GPGRT_VERSION_NUMBER NEW macro.
+ GPGRT_INLINE NEW macro.
+ GPGRT_GCC_VERSION NEW macro.
+ GPGRT_ATTR_NORETURN NEW macro.
+ GPGRT_ATTR_PRINTF NEW macro.
+ GPGRT_ATTR_NR_PRINTF NEW macro.
+ GPGRT_ATTR_FORMAT_ARG NEW macro.
+ GPGRT_ATTR_SENTINEL NEW macro.
+ GPGRT_ATTR_USED NEW macro.
+ GPGRT_ATTR_UNUSED NEW macro.
+ GPGRT_ATTR_DEPRECATED NEW macro.
+ GPGRT_ATTR_PURE NEW macro.
+ GPGRT_ATTR_MALLOC NEW macro.
+ GPGRT_HAVE_MACRO_FUNCTION NEW macro.
+ GPGRT_HAVE_PRAGMA_GCC_PUSH NEW macro.
+
+
+Noteworthy changes in version 1.19 (2015-04-10) [C15/A15/R0]
+-----------------------------------------------
+
+ * New set of error codes for use with LDAP.
+
+ * New options --help and --defines for gpg-error.
+
+ * Allow building with gcc 5.
+
+ * Interface changes relative to the 1.18 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPG_ERR_LDAP_* NEW.
+
+
+Noteworthy changes in version 1.18 (2015-01-26) [C14/A14/R0]
+-----------------------------------------------
+
+ * New translations for Hungarian, Portuguese, Russian, and
+ traditional Chinese. Updated other translations.
+
+ * New error codes.
+
+ * Interface changes relative to the 1.17 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPG_ERR_FORBIDDEN NEW.
+ GPG_ERR_OBJ_TERM_STATE NEW.
+ GPG_ERR_REQUEST_TOO_SHORT NEW.
+ GPG_ERR_REQUEST_TOO_LONG NEW.
+ GPG_ERR_LEGACY_KEY NEW.
+
+
+Noteworthy changes in version 1.17 (2014-10-15) [C13/A13/R0]
+-----------------------------------------------
+
+ * New error codes for TLS protocol libraries.
+
+ * New configure option --enable-build-timestamp.
+
+ * New man page for gpg-error-config.
+
+ * Interface changes relative to the 1.16 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPG_ERR_SOURCE_TLS NEW.
+ GPG_ERR_NO_CERT_CHAIN NEW.
+ GPG_ERR_CERT_TOO_LARGE NEW.
+ GPG_ERR_INV_RECORD NEW.
+ GPG_ERR_BAD_MAC NEW.
+ GPG_ERR_UNEXPECTED_MSG NEW.
+ GPG_ERR_COMPR_FAILED NEW.
+ GPG_ERR_WOULD_WRAP NEW.
+ GPG_ERR_FATAL_ALERT NEW.
+ GPG_ERR_NO_CIPHER NEW.
+ GPG_ERR_MISSING_CLIENT_CERT NEW.
+ GPG_ERR_CLOSE_NOTIFY NEW.
+ GPG_ERR_TICKET_EXPIRED NEW.
+ GPG_ERR_BAD_TICKET NEW.
+ GPG_ERR_UNKNOWN_IDENTITY NEW.
+ GPG_ERR_BAD_HS_CERT NEW.
+ GPG_ERR_BAD_HS_CERT_REQ NEW.
+ GPG_ERR_BAD_HS_CERT_VER NEW.
+ GPG_ERR_BAD_HS_CHANGE_CIPHER NEW.
+ GPG_ERR_BAD_HS_CLIENT_HELLO NEW.
+ GPG_ERR_BAD_HS_SERVER_HELLO NEW.
+ GPG_ERR_BAD_HS_SERVER_HELLO_DONE NEW.
+ GPG_ERR_BAD_HS_FINISHED NEW.
+ GPG_ERR_BAD_HS_SERVER_KEX NEW.
+ GPG_ERR_BAD_HS_CLIENT_KEX NEW.
+ GPG_ERR_BOGUS_STRING NEW.
+ gpgrt_pending NEW.
+ gpgrt_pending_unlocked NEW.
+
+
+Noteworthy changes in version 1.16 (2014-09-18) [C12/A12/R2]
+-----------------------------------------------
+
+ * Support building for iOS.
+
+ * Fixed a prototype mismatch.
+
+ * Fix es_fclose for streams opened with "samethread".
+
+
+Noteworthy changes in version 1.15 (2014-09-11) [C12/A12/R1]
+-----------------------------------------------
+
+ * This releases fixes problems with the use of off_t and ssize_t by
+ the estream functions introduced with 1.14. Although this is
+ technically an ABI break on some platforms, we take this as a
+ simple bug fix for 1.14. The new functions are very unlikely in
+ use by any code and thus no breakage should happen. The 1.14
+ tarball will be removed from the archive.
+
+ * Add type gpgrt_off_t which is guaranteed to be 64 bit.
+
+ * Add type gpgrt_ssize_t to make use on Windows easier. On Unix
+ platforms this is an alias for ssize_t.
+
+
+Noteworthy changes in version 1.14 (2014-09-08) [C12/A12/R0]
+-----------------------------------------------
+
+ * Added gpgrt_lock_trylock.
+
+ * Added the estream library under the name gpgrt and a set of macros
+ to use them with their "es_" names.
+
+ * Interface changes relative to the 1.13 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPG_ERR_KEY_DISABLED NEW.
+ gpgrt_init NEW macro.
+ gpgrt_check_version NEW.
+ gpgrt_lock_trylock NEW.
+ gpgrt_set_syscall_clamp NEW.
+ gpgrt_set_alloc_func NEW.
+ gpgrt_stream_t NEW.
+ gpgrt_cookie_io_functions_t NEW.
+ gpgrt_syshd_t NEW.
+ GPGRT_SYSHD_NONE NEW.
+ GPGRT_SYSHD_FD NEW.
+ GPGRT_SYSHD_SOCK NEW.
+ GPGRT_SYSHD_RVID NEW.
+ GPGRT_SYSHD_HANDLE NEW.
+ gpgrt_stdin NEW macro.
+ gpgrt_stdout NEW macro.
+ gpgrt_stderr NEW macro.
+ gpgrt_fopen NEW.
+ gpgrt_mopen NEW.
+ gpgrt_fopenmem NEW.
+ gpgrt_fopenmem_init NEW.
+ gpgrt_fdopen NEW.
+ gpgrt_fdopen_nc NEW.
+ gpgrt_sysopen NEW.
+ gpgrt_sysopen_nc NEW.
+ gpgrt_fpopen NEW.
+ gpgrt_fpopen_nc NEW.
+ gpgrt_freopen NEW.
+ gpgrt_fopencookie NEW.
+ gpgrt_fclose NEW.
+ gpgrt_fclose_snatch NEW.
+ gpgrt_onclose NEW.
+ gpgrt_fileno NEW.
+ gpgrt_fileno_unlocked NEW.
+ gpgrt_syshd NEW.
+ gpgrt_syshd_unlocked NEW.
+ gpgrt_flockfile NEW.
+ gpgrt_ftrylockfile NEW.
+ gpgrt_funlockfile NEW.
+ gpgrt_feof NEW.
+ gpgrt_feof_unlocked NEW.
+ gpgrt_ferror NEW.
+ gpgrt_ferror_unlocked NEW.
+ gpgrt_clearerr NEW.
+ gpgrt_clearerr_unlocked NEW.
+ gpgrt_fflush NEW.
+ gpgrt_fseek NEW.
+ gpgrt_fseeko NEW.
+ gpgrt_ftell NEW.
+ gpgrt_ftello NEW.
+ gpgrt_rewind NEW.
+ gpgrt_getc NEW macro.
+ gpgrt_getc_unlocked NEW macro.
+ gpgrt_fgetc NEW.
+ gpgrt_fputc NEW.
+ gpgrt_ungetc NEW.
+ gpgrt_read NEW.
+ gpgrt_write NEW.
+ gpgrt_write_sanitized NEW.
+ gpgrt_write_hexstring NEW.
+ gpgrt_fread NEW.
+ gpgrt_fwrite NEW.
+ gpgrt_fgets NEW.
+ gpgrt_putc NEW macro.
+ gpgrt_putc_unlocked NEW macro.
+ gpgrt_fputs NEW.
+ gpgrt_fputs_unlocked NEW.
+ gpgrt_getline NEW.
+ gpgrt_read_line NEW.
+ gpgrt_free NEW.
+ gpgrt_fprintf NEW.
+ gpgrt_fprintf_unlocked NEW.
+ gpgrt_printf NEW.
+ gpgrt_printf_unlocked NEW.
+ gpgrt_vfprintf NEW.
+ gpgrt_vfprintf_unlocked NEW.
+ gpgrt_setvbuf NEW.
+ gpgrt_setbuf NEW.
+ gpgrt_set_binary NEW.
+ gpgrt_tmpfile NEW.
+ gpgrt_opaque_set NEW.
+ gpgrt_opaque_get NEW.
+ gpgrt_fname_set NEW.
+ gpgrt_fname_get NEW.
+ gpgrt_asprintf NEW.
+ gpgrt_vasprintf NEW.
+ gpgrt_bsprintf NEW.
+ gpgrt_vbsprintf NEW.
+ gpgrt_snprintf NEW.
+ gpgrt_vsnprintf NEW.
+
+
+Noteworthy changes in version 1.13 (2014-04-15) [C11/A11/R0]
+-----------------------------------------------
+
+ * Added a portable mutex API.
+
+ * The AM_PATH_GPG_ERROR macro now defines GPG_ERROR_MT_CFLAGS and
+ GPG_ERROR_MT_LIBS autoconf output variables for use by programs
+ which need gpgrt based thread support. gpg-error-config has a new
+ option --mt.
+
+ * Interface changes relative to the 1.12 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPG_ERR_KEY_ON_CARD NEW.
+ GPG_ERR_MAC_ALGO NEW.
+ GPG_ERR_INV_LOCK_OBJ NEW.
+ gpgrt_lock_t NEW.
+ GPGRT_LOCK_INITIALIZER NEW.
+ GPGRT_LOCK_DEFINE NEW.
+ gpgrt_lock_init NEW.
+ gpgrt_lock_lock NEW.
+ gpgrt_lock_unlock NEW.
+ gpgrt_lock_destroy NEW.
+ gpgrt_yield NEW.
+
+
+Noteworthy changes in version 1.12 (2013-06-24)
+-----------------------------------------------
+
+ * Add support for 64 bit Windows (use ./autogen.sh --build-w64).
+
+ * Fixed parsing and installing of the Windows .def file.
+
+ * Interface changes relative to the 1.11 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPG_ERR_NO_CRYPT_CTX NEW.
+ GPG_ERR_WRONG_CRYPT_CTX NEW.
+ GPG_ERR_BAD_CRYPT_CTX NEW.
+ GPG_ERR_CRYPT_CTX_CONFLICT NEW.
+ GPG_ERR_BROKEN_PUBKEY NEW.
+ GPG_ERR_BROKEN_SECKEY NEW.
+
+
+Noteworthy changes in version 1.11 (2013-02-25)
+-----------------------------------------------
+
+ * New error source GPG_ERR_SOURCE_ASSUAN for Libassuan related
+ errors.
+
+ * New macros GPG_ERROR_VERSION and GPG_ERROR_VERSION_NUMBER. New
+ function gpg_error_check_version.
+
+ * Interface changes relative to the 1.10 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPG_ERR_NO_KEYSERVER NEW.
+ GPG_ERR_INV_CURVE NEW.
+ GPG_ERR_UNKNOWN_CURVE NEW.
+ GPG_ERR_DUP_KEY NEW.
+ GPG_ERR_AMBIGUOUS NEW.
+ GPG_ERR_SOURCE_ASSUAN NEW.
+ gpg_error_check_version NEW.
+ GPG_ERROR_VERSION NEW.
+ GPG_ERROR_VERSION_NUMBER NEW.
+
+
+Noteworthy changes in version 1.10 (2010-10-26)
+-----------------------------------------------
+
+ * Using a static library on W32 does now work.
+
+ * Interface changes relative to the 1.9 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPG_ERR_NOT_INITIALIZED NEW.
+ GPG_ERR_MISSING_ISSUER_CERT NEW.
+ GPG_ERR_FULLY_CANCELED NEW.
+
+
+Noteworthy changes in version 1.9 (2010-07-21)
+----------------------------------------------
+
+ * New function gpg_err_deinit.
+
+ * Fix building of static lib under W32.
+
+ * Interface changes relative to the 1.8 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPG_ERR_MISSING_KEY NEW.
+ GPG_ERR_TOO_MANY NEW.
+ GPG_ERR_LIMIT_REACHED NEW.
+ gpg_err_deinit NEW.
+
+
+Noteworthy changes in version 1.8 (2010-05-06)
+----------------------------------------------
+
+ * Support for WindowsCE.
+
+ * New option --list for gpg-error.
+
+ * Interface changes relative to the 1.7 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPG_ERR_NOT_ENABLED NEW.
+ GPG_ERR_SOURCE_G13 NEW.
+ GPG_ERR_NO_ENGINE NEW.
+ gpg_err_set_errno NEW.
+
+
+Noteworthy changes in version 1.7 (2008-11-26)
+----------------------------------------------
+
+ * Minor fixes and a few new error codes.
+
+ * Interface changes relative to the 1.6 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPG_ERR_NOT_OPERATIONAL NEW
+ GPG_ERR_NO_PASSPHRASE NEW
+ GPG_ERR_NO_PIN NEW
+
+
+Noteworthy changes in version 1.6 (2007-10-29)
+----------------------------------------------
+
+ * Fixed a build problem under Windows.
+
+ * Interface changes relative to the 1.4 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ GPG_ERR_UNFINISHED NEW
+ GPG_ERR_SOURCE_GPA NEW
+ GPG_ERR_SOURCE_KLEO NEW
+
+
+Noteworthy changes in version 1.5 (2006-11-30)
+----------------------------------------------
+
+ * Minor build system fixes.
+
+ * Updated gettext. Removed included gettext copy.
+
+ * gpg-error has a new option --version.
+
+
+Noteworthy changes in version 1.4 (2006-09-14)
+----------------------------------------------
+
+ * Support for Common Lisp is included.
+
+ * New error codes for the Assuan IPC library.
+
+ * New error code GPG_ERR_MISSING_ERRNO to be used in cases when a
+ system accidentally does not set errno but a system error
+ definitely occurred.
+
+ * New error source GPG_ERR_SOURCE_ANY to allow proper use of
+ libgpg-error even if a specific source is not available.
+
+ * New convenience functions gpg_err_code_from_syserror and
+ gpg_error_from_syserror which make sure never to return 0.
+
+ * Interface changes relative to the 1.2 release:
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ gpg_err_code_from_syserror NEW
+ gpg_error_from_syserror NEW
+ GPG_ERR_SOURCE_ANY NEW
+ GPG_ERR_MISSING_ERRNO NEW
+ GPG_ERR_UNKNOWN_OPTION NEW
+ GPG_ERR_UNKNOWN_COMMAND NEW
+ GPG_ERR_ASS_GENERAL NEW
+ GPG_ERR_ASS_ACCEPT_FAILED NEW
+ GPG_ERR_ASS_CONNECT_FAILED NEW
+ GPG_ERR_ASS_INV_RESPONSE NEW
+ GPG_ERR_ASS_INV_VALUE NEW
+ GPG_ERR_ASS_INCOMPLETE_LINE NEW
+ GPG_ERR_ASS_LINE_TOO_LONG NEW
+ GPG_ERR_ASS_NESTED_COMMANDS NEW
+ GPG_ERR_ASS_NO_DATA_CB NEW
+ GPG_ERR_ASS_NO_INQUIRE_CB NEW
+ GPG_ERR_ASS_NOT_A_SERVER NEW
+ GPG_ERR_ASS_NOT_A_CLIENT NEW
+ GPG_ERR_ASS_SERVER_START NEW
+ GPG_ERR_ASS_READ_ERROR NEW
+ GPG_ERR_ASS_WRITE_ERROR NEW
+ GPG_ERR_ASS_TOO_MUCH_DATA NEW
+ GPG_ERR_ASS_UNEXPECTED_CMD NEW
+ GPG_ERR_ASS_UNKNOWN_CMD NEW
+ GPG_ERR_ASS_SYNTAX NEW
+ GPG_ERR_ASS_CANCELED NEW
+ GPG_ERR_ASS_NO_INPUT NEW
+ GPG_ERR_ASS_NO_OUTPUT NEW
+ GPG_ERR_ASS_PARAMETER NEW
+ GPG_ERR_ASS_UNKNOWN_INQUIRE NEW
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+Noteworthy changes in version 1.3 (2006-03-14)
+----------------------------------------------
+
+ * GNU gettext is included for systems that do not provide it.
+
+
+Noteworthy changes in version 1.2 (2006-03-03)
+----------------------------------------------
+
+ * New function gpg_err_init, which binds the locale directory to
+ the text domain. This function is a constructor on GCC targets,
+ so it does not need to be called explicitely. The header file
+ defines GPG_ERR_INITIALIZED in this case. This is experimental for
+ now.
+
+ * "./autogen.sh --build-w32" does now also build a DLL for W32.
+ Translations are not yet provided for this platform.
+
+ * New error codes GPG_ERR_UNKNOWN_EXTN and GPG_ERR_UNKNOWN_CRIT_EXTN.
+
+ * New error code GPG_ERR_LOCKED.
+
+ * New translations included for France, Romania, and Vietnamese.
+
+ * Interface changes relative to the 1.1 release:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+GPG_ERR_UNKNOWN_EXTN NEW
+GPG_ERR_UNKNOWN_CRIT_EXTN NEW
+GPG_ERR_LOCKED NEW
+gpg_err_init NEW
+GPG_ERR_INITIALIZED NEW
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+Noteworthy changes in version 1.1 (2005-06-20)
+----------------------------------------------
+
+ * Bug fixes.
+
+
+Noteworthy changes in version 1.0 (2004-07-30)
+----------------------------------------------
+
+ * Ported to Solaris 2.8.
+
+ * Added a new error source GPG_ERR_SOURCE_GSTI, and new error
+ codes GPG_ERR_PROTOCOL_VIOLATION and GPG_ERR_INV_MAC for this
+ source.
+
+ * Interface changes relative to the 0.7 release:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+GPG_ERR_SOURCE_GSTI NEW
+GPG_ERR_PROTOCOL_VIOLATION NEW
+GPG_ERR_INV_MAC NEW
+GPG_ERR_INV_REQUEST NEW
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Noteworthy changes in version 0.7 (2004-03-07)
+----------------------------------------------
+
+ * libgpg-error can be built on systems where the errno macros do not
+ evaluate to plain numbers, but expressions. If you want to
+ cross-compile, you might have to set CC_FOR_BUILD, though.
+
+ * A new tool gpg-error to convert error numbers into symbols into
+ strings is provided.
+
+ * Interface changes relative to the 0.6 release:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+GPG_ERR_LOCALE_PROBLEM NEW
+GPG_ERR_NOT_LOCKED NEW
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Noteworthy changes in version 0.6 (2003-11-14)
+----------------------------------------------
+
+ * German translation included.
+
+ * It is now possible to use the inline functions even for non C99
+ compliant compilers by given e.g. -DGPG_ERR_INLINE=inline when
+ compiling an application using this library. Note, that gcc will
+ use inline anyway.
+
+ * Interface changes relative to the 0.5 release:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+GPG_ERR_SOURCE_KSBA NEW
+GPG_ERR_SOURCE_DIRMNGR NEW
+GPG_ERR_TRUNCATED NEW
+GPG_ERR_NO_ENCODING_METHOD NEW
+GPG_ERR_NO_ENCRYPTION_SCHEME NEW
+GPG_ERR_NO_SIGNATURE_SCHEME NEW
+GPG_ERR_INV_ATTR NEW
+GPG_ERR_NO_VALUE NEW
+GPG_ERR_NOT_FOUND NEW
+GPG_ERR_VALUE_NOT_FOUND NEW
+GPG_ERR_SYNTAX NEW
+GPG_ERR_INV_CRL NEW
+GPG_ERR_BAD_BER NEW
+GPG_ERR_INV_BER NEW
+GPG_ERR_ELEMENT_NOT_FOUND NEW
+GPG_ERR_IDENTIFIER_NOT_FOUND NEW
+GPG_ERR_INV_TAG NEW
+GPG_ERR_INV_LENGTH NEW
+GPG_ERR_INV_KEYINFO NEW
+GPG_ERR_UNEXPECTED_TAG NEW
+GPG_ERR_NOT_DER_ENCODED, NEW
+GPG_ERR_NO_CMS_OBJ NEW
+GPG_ERR_INV_CMS_OBJ NEW
+GPG_ERR_UNKNOWN_CMS_OBJ, NEW
+GPG_ERR_UNSUPPORTED_CMS_OBJ NEW
+GPG_ERR_UNSUPPORTED_ENCODING, NEW
+GPG_ERR_UNSUPPORTED_CMS_VERSION NEW
+GPG_ERR_UNKNOWN_ALGORITHM NEW
+GPG_ERR_ENCODING_PROBLEM NEW
+GPG_ERR_INV_STATE NEW
+GPG_ERR_DUP_VALUE, NEW
+GPG_ERR_MISSING_ACTION NEW
+GPG_ERR_MODULE_NOT_FOUND NEW
+GPG_ERR_INV_OID_STRING NEW
+GPG_ERR_INV_TIME NEW
+GPG_ERR_INV_CRL_OBJ NEW
+GPG_ERR_UNSUPPORTED_CRL_VERSION NEW
+GPG_ERR_INV_CERT_OBJ NEW
+GPG_ERR_UNKNOWN_NAME NEW
+GPG_ERR_BUFFER_TOO_SHORT. NEW
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Noteworthy changes in version 0.5 (2003-10-06)
+----------------------------------------------
+
+ * New thread safe interface gpg_strerror_r.
+
+ * New error code GPG_ERR_PIN_NOT_SYNCED has been added.
+
+ * Interface changes relative to the 0.4 release:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+gpg_strerror_r NEW
+GPG_ERR_PIN_NOT_SYNCED NEW
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+Noteworthy changes in version 0.4 (2003-09-03)
+----------------------------------------------
+
+ * Fixed another bug that prevented that system errors were created
+ correctly in the first place.
+
+ * Use inline in public header file only on C99 compilers.
+
+
+Noteworthy changes in version 0.3 (2003-07-31)
+----------------------------------------------
+
+ * Fixed bug that prevented that system errors were mapped to error
+ strings correctly.
+
+
+Noteworthy changes in version 0.2 (2003-07-30)
+----------------------------------------------
+
+ * Value of the error code GPG_ERR_CANCELED was fixed.
+
+ * New error codes GPG_ERR_WRONG_CARD, GPG_ERR_HARDWARE,
+ GPG_ERR_PIN_BLOCKED and GPG_ERR_USE_CONDITIONS have been added.
+
+ * The header file has been made C++ clean.
+
+ * AM_PATH_GPG_ERR has been fixed to work without explicit version
+ number.
+
+ * The header file now uses inline instead __inline__ for non-GNU
+ compilers.
+
+
+Noteworthy changes in version 0.1 (2003-06-06)
+----------------------------------------------
+
+ * Initial release.
+
+
+ Copyright 2003, 2004, 2005, 2010 g10 Code GmbH
+
+ This file is free software; as a special exception the author gives
+ unlimited permission to copy and/or distribute it, with or without
+ modifications, as long as this notice is preserved.
+
+ This file 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.
diff --git a/README b/README
new file mode 100644
index 0000000..fd6e1a8
--- /dev/null
+++ b/README
@@ -0,0 +1,167 @@
+What is Libgpg-error
+====================
+
+Libgpg-error is a library that defines common error values for all
+GnuPG components. Among these are GPG, GPGSM, GPGME, GPG-Agent,
+libgcrypt, Libksba, DirMngr, Pinentry, SmartCard Daemon and more.
+Meanwhile Libgcrypt also sports functions commonly used by all GnuPG
+components and which are believed to be generally useful. The main
+components are
+
+ - Structured error codes and utility functions.
+
+ - Replacement functions for stdio stream (estream) to provide a
+ reliable set of printf features on all platforms. For convenience
+ macros are provided to make migration from stdio to estream easier
+ (ie. the prefix "es_")
+
+ - Generic Mutex implementation for all platforms using an ABI
+ independent of the underlying implementation.
+
+ - A lean gettext and iconv implementation for Windows.
+
+More components will be added over time. Most functions are prefixed
+with "gpgrt" (GnuPG Run Time) instead of "gpg_err" to indicate the
+long term plan to rename this library to gpgrt.
+
+Libgpg-error is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of the
+License, or (at your option) any later version. See the file
+COPYING.LIB for copyright and warranty information. See the file
+AUTHORS for a list of authors and important mail addresses.
+
+However, some files (for example src/mkerrnos.awk) used in the build
+process of the library and the manual are covered by a different
+license. Please see the header of these files and the file COPYING
+for copyright and warranty information on these files. A special
+exception in the copyright license of these files makes sure that the
+output in the build process, which is used in libgpg-error, is not
+affected by the GPL.
+
+
+Installation
+============
+
+Please read the file INSTALL!
+
+Here is a quick summary:
+
+1) Check that you have unmodified sources. You can find instructions
+ how to verify the sources below. Don't skip this - it is an
+ important step!
+
+2) Unpack the archive. With GNU tar you can do it this way:
+ "tar xjvf libgpg-error-x.y.tar.bz2"
+
+3) "cd libgpg-error-x.y"
+
+4) "./configure"
+
+5) "make"
+
+6) "make install"
+
+
+How to Verify the Source
+========================
+
+In order to check that the version of libgpg-error which you are going
+to install is an original and unmodified copy of the original, you can
+do it in one of the following ways:
+
+a) If you already have a trusted version of GnuPG installed, you can
+ simply check the supplied signature:
+
+ $ gpg --verify libgpg-error-x.y.tar.bz2.sig libgpg-error-x.y.tar.bz2
+
+ This checks that the detached signature libgpg-error-x.y.tar.bz2.sig
+ is indeed a signature of libgpg-error-x.y.tar.bz2. Make sure that
+ the signature has been created by a trusted keys.
+
+ Please note that you have to use an old version of GnuPG to do all
+ this stuff. *Never* use the version which was built using the
+ library you are trying to verify!
+
+b) If you don't have any a trusted version of GnuPG, you can attempt
+ to verify the SHA1 checksum, using a trusted version of the sha1sum
+ program:
+
+ $ sha1sum libgpg-error-x.y.tar.bz2
+
+ This should yield an output _similar_ to this:
+
+ 610064e5b77700f5771c8fde2691c4365e1ca100 libgpg-error-x.y.tar.bz2
+
+ Now check that this checksum is _exactly_ the same as the one
+ published via the announcement list and probably via Usenet.
+
+
+Hints
+=====
+
+To build for Windows you you may use the convenience command:
+
+ ./autogen.sh --build-w32
+
+which runs configure with suitable options. For WindowsCE the command
+is:
+
+ ./autogen.sh --build-w32ce
+
+There is also _experimental_ support for building a 64 bit Windows
+version:
+
+ ./autogen.sh --build-w64
+
+
+Cross-Compiling
+===============
+
+Libgpg-error needs to figure out some platform specific properties.
+These are used to build the platform specific gpg-error.h file. The
+detection is done during build time but can't be done when
+cross-compiling. Thus if you run into an error during building you
+need to figure out these values. You may use these commands:
+
+ build="$(build-aux/config.guess)"
+ ./configure --prefix=TARGETDIR --host=TARGET --build=$build
+ cd src
+ make gen-posix-lock-obj
+ scp gen-posix-lock-obj TARGET:
+ ssh TARGET ./gen-posix-lock-obj >tmp.h
+ mv tmp.h "syscfg/$(awk 'NR==1 {print $2}' tmp.h)"
+
+If you are using a VPATH build adjust accordingly. If this all works
+for you (make sure to run the test programs on the target platform),
+please send the generated file to the gnupg-devel mailing list so that
+we can include it in the next release. Note that in addition to the
+aliasing done by config.sub the src/mkheader build tool does some
+extra aliasing to avoid having too much identical syscfg files.
+
+
+
+Known Problems
+==============
+
+On Windows, WSA Error Codes can be provided as system error codes and
+will be transparently converted to the corresponding gpg error codes.
+There are two problems with this support:
+
+* Not all error codes corresponding to WSA Error codes have a detailed
+ description when printed with gpg_strerror. Some will default to
+ "Unknown error" for pretty printing. For example, WSAEHOSTDOWN will
+ be translated to GPG_ERR_EHOSTDOWN, but there is no corresponding
+ EHOSTDOWN in Windows and thus gpg_strerror will default to "Unknown
+ error" as printed by the system's strerror function for the argument
+ WSAEHOSTDOWN. (This could be fixed by adding our own error strings
+ replacing or extending the system error strings, including their
+ translations).
+
+* The translation to a gpg error code and back to a system error code
+ in some cases does not preserve information. For example, the error
+ code WSAEACCES translates to GPG_ERR_EACCES, which translates back
+ to EACCES.
+
+Any WSA Error code has either the first problem or the second (but not
+both), depending on if there is a corresponding Windows error code.
diff --git a/README.GIT b/README.GIT
new file mode 100644
index 0000000..57dab7a
--- /dev/null
+++ b/README.GIT
@@ -0,0 +1,49 @@
+If you are building from GIT, run the script
+
+./autogen.sh
+
+first, to make sure that you have all the necessary maintainer tools
+are installed and to build the actual configuration files. If you
+have just checked out from GIT, you should add the option "--force" to
+autogen.sh so that meta data is noticed by autom4te.cache. Then run
+
+./configure --enable-maintainer-mode
+
+followed by the usual make.
+
+If autogen.sh complains about insufficient versions of the required
+tools, or the tools are not installed, you may use environment
+variables to override the default tool names:
+
+ AUTOMAKE_SUFFIX is used as a suffix for all tools from the automake
+ package. For example
+ AUTOMAKE_SUFFIX="-1.14" ./autogen.sh
+ uses "automake-1.14" and "aclocal-1.14.
+ AUTOMAKE_PREFIX is used as a prefix for all tools from the automake
+ page and may be combined with AUTOMAKE_SUFFIX. e.g.:
+ AUTOMAKE_PREFIX=/usr/foo/bin ./autogen.sh
+ uses "automake" and "aclocal" in the /usr/foo/bin
+ directory.
+ AUTOCONF_SUFFIX is used as a suffix for all tools from the automake
+ package
+ AUTOCONF_PREFIX is used as a prefix for all tools from the automake
+ package
+ GETTEXT_SUFFIX is used as a suffix for all tools from the gettext
+ package
+ GETTEXT_PREFIX is used as a prefix for all tools from the gettext
+ package
+
+It is also possible to use the variable name AUTOMAKE, AUTOCONF,
+ACLOCAL, AUTOHEADER, GETTEXT and MSGMERGE to directly specify the name
+of the programs to run. It is however better to use the suffix and
+prefix forms as described above because that does not require
+knowledge about the actual tools used by autogen.sh.
+
+
+Please don't use autopoint, libtoolize or autoreconf unless you are
+the current maintainer and want to update the standard configuration
+files. All those files should be in GIT and only updated manually
+if the maintainer decides that newer versions are required. The
+maintainer should also make sure that the required version of automake
+et al. are properly indicated at the top of configure.ac and take care
+to copy the files and not merely use symlinks.
diff --git a/THANKS b/THANKS
new file mode 100644
index 0000000..9f37446
--- /dev/null
+++ b/THANKS
@@ -0,0 +1,16 @@
+
+Albrecht Dreß albrecht.dress at arcor de
+Guillaume Libersat glibersat at hurdfr org
+Jakub Bogusz qboosh at pld-linux org
+Petr Pisar petr.pisar at atlas cz
+
+
+ Copyright 2004, 2005 g10 Code GmbH
+
+ This file is free software; as a special exception the author gives
+ unlimited permission to copy and/or distribute it, with or without
+ modifications, as long as this notice is preserved.
+
+ This file 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.
diff --git a/autogen.rc b/autogen.rc
new file mode 100644
index 0000000..b128361
--- /dev/null
+++ b/autogen.rc
@@ -0,0 +1,23 @@
+# autogen.sh configuration for libgpg-error -*- sh -*-
+
+version_parts=2
+
+case "$myhost:$myhostsub" in
+ w32:ce)
+ extraoptions=
+ ;;
+ w32:64)
+ extraoptions=
+ ;;
+ w32:)
+ extraoptions=
+ ;;
+esac
+
+case "$myhost" in
+ w32)
+ configure_opts=
+ ;;
+esac
+
+final_info="./configure --enable-maintainer-mode && make"
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..e5ba5bf
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,489 @@
+#! /bin/sh
+# autogen.sh
+# Copyright (C) 2003, 2014, 2017 g10 Code GmbH
+#
+# This file is free software; as a special exception the author 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.
+#
+# This is a generic script to create the configure script and handle cross
+# build environments. It requires the presence of a autogen.rc file to
+# configure it for the respective package. It is maintained as part of
+# GnuPG and source copied by other packages.
+#
+# Version: 2017-01-17
+
+configure_ac="configure.ac"
+
+cvtver () {
+ awk 'NR==1 {split($NF,A,".");X=1000000*A[1]+1000*A[2]+A[3];print X;exit 0}'
+}
+
+check_version () {
+ if [ $(( `("$1" --version || echo "0") | cvtver` >= $2 )) = 1 ]; then
+ return 0
+ fi
+ echo "**Error**: "\`$1\'" not installed or too old." >&2
+ echo ' Version '$3' or newer is required.' >&2
+ [ -n "$4" ] && echo ' Note that this is part of '\`$4\''.' >&2
+ DIE="yes"
+ return 1
+}
+
+fatal () {
+ echo "autogen.sh:" "$*" >&2
+ DIE=yes
+}
+
+info () {
+ if [ -z "${SILENT}" ]; then
+ echo "autogen.sh:" "$*" >&2
+ fi
+}
+
+die_p () {
+ if [ "$DIE" = "yes" ]; then
+ echo "autogen.sh: Stop." >&2
+ exit 1
+ fi
+}
+
+replace_sysroot () {
+ configure_opts=$(echo $configure_opts | sed "s#@SYSROOT@#${w32root}#g")
+ extraoptions=$(echo $extraoptions | sed "s#@SYSROOT@#${w32root}#g")
+}
+
+# Allow to override the default tool names
+AUTOCONF=${AUTOCONF_PREFIX}${AUTOCONF:-autoconf}${AUTOCONF_SUFFIX}
+AUTOHEADER=${AUTOCONF_PREFIX}${AUTOHEADER:-autoheader}${AUTOCONF_SUFFIX}
+
+AUTOMAKE=${AUTOMAKE_PREFIX}${AUTOMAKE:-automake}${AUTOMAKE_SUFFIX}
+ACLOCAL=${AUTOMAKE_PREFIX}${ACLOCAL:-aclocal}${AUTOMAKE_SUFFIX}
+
+GETTEXT=${GETTEXT_PREFIX}${GETTEXT:-gettext}${GETTEXT_SUFFIX}
+MSGMERGE=${GETTEXT_PREFIX}${MSGMERGE:-msgmerge}${GETTEXT_SUFFIX}
+
+DIE=no
+FORCE=
+SILENT=
+PRINT_HOST=no
+PRINT_BUILD=no
+tmp=$(dirname "$0")
+tsdir=$(cd "${tmp}"; pwd)
+version_parts=3
+
+if [ -n "${AUTOGEN_SH_SILENT}" ]; then
+ SILENT=" --silent"
+fi
+if test x"$1" = x"--help"; then
+ echo "usage: ./autogen.sh [OPTIONS] [ARGS]"
+ echo " Options:"
+ echo " --silent Silent operation"
+ echo " --force Pass --force to autoconf"
+ echo " --find-version Helper for configure.ac"
+ echo " --build-TYPE Configure to cross build for TYPE"
+ echo " --print-host Print only the host triplet"
+ echo " --print-build Print only the build platform triplet"
+ echo ""
+ echo " ARGS are passed to configure in --build-TYPE mode."
+ echo " Configuration for this script is expected in autogen.rc"
+ exit 0
+fi
+if test x"$1" = x"--silent"; then
+ SILENT=" --silent"
+ shift
+fi
+if test x"$1" = x"--force"; then
+ FORCE=" --force"
+ shift
+fi
+if test x"$1" = x"--print-host"; then
+ PRINT_HOST=yes
+ shift
+fi
+if test x"$1" = x"--print-build"; then
+ PRINT_BUILD=yes
+ shift
+fi
+
+
+# Reject unsafe characters in $HOME, $tsdir and cwd. We consider spaces
+# as unsafe because it is too easy to get scripts wrong in this regard.
+am_lf='
+'
+case `pwd` in
+ *[\;\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ fatal "unsafe working directory name" ;;
+esac
+case $tsdir in
+ *[\;\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ fatal "unsafe source directory: \`$tsdir'" ;;
+esac
+case $HOME in
+ *[\;\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ fatal "unsafe home directory: \`$HOME'" ;;
+esac
+die_p
+
+
+# List of variables sourced from autogen.rc. The strings '@SYSROOT@' in
+# these variables are replaced by the actual system root.
+configure_opts=
+extraoptions=
+# List of optional variables sourced from autogen.rc and ~/.gnupg-autogen.rc
+w32_toolprefixes=
+w32_extraoptions=
+w32ce_toolprefixes=
+w32ce_extraoptions=
+w64_toolprefixes=
+w64_extraoptions=
+amd64_toolprefixes=
+# End list of optional variables sourced from ~/.gnupg-autogen.rc
+# What follows are variables which are sourced but default to
+# environment variables or lacking them hardcoded values.
+#w32root=
+#w32ce_root=
+#w64root=
+#amd64root=
+
+# Convenience option to use certain configure options for some hosts.
+myhost=""
+myhostsub=""
+case "$1" in
+ --find-version)
+ myhost="find-version"
+ SILENT=" --silent"
+ shift
+ ;;
+ --build-w32)
+ myhost="w32"
+ shift
+ ;;
+ --build-w32ce)
+ myhost="w32"
+ myhostsub="ce"
+ shift
+ ;;
+ --build-w64)
+ myhost="w32"
+ myhostsub="64"
+ shift
+ ;;
+ --build-amd64)
+ myhost="amd64"
+ shift
+ ;;
+ --build*)
+ fatal "**Error**: invalid build option $1"
+ shift
+ ;;
+ *)
+ ;;
+esac
+die_p
+
+
+# Source our configuration
+if [ -f "${tsdir}/autogen.rc" ]; then
+ . "${tsdir}/autogen.rc"
+fi
+
+# Source optional site specific configuration
+if [ -f "$HOME/.gnupg-autogen.rc" ]; then
+ info "sourcing extra definitions from $HOME/.gnupg-autogen.rc"
+ . "$HOME/.gnupg-autogen.rc"
+fi
+
+
+# **** FIND VERSION ****
+# This is a helper for the configure.ac M4 magic
+# Called
+# ./autogen.sh --find-version PACKAGE MAJOR MINOR [MICRO]
+# returns a complete version string with automatic beta numbering.
+if [ "$myhost" = "find-version" ]; then
+ package="$1"
+ major="$2"
+ minor="$3"
+ micro="$4"
+
+ if [ -z "$package" -o -z "$major" -o -z "$minor" ]; then
+ echo "usage: ./autogen.sh --find-version PACKAGE MAJOR MINOR [MICRO]" >&2
+ exit 1
+ fi
+
+ case "$version_parts" in
+ 2)
+ matchstr1="$package-$major.[0-9]*"
+ matchstr2="$package-$major-base"
+ vers="$major.$minor"
+ ;;
+ *)
+ matchstr1="$package-$major.$minor.[0-9]*"
+ matchstr2="$package-$major.$minor-base"
+ vers="$major.$minor.$micro"
+ ;;
+ esac
+
+ beta=no
+ if [ -e .git ]; then
+ ingit=yes
+ tmp=$(git describe --match "${matchstr1}" --long 2>/dev/null)
+ tmp=$(echo "$tmp" | sed s/^"$package"//)
+ if [ -n "$tmp" ]; then
+ tmp=$(echo "$tmp" | sed s/^"$package"// \
+ | awk -F- '$3!=0 && $3 !~ /^beta/ {print"-beta"$3}')
+ else
+ tmp=$(git describe --match "${matchstr2}" --long 2>/dev/null \
+ | awk -F- '$4!=0{print"-beta"$4}')
+ fi
+ [ -n "$tmp" ] && beta=yes
+ rev=$(git rev-parse --short HEAD | tr -d '\n\r')
+ rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null)))
+ else
+ ingit=no
+ beta=yes
+ tmp="-unknown"
+ rev="0000000"
+ rvd="0"
+ fi
+
+ echo "$package-$vers$tmp:$beta:$ingit:$vers$tmp:$vers:$tmp:$rev:$rvd:"
+ exit 0
+fi
+# **** end FIND VERSION ****
+
+
+if [ ! -f "$tsdir/build-aux/config.guess" ]; then
+ fatal "$tsdir/build-aux/config.guess not found"
+ exit 1
+fi
+build=`$tsdir/build-aux/config.guess`
+if [ $PRINT_BUILD = yes ]; then
+ echo "$build"
+ exit 0
+fi
+
+
+
+# ******************
+# W32 build script
+# ******************
+if [ "$myhost" = "w32" ]; then
+ case $myhostsub in
+ ce)
+ w32root="$w32ce_root"
+ [ -z "$w32root" ] && w32root="$HOME/w32ce_root"
+ toolprefixes="$w32ce_toolprefixes arm-mingw32ce"
+ extraoptions="$extraoptions $w32ce_extraoptions"
+ ;;
+ 64)
+ w32root="$w64root"
+ [ -z "$w32root" ] && w32root="$HOME/w64root"
+ toolprefixes="$w64_toolprefixes x86_64-w64-mingw32"
+ extraoptions="$extraoptions $w64_extraoptions"
+ ;;
+ *)
+ [ -z "$w32root" ] && w32root="$HOME/w32root"
+ toolprefixes="$w32_toolprefixes i686-w64-mingw32 i586-mingw32msvc"
+ toolprefixes="$toolprefixes i386-mingw32msvc mingw32"
+ extraoptions="$extraoptions $w32_extraoptions"
+ ;;
+ esac
+ info "Using $w32root as standard install directory"
+ replace_sysroot
+
+ # Locate the cross compiler
+ crossbindir=
+ for host in $toolprefixes; do
+ if ${host}-gcc --version >/dev/null 2>&1 ; then
+ crossbindir=/usr/${host}/bin
+ conf_CC="CC=${host}-gcc"
+ break;
+ fi
+ done
+ if [ -z "$crossbindir" ]; then
+ fatal "cross compiler kit not installed"
+ if [ -z "$myhostsub" ]; then
+ info "Under Debian GNU/Linux, you may install it using"
+ info " apt-get install mingw32 mingw32-runtime mingw32-binutils"
+ fi
+ die_p
+ fi
+ if [ $PRINT_HOST = yes ]; then
+ echo "$host"
+ exit 0
+ fi
+
+ if [ -f "$tsdir/config.log" ]; then
+ if ! head $tsdir/config.log | grep "$host" >/dev/null; then
+ fatal "Please run a 'make distclean' first"
+ die_p
+ fi
+ fi
+
+ $tsdir/configure --enable-maintainer-mode ${SILENT} \
+ --prefix=${w32root} \
+ --host=${host} --build=${build} SYSROOT=${w32root} \
+ PKG_CONFIG_LIBDIR=${w32root}/lib/pkgconfig \
+ ${configure_opts} ${extraoptions} "$@"
+ rc=$?
+ exit $rc
+fi
+# ***** end W32 build script *******
+
+# ***** AMD64 cross build script *******
+# Used to cross-compile for AMD64 (for testing)
+if [ "$myhost" = "amd64" ]; then
+ [ -z "$amd64root" ] && amd64root="$HOME/amd64root"
+ info "Using $amd64root as standard install directory"
+ replace_sysroot
+
+ toolprefixes="$amd64_toolprefixes x86_64-linux-gnu amd64-linux-gnu"
+
+ # Locate the cross compiler
+ crossbindir=
+ for host in $toolprefixes ; do
+ if ${host}-gcc --version >/dev/null 2>&1 ; then
+ crossbindir=/usr/${host}/bin
+ conf_CC="CC=${host}-gcc"
+ break;
+ fi
+ done
+ if [ -z "$crossbindir" ]; then
+ echo "Cross compiler kit not installed" >&2
+ echo "Stop." >&2
+ exit 1
+ fi
+ if [ $PRINT_HOST = yes ]; then
+ echo "$host"
+ exit 0
+ fi
+
+ if [ -f "$tsdir/config.log" ]; then
+ if ! head $tsdir/config.log | grep "$host" >/dev/null; then
+ echo "Please run a 'make distclean' first" >&2
+ exit 1
+ fi
+ fi
+
+ $tsdir/configure --enable-maintainer-mode ${SILENT} \
+ --prefix=${amd64root} \
+ --host=${host} --build=${build} \
+ ${configure_opts} ${extraoptions} "$@"
+ rc=$?
+ exit $rc
+fi
+# ***** end AMD64 cross build script *******
+
+
+# Grep the required versions from configure.ac
+autoconf_vers=`sed -n '/^AC_PREREQ(/ {
+s/^.*(\(.*\))/\1/p
+q
+}' ${configure_ac}`
+autoconf_vers_num=`echo "$autoconf_vers" | cvtver`
+
+automake_vers=`sed -n '/^min_automake_version=/ {
+s/^.*="\(.*\)"/\1/p
+q
+}' ${configure_ac}`
+automake_vers_num=`echo "$automake_vers" | cvtver`
+
+if [ -d "${tsdir}/po" ]; then
+ gettext_vers=`sed -n '/^AM_GNU_GETTEXT_VERSION(/ {
+s/^.*\[\(.*\)])/\1/p
+q
+}' ${configure_ac}`
+ gettext_vers_num=`echo "$gettext_vers" | cvtver`
+else
+ gettext_vers="n/a"
+fi
+
+if [ -z "$autoconf_vers" -o -z "$automake_vers" -o -z "$gettext_vers" ]
+then
+ echo "**Error**: version information not found in "\`${configure_ac}\'"." >&2
+ exit 1
+fi
+
+
+if check_version $AUTOCONF $autoconf_vers_num $autoconf_vers ; then
+ check_version $AUTOHEADER $autoconf_vers_num $autoconf_vers autoconf
+fi
+if check_version $AUTOMAKE $automake_vers_num $automake_vers; then
+ check_version $ACLOCAL $automake_vers_num $autoconf_vers automake
+fi
+if [ "$gettext_vers" != "n/a" ]; then
+ if check_version $GETTEXT $gettext_vers_num $gettext_vers; then
+ check_version $MSGMERGE $gettext_vers_num $gettext_vers gettext
+ fi
+fi
+
+if [ "$DIE" = "yes" ]; then
+ cat <<EOF
+
+Note that you may use alternative versions of the tools by setting
+the corresponding environment variables; see README.GIT for details.
+
+EOF
+ die_p
+fi
+
+# Check the git setup.
+if [ -d .git ]; then
+ CP="cp -p"
+ # If we have a GNU cp we can add -v
+ if cp --version >/dev/null 2>/dev/null; then
+ [ -z "${SILENT}" ] && CP="$CP -v"
+ fi
+ if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then
+ [ -z "${SILENT}" ] && cat <<EOF
+*** Activating trailing whitespace git pre-commit hook. ***
+ For more information see this thread:
+ https://mail.gnome.org/archives/desktop-devel-list/2009-May/msg00084.html
+ To deactivate this pre-commit hook again move .git/hooks/pre-commit
+ and .git/hooks/pre-commit.sample out of the way.
+EOF
+ $CP .git/hooks/pre-commit.sample .git/hooks/pre-commit
+ chmod +x .git/hooks/pre-commit
+ fi
+
+ if [ "$gettext_vers" != "n/a" ]; then
+ tmp=$(git config --get filter.cleanpo.clean)
+ if [ "$tmp" != \
+ "awk '/^\"POT-Creation-Date:/&&!s{s=1;next};!/^#: /{print}'" ]
+ then
+ info "*** Adding GIT filter.cleanpo.clean configuration."
+ git config --add filter.cleanpo.clean \
+ "awk '/^\"POT-Creation-Date:/&&!s{s=1;next};!/^#: /{print}'"
+ fi
+ fi
+ if [ -f build-aux/git-hooks/commit-msg -a ! -f .git/hooks/commit-msg ] ; then
+ [ -z "${SILENT}" ] && cat <<EOF
+*** Activating commit log message check hook. ***
+EOF
+ $CP build-aux/git-hooks/commit-msg .git/hooks/commit-msg
+ chmod +x .git/hooks/commit-msg
+ fi
+fi
+
+aclocal_flags="-I m4"
+if [ -n "${extra_aclocal_flags}" ]; then
+ aclocal_flags="${aclocal_flags} ${extra_aclocal_flags}"
+fi
+if [ -n "${ACLOCAL_FLAGS}" ]; then
+ aclocal_flags="${aclocal_flags} ${ACLOCAL_FLAGS}"
+fi
+info "Running $ACLOCAL ${aclocal_flags} ..."
+$ACLOCAL ${aclocal_flags}
+info "Running autoheader..."
+$AUTOHEADER
+info "Running automake --gnu ..."
+$AUTOMAKE --gnu;
+info "Running autoconf${FORCE} ..."
+$AUTOCONF${FORCE}
+
+info "You may now run:${am_lf} ${final_info}"
diff --git a/build-aux/compile b/build-aux/compile
new file mode 100755
index 0000000..52f8f94
--- /dev/null
+++ b/build-aux/compile
@@ -0,0 +1,347 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2012-10-14.11; # UTC
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Written by Tom Tromey <[email protected]>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <[email protected]> or send patches to
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" "" $nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+ file=$1
+ case $file in
+ / | /[!/]*) # absolute file, and not a UNC file
+ if test -z "$file_conv"; then
+ # lazily determine how to convert abs files
+ case `uname -s` in
+ MINGW*)
+ file_conv=mingw
+ ;;
+ CYGWIN*)
+ file_conv=cygwin
+ ;;
+ *)
+ file_conv=wine
+ ;;
+ esac
+ fi
+ case $file_conv/,$2, in
+ *,$file_conv,*)
+ ;;
+ mingw/*)
+ file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+ ;;
+ cygwin/*)
+ file=`cygpath -m "$file" || echo "$file"`
+ ;;
+ wine/*)
+ file=`winepath -w "$file" || echo "$file"`
+ ;;
+ esac
+ ;;
+ esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+ func_file_conv "$1"
+ if test -z "$lib_path"; then
+ lib_path=$file
+ else
+ lib_path="$lib_path;$file"
+ fi
+ linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+ lib=$1
+ found=no
+ save_IFS=$IFS
+ IFS=';'
+ for dir in $lib_path $LIB
+ do
+ IFS=$save_IFS
+ if $shared && test -f "$dir/$lib.dll.lib"; then
+ found=yes
+ lib=$dir/$lib.dll.lib
+ break
+ fi
+ if test -f "$dir/$lib.lib"; then
+ found=yes
+ lib=$dir/$lib.lib
+ break
+ fi
+ if test -f "$dir/lib$lib.a"; then
+ found=yes
+ lib=$dir/lib$lib.a
+ break
+ fi
+ done
+ IFS=$save_IFS
+
+ if test "$found" != yes; then
+ lib=$lib.lib
+ fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+ # Assume a capable shell
+ lib_path=
+ shared=:
+ linker_opts=
+ for arg
+ do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ eat=1
+ case $2 in
+ *.o | *.[oO][bB][jJ])
+ func_file_conv "$2"
+ set x "$@" -Fo"$file"
+ shift
+ ;;
+ *)
+ func_file_conv "$2"
+ set x "$@" -Fe"$file"
+ shift
+ ;;
+ esac
+ ;;
+ -I)
+ eat=1
+ func_file_conv "$2" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
+ -I*)
+ func_file_conv "${1#-I}" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
+ -l)
+ eat=1
+ func_cl_dashl "$2"
+ set x "$@" "$lib"
+ shift
+ ;;
+ -l*)
+ func_cl_dashl "${1#-l}"
+ set x "$@" "$lib"
+ shift
+ ;;
+ -L)
+ eat=1
+ func_cl_dashL "$2"
+ ;;
+ -L*)
+ func_cl_dashL "${1#-L}"
+ ;;
+ -static)
+ shared=false
+ ;;
+ -Wl,*)
+ arg=${1#-Wl,}
+ save_ifs="$IFS"; IFS=','
+ for flag in $arg; do
+ IFS="$save_ifs"
+ linker_opts="$linker_opts $flag"
+ done
+ IFS="$save_ifs"
+ ;;
+ -Xlinker)
+ eat=1
+ linker_opts="$linker_opts $2"
+ ;;
+ -*)
+ set x "$@" "$1"
+ shift
+ ;;
+ *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+ func_file_conv "$1"
+ set x "$@" -Tp"$file"
+ shift
+ ;;
+ *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+ func_file_conv "$1" mingw
+ set x "$@" "$file"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+ done
+ if test -n "$linker_opts"; then
+ linker_opts="-link$linker_opts"
+ fi
+ exec "$@" $linker_opts
+ exit 1
+}
+
+eat=
+
+case $1 in
+ '')
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <[email protected]>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "compile $scriptversion"
+ exit $?
+ ;;
+ cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+ func_cl_wrapper "$@" # Doesn't return...
+ ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ # So we strip '-o arg' only if arg is an object.
+ eat=1
+ case $2 in
+ *.o | *.obj)
+ ofile=$2
+ ;;
+ *)
+ set x "$@" -o "$2"
+ shift
+ ;;
+ esac
+ ;;
+ *.c)
+ cfile=$1
+ set x "$@" "$1"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+ # If no '-o' option was seen then we might have been invoked from a
+ # pattern rule where we don't need one. That is ok -- this is a
+ # normal compilation that the losing compiler can handle. If no
+ # '.c' file was seen then we are probably linking. That is also
+ # ok.
+ exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file. Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+ if mkdir "$lockdir" >/dev/null 2>&1; then
+ break
+ fi
+ sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+ test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+ test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/config.guess b/build-aux/config.guess
new file mode 100755
index 0000000..c4bd827
--- /dev/null
+++ b/build-aux/config.guess
@@ -0,0 +1,1456 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright 1992-2016 Free Software Foundation, Inc.
+
+timestamp='2016-05-15'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+#
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+#
+# Please send patches to <[email protected]>.
+
+
+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 <[email protected]>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright 1992-2016 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.
+# ([email protected] 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ LIBC=gnu
+
+ eval $set_cc_for_build
+ cat <<-EOF > $dummy.c
+ #include <features.h>
+ #if defined(__UCLIBC__)
+ LIBC=uclibc
+ #elif defined(__dietlibc__)
+ LIBC=dietlibc
+ #else
+ LIBC=gnu
+ #endif
+ EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+ ;;
+esac
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+ /sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || \
+ echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ earmv*)
+ arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+ endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
+ machine=${arch}${endian}-unknown
+ ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently (or will in the future) and ABI.
+ case "${UNAME_MACHINE_ARCH}" in
+ earm*)
+ os=netbsdelf
+ ;;
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ELF__
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # Determine ABI tags.
+ case "${UNAME_MACHINE_ARCH}" in
+ earm*)
+ expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+ abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}${abi}"
+ exit ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:LibertyBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:Sortix:*:*)
+ echo ${UNAME_MACHINE}-unknown-sortix
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE=alpha ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE=alpha ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE=alpha ;;
+ "EV5 (21164)")
+ UNAME_MACHINE=alphaev5 ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE=alphaev56 ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE=alphapca56 ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE=alphapca57 ;;
+ "EV6 (21264)")
+ UNAME_MACHINE=alphaev6 ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE=alphaev67 ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE=alphaev68 ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE=alphaev68 ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE=alphaev68 ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE=alphaev69 ;;
+ "EV7 (21364)")
+ UNAME_MACHINE=alphaev7 ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE=alphaev79 ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ exitcode=$?
+ trap '' 0
+ exit $exitcode ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm*:riscos:*:*|arm*:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # [email protected] (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ s390x:SunOS:*:*)
+ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux${UNAME_RELEASE}
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval $set_cc_for_build
+ SUN_ARCH=i386
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH=x86_64
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* 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 <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[4567])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/lslpp ] ; then
+ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH=hppa2.0n ;;
+ 64) HP_ARCH=hppa2.0w ;;
+ '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = hppa2.0w ]
+ then
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep -q __LP64__
+ then
+ HP_ARCH=hppa2.0w
+ else
+ HP_ARCH=hppa64
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ case ${UNAME_PROCESSOR} in
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ *:MINGW64*:*)
+ echo ${UNAME_MACHINE}-pc-mingw64
+ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ *:MSYS*:*)
+ echo ${UNAME_MACHINE}-pc-msys
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ *:Interix*:*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ authenticamd | genuineintel | EM64T)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ 8664:Windows_NT:*)
+ echo x86_64-pc-mks
+ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ aarch64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ aarch64_be:Linux:*:*)
+ UNAME_MACHINE=aarch64_be
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ arc:Linux:*:* | arceb:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ else
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+ fi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ cris:Linux:*:*)
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ exit ;;
+ crisv32:Linux:*:*)
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ exit ;;
+ e2k:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ frv:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ hexagon:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ i*86:Linux:*:*)
+ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ k1om:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ mips:Linux:*:* | mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=${UNAME_MACHINE}el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=${UNAME_MACHINE}
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ ;;
+ openrisc*:Linux:*:*)
+ echo or1k-unknown-linux-${LIBC}
+ exit ;;
+ or32:Linux:*:* | or1k*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-${LIBC}
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-${LIBC}
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+ *) echo hppa-unknown-linux-${LIBC} ;;
+ esac
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-${LIBC}
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-${LIBC}
+ exit ;;
+ ppc64le:Linux:*:*)
+ echo powerpc64le-unknown-linux-${LIBC}
+ exit ;;
+ ppcle:Linux:*:*)
+ echo powerpcle-unknown-linux-${LIBC}
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ tile*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ exit ;;
+ x86_64:Linux:*:*)
+ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configure will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <[email protected]>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ x86_64:Haiku:*:*)
+ echo x86_64-unknown-haiku
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-ACE:SUPER-UX:*:*)
+ echo sxace-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ eval $set_cc_for_build
+ if test "$UNAME_PROCESSOR" = unknown ; then
+ UNAME_PROCESSOR=powerpc
+ fi
+ if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ fi
+ elif test "$UNAME_PROCESSOR" = i386 ; then
+ # Avoid executing cc on OS X 10.9, as it ships with a stub
+ # that puts up a graphical alert prompting to install
+ # developer tools. Any system running Mac OS X 10.7 or
+ # later (Darwin 11 and later) is required to have a 64-bit
+ # processor. This is not true of the ARM version of Darwin
+ # that Apple uses in portable devices.
+ UNAME_PROCESSOR=x86_64
+ fi
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = x86; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NEO-?:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSE-*:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = 386; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
+ x86_64:VMkernel:*:*)
+ echo ${UNAME_MACHINE}-unknown-esx
+ exit ;;
+ amd64:Isilon\ OneFS:*:*)
+ echo x86_64-unknown-onefs
+ exit ;;
+esac
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script (version $timestamp), has failed to recognize the
+operating system you are using. If your script is old, overwrite
+config.guess and config.sub with the latest versions from:
+
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+and
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+
+If $0 has already been updated, send the following data and any
+information you think might be pertinent to [email protected] to
+provide the necessary information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/build-aux/config.rpath b/build-aux/config.rpath
new file mode 100755
index 0000000..b625621
--- /dev/null
+++ b/build-aux/config.rpath
@@ -0,0 +1,684 @@
+#! /bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+# Copyright 1996-2014 Free Software Foundation, Inc.
+# Taken from GNU libtool, 2001
+# Originally by Gordon Matzigkeit <[email protected]>, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# The first argument passed to this file is the canonical host specification,
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+# than 256 bytes, otherwise the compiler driver will dump core. The only
+# known workaround is to choose shorter directory names for the build
+# directory and/or the installation directory.
+
+# All known linkers require a '.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# Code taken from libtool.m4's _LT_CC_BASENAME.
+
+for cc_temp in $CC""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's _LT_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+ wl='-Wl,'
+else
+ case "$host_os" in
+ aix*)
+ wl='-Wl,'
+ ;;
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ wl='-Wl,'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ wl='-Wl,'
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ ecc*)
+ wl='-Wl,'
+ ;;
+ icc* | ifort*)
+ wl='-Wl,'
+ ;;
+ lf95*)
+ wl='-Wl,'
+ ;;
+ nagfor*)
+ wl='-Wl,-Wl,,'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ wl='-Wl,'
+ ;;
+ ccc*)
+ wl='-Wl,'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ wl='-Wl,'
+ ;;
+ como)
+ wl='-lopt='
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ F* | *Sun*Fortran*)
+ wl=
+ ;;
+ *Sun\ C*)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ newsos6)
+ ;;
+ *nto* | *qnx*)
+ ;;
+ osf3* | osf4* | osf5*)
+ wl='-Wl,'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ wl='-Qoption ld '
+ ;;
+ *)
+ wl='-Wl,'
+ ;;
+ esac
+ ;;
+ sunos4*)
+ wl='-Qoption ld '
+ ;;
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ wl='-Wl,'
+ ;;
+ sysv4*MP*)
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ wl='-Wl,'
+ ;;
+ unicos*)
+ wl='-Wl,'
+ ;;
+ uts4*)
+ ;;
+ esac
+fi
+
+# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
+
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+
+case "$host_os" in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ # Unlike libtool, we use -rpath here, not --rpath, since the documented
+ # option of GNU ld is called -rpath, not --rpath.
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ case "$host_os" in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ fi
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc)
+ ;;
+ m68k)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ haiku*)
+ ;;
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ netbsd*)
+ ;;
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+ sunos4*)
+ hardcode_direct=yes
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ if test "$ld_shlibs" = no; then
+ hardcode_libdir_flag_spec=
+ fi
+else
+ case "$host_os" in
+ aix3*)
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+ aix[4-9]*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ else
+ aix_use_runtimelinking=no
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+ fi
+ hardcode_direct=yes
+ hardcode_libdir_separator=':'
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ fi
+ # Begin _LT_AC_SYS_LIBPATH_AIX.
+ echo 'int main () { return 0; }' > conftest.c
+ ${CC} ${LDFLAGS} conftest.c -o conftest
+ aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+ fi
+ if test -z "$aix_libpath"; then
+ aix_libpath="/usr/lib:/lib"
+ fi
+ rm -f conftest.c conftest
+ # End _LT_AC_SYS_LIBPATH_AIX.
+ if test "$aix_use_runtimelinking" = yes; then
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ else
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ fi
+ fi
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc)
+ ;;
+ m68k)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+ bsdi[45]*)
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ libext=lib
+ ;;
+ darwin* | rhapsody*)
+ hardcode_direct=no
+ if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
+ :
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ dgux*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ freebsd2.[01]*)
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ freebsd* | dragonfly*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ hpux9*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ hpux10*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+ hpux11*)
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ ;;
+ *)
+ hardcode_direct=yes
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+ irix5* | irix6* | nonstopux*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ netbsd*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ ;;
+ newsos6)
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ *nto* | *qnx*)
+ ;;
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ else
+ case "$host_os" in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ osf3*)
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+ osf4* | osf5*)
+ if test "$GCC" = yes; then
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ # Both cc and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+ solaris*)
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ sunos4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ ;;
+ sysv4)
+ case $host_vendor in
+ sni)
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ hardcode_direct=no
+ ;;
+ motorola)
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ ;;
+ sysv4.3*)
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ ld_shlibs=yes
+ fi
+ ;;
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ ;;
+ sysv5* | sco3.2v5* | sco5v6*)
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator=':'
+ ;;
+ uts4*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
+# only about the one the linker finds when passed -lNAME. This is the last
+# element of library_names_spec in libtool.m4, or possibly two of them if the
+# linker has special search rules.
+library_names_spec= # the last element of library_names_spec in libtool.m4
+libname_spec='lib$name'
+case "$host_os" in
+ aix3*)
+ library_names_spec='$libname.a'
+ ;;
+ aix[4-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ amigaos*)
+ case "$host_cpu" in
+ powerpc*)
+ library_names_spec='$libname$shrext' ;;
+ m68k)
+ library_names_spec='$libname.a' ;;
+ esac
+ ;;
+ beos*)
+ library_names_spec='$libname$shrext'
+ ;;
+ bsdi[45]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ cygwin* | mingw* | pw32* | cegcc*)
+ shrext=.dll
+ library_names_spec='$libname.dll.a $libname.lib'
+ ;;
+ darwin* | rhapsody*)
+ shrext=.dylib
+ library_names_spec='$libname$shrext'
+ ;;
+ dgux*)
+ library_names_spec='$libname$shrext'
+ ;;
+ freebsd[23].*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ freebsd* | dragonfly*)
+ library_names_spec='$libname$shrext'
+ ;;
+ gnu*)
+ library_names_spec='$libname$shrext'
+ ;;
+ haiku*)
+ library_names_spec='$libname$shrext'
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $host_cpu in
+ ia64*)
+ shrext=.so
+ ;;
+ hppa*64*)
+ shrext=.sl
+ ;;
+ *)
+ shrext=.sl
+ ;;
+ esac
+ library_names_spec='$libname$shrext'
+ ;;
+ interix[3-9]*)
+ library_names_spec='$libname$shrext'
+ ;;
+ irix5* | irix6* | nonstopux*)
+ library_names_spec='$libname$shrext'
+ case "$host_os" in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+ *) libsuff= shlibsuff= ;;
+ esac
+ ;;
+ esac
+ ;;
+ linux*oldld* | linux*aout* | linux*coff*)
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ knetbsd*-gnu)
+ library_names_spec='$libname$shrext'
+ ;;
+ netbsd*)
+ library_names_spec='$libname$shrext'
+ ;;
+ newsos6)
+ library_names_spec='$libname$shrext'
+ ;;
+ *nto* | *qnx*)
+ library_names_spec='$libname$shrext'
+ ;;
+ openbsd*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ os2*)
+ libname_spec='$name'
+ shrext=.dll
+ library_names_spec='$libname.a'
+ ;;
+ osf3* | osf4* | osf5*)
+ library_names_spec='$libname$shrext'
+ ;;
+ rdos*)
+ ;;
+ solaris*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sunos4*)
+ library_names_spec='$libname$shrext$versuffix'
+ ;;
+ sysv4 | sysv4.3*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv4*MP*)
+ library_names_spec='$libname$shrext'
+ ;;
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ library_names_spec='$libname$shrext'
+ ;;
+ tpf*)
+ library_names_spec='$libname$shrext'
+ ;;
+ uts4*)
+ library_names_spec='$libname$shrext'
+ ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Format of library name prefix.
+libname_spec="$escaped_libname_spec"
+
+# Library names that the linker finds when passed -lNAME.
+library_names_spec="$escaped_library_names_spec"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
diff --git a/build-aux/config.sub b/build-aux/config.sub
new file mode 100755
index 0000000..9feb73b
--- /dev/null
+++ b/build-aux/config.sub
@@ -0,0 +1,1823 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright 1992-2016 Free Software Foundation, Inc.
+
+timestamp='2016-06-20'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+
+
+# Please send patches to <[email protected]>.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <[email protected]>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright 1992-2016 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
+ kopensolaris*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ android-linux)
+ os=-linux-android
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray | -microblaze*)
+ os=
+ basic_machine=$1
+ ;;
+ -bluegene*)
+ os=-cnk
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*178)
+ os=-lynxos178
+ ;;
+ -lynx*5)
+ os=-lynxos5
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | aarch64 | aarch64_be \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arceb \
+ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+ | avr | avr32 \
+ | ba \
+ | be32 | be64 \
+ | bfin \
+ | c4x | c8051 | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | e2k | epiphany \
+ | fido | fr30 | frv | ft32 \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | k1om \
+ | le32 | le64 \
+ | lm32 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa32r6 | mipsisa32r6el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64r6 | mipsisa64r6el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nds32 | nds32le | nds32be \
+ | nios | nios2 | nios2eb | nios2el \
+ | ns16k | ns32k \
+ | open8 | or1k | or1knd | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle \
+ | pyramid \
+ | riscv32 | riscv64 \
+ | rl78 | rx \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu \
+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+ | ubicom32 \
+ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+ | visium \
+ | we32k \
+ | x86 | xc16x | xstormy16 | xtensa \
+ | z8k | z80)
+ basic_machine=$basic_machine-unknown
+ ;;
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
+ c55x)
+ basic_machine=tic55x-unknown
+ ;;
+ c6x)
+ basic_machine=tic6x-unknown
+ ;;
+ leon|leon[3-9])
+ basic_machine=sparc-$basic_machine
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ strongarm | thumb | xscale)
+ basic_machine=arm-unknown
+ ;;
+ xgate)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ xscaleeb)
+ basic_machine=armeb-unknown
+ ;;
+
+ xscaleel)
+ basic_machine=armel-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | aarch64-* | aarch64_be-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | ba-* \
+ | be32-* | be64-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
+ | c8051-* | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | e2k-* | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | hexagon-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | k1om-* \
+ | le32-* | le64-* \
+ | lm32-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | microblaze-* | microblazeel-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64octeon-* | mips64octeonel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa32r6-* | mipsisa32r6el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64r6-* | mipsisa64r6el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipsr5900-* | mipsr5900el-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nds32-* | nds32le-* | nds32be-* \
+ | nios-* | nios2-* | nios2eb-* | nios2el-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | open8-* \
+ | or1k*-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+ | pyramid-* \
+ | riscv32-* | riscv64-* \
+ | rl78-* | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
+ | tahoe-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tile*-* \
+ | tron-* \
+ | ubicom32-* \
+ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+ | vax-* \
+ | visium-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-* | z80-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
+ asmjs)
+ basic_machine=asmjs-unknown
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
+ c54x-*)
+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16 | cr16-*)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ e500v[12])
+ basic_machine=powerpc-unknown
+ os=$os"spe"
+ ;;
+ e500v[12]-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=$os"spe"
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ leon-*|leon[3-9]-*)
+ basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ microblaze*)
+ basic_machine=microblaze-xilinx
+ ;;
+ mingw64)
+ basic_machine=x86_64-pc
+ os=-mingw64
+ ;;
+ mingw32)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ moxiebox)
+ basic_machine=moxie-unknown
+ os=-moxiebox
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
+ msys)
+ basic_machine=i686-pc
+ os=-msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+ os=-nacl
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ neo-tandem)
+ basic_machine=neo-tandem
+ ;;
+ nse-tandem)
+ basic_machine=nse-tandem
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc | ppcbe) basic_machine=powerpc-unknown
+ ;;
+ ppc-* | ppcbe-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ os=-rdos
+ ;;
+ rdos32)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ strongarm-* | thumb-*)
+ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tile*)
+ basic_machine=$basic_machine-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ xscale-* | xscalee[bl]-*)
+ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -auroraux)
+ os=-auroraux
+ ;;
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* | -plan9* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* | -aros* | -cloudabi* | -sortix* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
+ | -onefs* | -tirtos* | -phoenix*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -nacl*)
+ ;;
+ -ios)
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ c8051-*)
+ os=-elf
+ ;;
+ hexagon-*)
+ os=-elf
+ ;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-haiku)
+ os=-haiku
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -cnk*|-aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/build-aux/depcomp b/build-aux/depcomp
new file mode 100755
index 0000000..f0a474c
--- /dev/null
+++ b/build-aux/depcomp
@@ -0,0 +1,791 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2013-05-30.07; # UTC
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <[email protected]>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by 'PROGRAMS ARGS'.
+ object Object file output by 'PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputting dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <[email protected]>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'. Note that this directory component will
+# be either empty or ending with a '/' character. This is deliberate.
+set_dir_from ()
+{
+ case $1 in
+ */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+ *) dir=;;
+ esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+ base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+ echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+ # If the compiler actually managed to produce a dependency file,
+ # post-process it.
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form 'foo.o: dependency.h'.
+ # Do two passes, one to just change these to
+ # $object: dependency.h
+ # and one to simply output
+ # dependency.h:
+ # which is needed to avoid the deleted-header problem.
+ { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+ sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+ } > "$depfile"
+ rm -f "$tmpdepfile"
+ else
+ make_dummy_depfile
+ fi
+}
+
+# A tabulation character.
+tab=' '
+# A newline character.
+nl='
+'
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Avoid interferences from the environment.
+gccflag= dashmflag=
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+ # This is just like msvisualcpp but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+ # This is just like msvc7 but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+ # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+ gccflag=-qmakedep=gcc,-MF
+ depmode=gcc
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
+## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
+## (see the conditional assignment to $gccflag above).
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say). Also, it might not be
+## supported by the other compilers which use the 'gcc' depmode.
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ # The second -e expression handles DOS-style file names with drive
+ # letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the "deleted header file" problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+## Some versions of gcc put a space before the ':'. On the theory
+## that the space means something, we add a space to the output as
+## well. hp depmode also adds that space, but also prefixes the VPATH
+## to the object. Take care to not repeat it in the output.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ 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 ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+ | tr "$nl" ' ' >> "$depfile"
+ echo >> "$depfile"
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> "$depfile"
+ else
+ make_dummy_depfile
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+xlc)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts '$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ set_dir_from "$object"
+ set_base_from "$object"
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$base.u
+ tmpdepfile3=$dir.libs/$base.u
+ "$@" -Wc,-M
+ else
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$dir$base.u
+ tmpdepfile3=$dir$base.u
+ "$@" -M
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ aix_post_process_depfile
+ ;;
+
+tcc)
+ # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+ # FIXME: That version still under development at the moment of writing.
+ # Make that this statement remains true also for stable, released
+ # versions.
+ # It will wrap lines (doesn't matter whether long or short) with a
+ # trailing '\', as in:
+ #
+ # foo.o : \
+ # foo.c \
+ # foo.h \
+ #
+ # It will put a trailing '\' even on the last line, and will use leading
+ # spaces rather than leading tabs (at least since its commit 0394caf7
+ # "Emit spaces for -MD").
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+ # We have to change lines of the first kind to '$object: \'.
+ sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+ # And for each line of the second kind, we have to emit a 'dep.h:'
+ # dummy dependency, to avoid the deleted-header problem.
+ sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file. A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+ # Portland's C compiler understands '-MD'.
+ # Will always output deps to 'file.d' where file is the root name of the
+ # source file under compilation, even if file resides in a subdirectory.
+ # The object file name does not affect the name of the '.d' file.
+ # pgcc 10.2 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using '\' :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+ set_dir_from "$object"
+ # Use the source, not the object, to determine the base name, since
+ # that's sadly what pgcc will do too.
+ set_base_from "$source"
+ tmpdepfile=$base.d
+
+ # For projects that build the same source file twice into different object
+ # files, the pgcc approach of using the *source* file root name can cause
+ # problems in parallel builds. Use a locking strategy to avoid stomping on
+ # the same $tmpdepfile.
+ lockdir=$base.d-lock
+ trap "
+ echo '$0: caught signal, cleaning up...' >&2
+ rmdir '$lockdir'
+ exit 1
+ " 1 2 13 15
+ numtries=100
+ i=$numtries
+ while test $i -gt 0; do
+ # mkdir is a portable test-and-set.
+ if mkdir "$lockdir" 2>/dev/null; then
+ # This process acquired the lock.
+ "$@" -MD
+ stat=$?
+ # Release the lock.
+ rmdir "$lockdir"
+ break
+ else
+ # If the lock is being held by a different process, wait
+ # until the winning process is done or we timeout.
+ while test -d "$lockdir" && test $i -gt 0; do
+ sleep 1
+ i=`expr $i - 1`
+ done
+ fi
+ i=`expr $i - 1`
+ done
+ trap - 1 2 13 15
+ if test $i -le 0; then
+ echo "$0: failed to acquire lock after $numtries attempts" >&2
+ echo "$0: check lockdir '$lockdir'" >&2
+ exit 1
+ fi
+
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # 'foo.d', which lands next to the object file, wherever that
+ # happens to be.
+ # Much of this is similar to the tru64 case; see comments there.
+ set_dir_from "$object"
+ set_base_from "$object"
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add 'dependent.h:' lines.
+ sed -ne '2,${
+ s/^ *//
+ s/ \\*$//
+ s/$/:/
+ p
+ }' "$tmpdepfile" >> "$depfile"
+ else
+ make_dummy_depfile
+ fi
+ rm -f "$tmpdepfile" "$tmpdepfile2"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in 'foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ set_dir_from "$object"
+ set_base_from "$object"
+
+ if test "$libtool" = yes; then
+ # Libtool generates 2 separate objects for the 2 libraries. These
+ # two compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir$base.o.d # libtool 1.5
+ tmpdepfile2=$dir.libs/$base.o.d # Likewise.
+ tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ # Same post-processing that is required for AIX mode.
+ aix_post_process_depfile
+ ;;
+
+msvc7)
+ if test "$libtool" = yes; then
+ showIncludes=-Wc,-showIncludes
+ else
+ showIncludes=-showIncludes
+ fi
+ "$@" $showIncludes > "$tmpdepfile"
+ stat=$?
+ grep -v '^Note: including file: ' "$tmpdepfile"
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ # The first sed program below extracts the file names and escapes
+ # backslashes for cygpath. The second sed program outputs the file
+ # name when reading, but also accumulates all include files in the
+ # hold buffer in order to output them again at the end. This only
+ # works with sed implementations that can handle large buffers.
+ sed < "$tmpdepfile" -n '
+/^Note: including file: *\(.*\)/ {
+ s//\1/
+ s/\\/\\\\/g
+ p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+ s/.*/'"$tab"'/
+ G
+ p
+}' >> "$depfile"
+ echo >> "$depfile" # make sure the fragment doesn't end with a backslash
+ rm -f "$tmpdepfile"
+ ;;
+
+msvc7msys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove '-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for ':'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
+ "$@" $dashmflag |
+ sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this sed invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no eat=no
+ for arg
+ do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ if test $eat = yes; then
+ eat=no
+ continue
+ fi
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -arch)
+ eat=yes ;;
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix=`echo "$object" | sed 's/^.*\././'`
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ # makedepend may prepend the VPATH from the source file name to the object.
+ # No need to regex-escape $object, excess matching of '.' is harmless.
+ sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process the last invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed '1,2d' "$tmpdepfile" \
+ | tr ' ' "$nl" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove '-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E \
+ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ | sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E 2>/dev/null |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+ echo "$tab" >> "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvcmsys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/git-log-fix b/build-aux/git-log-fix
new file mode 100644
index 0000000..af702fe
--- /dev/null
+++ b/build-aux/git-log-fix
@@ -0,0 +1,3 @@
+# This file is expected to be used via gitlog-to-changelog's --amend=FILE
+# option. It specifies what changes to make to each given SHA1's commit
+# log and metadata, using Perl-eval'able expressions.
diff --git a/build-aux/git-log-footer b/build-aux/git-log-footer
new file mode 100644
index 0000000..c31fe93
--- /dev/null
+++ b/build-aux/git-log-footer
@@ -0,0 +1,14 @@
+
+2011-12-01 Werner Koch <[email protected]>
+
+ NB: Changes done before December 1st, 2011 are described in
+ per directory files named ChangeLog-2011. See doc/HACKING for
+ details.
+
+ -----
+ Copyright (C) 2011 Free Software Foundation, Inc.
+
+ Copying and distribution of this file and/or the original GIT
+ commit log messages, with or without modification, are
+ permitted provided the copyright notice and this notice are
+ preserved.
diff --git a/build-aux/install-sh b/build-aux/install-sh
new file mode 100755
index 0000000..377bb86
--- /dev/null
+++ b/build-aux/install-sh
@@ -0,0 +1,527 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2011-11-20.07; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# 'make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+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.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+ test "$posix_glob" != "?" || {
+ if (set -f) 2>/dev/null; then
+ posix_glob=
+ else
+ posix_glob=:
+ fi
+ }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+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:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t) dst_arg=$2
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ shift;;
+
+ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call 'install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ do_exit='(exit $ret); exit $ret'
+ trap "ret=129; $do_exit" 1
+ trap "ret=130; $do_exit" 2
+ trap "ret=141; $do_exit" 13
+ trap "ret=143; $do_exit" 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names problematic for 'test' and other utilities.
+ case $src in
+ -* | [=\(\)!]) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+ dst=$dst_arg
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dst_arg: 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-writable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ [-=\(\)!]*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob set -f
+ set fnord $dstdir
+ shift
+ $posix_glob set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test X"$d" = X && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+
+ eval "$initialize_posix_glob" &&
+ $posix_glob set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ $posix_glob set +f &&
+
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/ltmain.sh b/build-aux/ltmain.sh
new file mode 100644
index 0000000..c3bcdc0
--- /dev/null
+++ b/build-aux/ltmain.sh
@@ -0,0 +1,9677 @@
+
+# libtool (GNU libtool) 2.4.2
+# Written by Gordon Matzigkeit <[email protected]>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008, 2009, 2010, 2011 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.
+
+# GNU Libtool 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.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from https://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Usage: $progname [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
+# --mode=MODE use operation mode MODE
+# --preserve-dup-deps don't remove duplicate dependency libraries
+# --quiet, --silent don't print informational messages
+# --no-quiet, --no-silent
+# print informational messages (default)
+# --no-warn don't display warning messages
+# --tag=TAG use configuration variables from tag TAG
+# -v, --verbose print more informational messages than default
+# --no-verbose don't print the extra informational messages
+# --version print version information
+# -h, --help, --help-all print short, long, or detailed help message
+#
+# 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. When passed as first option,
+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+# host-triplet: $host
+# shell: $SHELL
+# compiler: $LTCC
+# compiler flags: $LTCFLAGS
+# linker: $LD (gnu? $with_gnu_ld)
+# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1
+# automake: $automake_version
+# autoconf: $autoconf_version
+#
+# Report bugs to <[email protected]>.
+# GNU libtool home page: <https://www.gnu.org/software/libtool/>.
+# General help using GNU software: <https://www.gnu.org/gethelp/>.
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION="2.4.2 Debian-2.4.2-1"
+TIMESTAMP=""
+package_revision=1.3337
+
+# Be 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
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# NLS nuisances: We save the old values to restore during execute mode.
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+ eval "if test \"\${$lt_var+set}\" = set; then
+ save_$lt_var=\$$lt_var
+ $lt_var=C
+ export $lt_var
+ lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+ lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+ fi"
+done
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
+
+$lt_unset CDPATH
+
+
+# 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"
+
+
+
+: ${CP="cp -f"}
+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" $lt_nl"
+
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+} # func_dirname may be replaced by extended shell implementation
+
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+} # func_basename may be replaced by extended shell implementation
+
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+ func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+} # func_dirname_and_basename may be replaced by extended shell implementation
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname may be replaced by extended shell implementation
+
+
+# These SED scripts presuppose an absolute path with a trailing slash.
+pathcar='s,^/\([^/]*\).*$,\1,'
+pathcdr='s,^/[^/]*,,'
+removedotparts=':dotsl
+ s@/\./@/@g
+ t dotsl
+ s,/\.$,/,'
+collapseslashes='s@/\{1,\}@/@g'
+finalslash='s,/*$,/,'
+
+# func_normal_abspath PATH
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+# value returned in "$func_normal_abspath_result"
+func_normal_abspath ()
+{
+ # Start from root dir and reassemble the path.
+ func_normal_abspath_result=
+ func_normal_abspath_tpath=$1
+ func_normal_abspath_altnamespace=
+ case $func_normal_abspath_tpath in
+ "")
+ # Empty path, that just means $cwd.
+ func_stripname '' '/' "`pwd`"
+ func_normal_abspath_result=$func_stripname_result
+ return
+ ;;
+ # The next three entries are used to spot a run of precisely
+ # two leading slashes without using negated character classes;
+ # we take advantage of case's first-match behaviour.
+ ///*)
+ # Unusual form of absolute path, do nothing.
+ ;;
+ //*)
+ # Not necessarily an ordinary path; POSIX reserves leading '//'
+ # and for example Cygwin uses it to access remote file shares
+ # over CIFS/SMB, so we conserve a leading double slash if found.
+ func_normal_abspath_altnamespace=/
+ ;;
+ /*)
+ # Absolute path, do nothing.
+ ;;
+ *)
+ # Relative path, prepend $cwd.
+ func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+ ;;
+ esac
+ # Cancel out all the simple stuff to save iterations. We also want
+ # the path to end with a slash for ease of parsing, so make sure
+ # there is one (and only one) here.
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
+ while :; do
+ # Processed it all yet?
+ if test "$func_normal_abspath_tpath" = / ; then
+ # If we ascended to the root using ".." the result may be empty now.
+ if test -z "$func_normal_abspath_result" ; then
+ func_normal_abspath_result=/
+ fi
+ break
+ fi
+ func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$pathcar"`
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$pathcdr"`
+ # Figure out what to do with it
+ case $func_normal_abspath_tcomponent in
+ "")
+ # Trailing empty path component, ignore it.
+ ;;
+ ..)
+ # Parent dir; strip last assembled component from result.
+ func_dirname "$func_normal_abspath_result"
+ func_normal_abspath_result=$func_dirname_result
+ ;;
+ *)
+ # Actual path component, append it.
+ func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
+ ;;
+ esac
+ done
+ # Restore leading double-slash if one was found on entry.
+ func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+# func_relative_path SRCDIR DSTDIR
+# generates a relative path from SRCDIR to DSTDIR, with a trailing
+# slash if non-empty, suitable for immediately appending a filename
+# without needing to append a separator.
+# value returned in "$func_relative_path_result"
+func_relative_path ()
+{
+ func_relative_path_result=
+ func_normal_abspath "$1"
+ func_relative_path_tlibdir=$func_normal_abspath_result
+ func_normal_abspath "$2"
+ func_relative_path_tbindir=$func_normal_abspath_result
+
+ # Ascend the tree starting from libdir
+ while :; do
+ # check if we have found a prefix of bindir
+ case $func_relative_path_tbindir in
+ $func_relative_path_tlibdir)
+ # found an exact match
+ func_relative_path_tcancelled=
+ break
+ ;;
+ $func_relative_path_tlibdir*)
+ # found a matching prefix
+ func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+ func_relative_path_tcancelled=$func_stripname_result
+ if test -z "$func_relative_path_result"; then
+ func_relative_path_result=.
+ fi
+ break
+ ;;
+ *)
+ func_dirname $func_relative_path_tlibdir
+ func_relative_path_tlibdir=${func_dirname_result}
+ if test "x$func_relative_path_tlibdir" = x ; then
+ # Have to descend all the way to the root!
+ func_relative_path_result=../$func_relative_path_result
+ func_relative_path_tcancelled=$func_relative_path_tbindir
+ break
+ fi
+ func_relative_path_result=../$func_relative_path_result
+ ;;
+ esac
+ done
+
+ # Now calculate path; take care to avoid doubling-up slashes.
+ func_stripname '' '/' "$func_relative_path_result"
+ func_relative_path_result=$func_stripname_result
+ func_stripname '/' '/' "$func_relative_path_tcancelled"
+ if test "x$func_stripname_result" != x ; then
+ func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
+ fi
+
+ # Normalisation. If bindir is libdir, return empty string,
+ # else relative path ending with a slash; either way, target
+ # file name can be directly appended.
+ if test ! -z "$func_relative_path_result"; then
+ func_stripname './' '' "$func_relative_path_result/"
+ func_relative_path_result=$func_stripname_result
+ fi
+}
+
+# The name of this program:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+ [\\/]*|[A-Za-z]:\\*) ;;
+ *[\\/]*)
+ progdir=$func_dirname_result
+ progdir=`cd "$progdir" && pwd`
+ progpath="$progdir/$progname"
+ ;;
+ *)
+ save_IFS="$IFS"
+ IFS=${PATH_SEPARATOR-:}
+ for progdir in $PATH; do
+ IFS="$save_IFS"
+ test -x "$progdir/$progname" && break
+ done
+ IFS="$save_IFS"
+ test -n "$progdir" || progdir=`pwd`
+ progpath="$progdir/$progname"
+ ;;
+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 that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+
+# Sed substitution that converts a w32 file name or path
+# which contains forward slashes, into one that contains
+# (escaped) backslashes. A very naive implementation.
+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Sed substitution to remove simple comments and empty
+# lines from a Windows .def file.
+sed_uncomment_deffile='/^;/d; /^[ ]*$/d'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+ s/$bs4/&\\
+/g
+ s/^$bs2$dollar/$bs&/
+ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+ s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+ $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+ $opt_verbose && func_echo ${1+"$@"}
+
+ # A bug in bash halts the script if the last line of a function
+ # fails when set -e is in force, so we need another command to
+ # work around that:
+ :
+}
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+ $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+ $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+
+ # bash bug again:
+ :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+ func_error ${1+"$@"}
+ exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+ func_error ${1+"$@"}
+ func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information." ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+ $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+ my_directory_path="$1"
+ my_dir_list=
+
+ if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+ # Protect directory names starting with `-'
+ case $my_directory_path in
+ -*) my_directory_path="./$my_directory_path" ;;
+ esac
+
+ # While some portion of DIR does not yet exist...
+ while test ! -d "$my_directory_path"; do
+ # ...make a list in topmost first order. Use a colon delimited
+ # list incase some portion of path contains whitespace.
+ my_dir_list="$my_directory_path:$my_dir_list"
+
+ # If the last portion added has no slash in it, the list is done
+ case $my_directory_path in */*) ;; *) break ;; esac
+
+ # ...otherwise throw away the child directory and loop
+ my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+ done
+ my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+
+ save_mkdir_p_IFS="$IFS"; IFS=':'
+ for my_dir in $my_dir_list; do
+ IFS="$save_mkdir_p_IFS"
+ # mkdir can fail with a `File exist' error if two processes
+ # try to create one of the directories concurrently. Don't
+ # stop in that case!
+ $MKDIR "$my_dir" 2>/dev/null || :
+ done
+ IFS="$save_mkdir_p_IFS"
+
+ # Bail out if we (or some other process) failed to create a directory.
+ test -d "$my_directory_path" || \
+ func_fatal_error "Failed to create \`$1'"
+ fi
+}
+
+
+# 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 "$opt_dry_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" || \
+ func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+ fi
+
+ $ECHO "$my_tmpdir"
+}
+
+
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+ case $1 in
+ *[\\\`\"\$]*)
+ func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
+ *)
+ func_quote_for_eval_unquoted_result="$1" ;;
+ esac
+
+ case $func_quote_for_eval_unquoted_result in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting, command substitution and and variable
+ # expansion for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+ ;;
+ *)
+ func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+ esac
+}
+
+
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+ case $1 in
+ *[\\\`\"]*)
+ my_arg=`$ECHO "$1" | $SED \
+ -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+ *)
+ my_arg="$1" ;;
+ esac
+
+ case $my_arg in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting and command substitution for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ my_arg="\"$my_arg\""
+ ;;
+ esac
+
+ func_quote_for_expand_result="$my_arg"
+}
+
+
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$my_cmd"
+ my_status=$?
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it. Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+ my_cmd="$1"
+ my_fail_exp="${2-:}"
+
+ ${opt_silent-false} || {
+ func_quote_for_expand "$my_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ if ${opt_dry_run-false}; then :; else
+ eval "$lt_user_locale
+ $my_cmd"
+ my_status=$?
+ eval "$lt_safe_locale"
+ if test "$my_status" -eq 0; then :; else
+ eval "(exit $my_status); $my_fail_exp"
+ fi
+ fi
+}
+
+# func_tr_sh
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result. All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+ case $1 in
+ [0-9]* | *[!a-zA-Z0-9_]*)
+ func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
+ ;;
+ * )
+ func_tr_sh_result=$1
+ ;;
+ esac
+}
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $opt_debug
+
+ $SED -n '/(C)/!b go
+ :more
+ /\./!{
+ N
+ s/\n# / /
+ b more
+ }
+ :go
+ /^# '$PROGRAM' (GNU /,/# warranty; / {
+ s/^# //
+ s/^# *$//
+ s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+ p
+ }' < "$progpath"
+ exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+ $opt_debug
+
+ $SED -n '/^# Usage:/,/^# *.*--help/ {
+ s/^# //
+ s/^# *$//
+ s/\$progname/'$progname'/
+ p
+ }' < "$progpath"
+ echo
+ $ECHO "run \`$progname --help | more' for full usage"
+ exit $?
+}
+
+# func_help [NOEXIT]
+# Echo long help message to standard output and exit,
+# unless 'noexit' is passed as argument.
+func_help ()
+{
+ $opt_debug
+
+ $SED -n '/^# Usage:/,/# Report bugs to/ {
+ :print
+ s/^# //
+ s/^# *$//
+ s*\$progname*'$progname'*
+ s*\$host*'"$host"'*
+ s*\$SHELL*'"$SHELL"'*
+ s*\$LTCC*'"$LTCC"'*
+ s*\$LTCFLAGS*'"$LTCFLAGS"'*
+ s*\$LD*'"$LD"'*
+ s/\$with_gnu_ld/'"$with_gnu_ld"'/
+ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
+ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
+ p
+ d
+ }
+ /^# .* home page:/b print
+ /^# General help using/b print
+ ' < "$progpath"
+ ret=$?
+ if test -z "$1"; then
+ exit $ret
+ fi
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+ $opt_debug
+
+ func_error "missing argument for $1."
+ exit_cmd=exit
+}
+
+
+# func_split_short_opt shortopt
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+func_split_short_opt ()
+{
+ my_sed_short_opt='1s/^\(..\).*$/\1/;q'
+ my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+
+ func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
+ func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
+} # func_split_short_opt may be replaced by extended shell implementation
+
+
+# func_split_long_opt longopt
+# Set func_split_long_opt_name and func_split_long_opt_arg shell
+# variables after splitting LONGOPT at the `=' sign.
+func_split_long_opt ()
+{
+ my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
+ my_sed_long_arg='1s/^--[^=]*=//'
+
+ func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
+ func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
+} # func_split_long_opt may be replaced by extended shell implementation
+
+exit_cmd=:
+
+
+
+
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+nonopt=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+# 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=
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "${1}=\$${1}\${2}"
+} # func_append may be replaced by extended shell implementation
+
+# func_append_quoted var value
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+func_append_quoted ()
+{
+ func_quote_for_eval "${2}"
+ eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
+} # func_append_quoted may be replaced by extended shell implementation
+
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "${@}"`
+} # func_arith may be replaced by extended shell implementation
+
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
+} # func_len may be replaced by extended shell implementation
+
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+} # func_lo2o may be replaced by extended shell implementation
+
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+} # func_xform may be replaced by extended shell implementation
+
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+ func_error ${1+"$@"}
+ func_error "See the $PACKAGE documentation for more information."
+ func_fatal_error "Fatal configuration error."
+}
+
+
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+ re_begincf='^# ### BEGIN LIBTOOL'
+ re_endcf='^# ### END LIBTOOL'
+
+ # Default configuration.
+ $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+ done
+
+ exit $?
+}
+
+# func_features
+# Display the features supported by this script.
+func_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 $?
+}
+
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+ # Global variable:
+ tagname="$1"
+
+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+ sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+ # Validate tagname.
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ func_fatal_error "invalid tag name: $tagname"
+ ;;
+ esac
+
+ # Don't test for the "default" C tag, as we know it's
+ # there but not specially marked.
+ case $tagname in
+ CC) ;;
+ *)
+ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+ taglist="$taglist $tagname"
+
+ # Evaluate the configuration. Be careful to quote the path
+ # and the sed script, to avoid splitting on whitespace, but
+ # also don't use non-portable quotes within backquotes within
+ # quotes we have to do it in 2 steps:
+ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+ eval "$extractedcf"
+ else
+ func_error "ignoring unknown tag $tagname"
+ fi
+ ;;
+ esac
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+ if test "$package_revision" != "$macro_revision"; then
+ if test "$VERSION" != "$macro_version"; then
+ if test -z "$macro_version"; then
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ fi
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+ fi
+
+ exit $EXIT_MISMATCH
+ fi
+}
+
+
+# Shorthand for --mode=foo, only valid as the first argument
+case $1 in
+clean|clea|cle|cl)
+ shift; set dummy --mode clean ${1+"$@"}; shift
+ ;;
+compile|compil|compi|comp|com|co|c)
+ shift; set dummy --mode compile ${1+"$@"}; shift
+ ;;
+execute|execut|execu|exec|exe|ex|e)
+ shift; set dummy --mode execute ${1+"$@"}; shift
+ ;;
+finish|finis|fini|fin|fi|f)
+ shift; set dummy --mode finish ${1+"$@"}; shift
+ ;;
+install|instal|insta|inst|ins|in|i)
+ shift; set dummy --mode install ${1+"$@"}; shift
+ ;;
+link|lin|li|l)
+ shift; set dummy --mode link ${1+"$@"}; shift
+ ;;
+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+ shift; set dummy --mode uninstall ${1+"$@"}; shift
+ ;;
+esac
+
+
+
+# Option defaults:
+opt_debug=:
+opt_dry_run=false
+opt_config=false
+opt_preserve_dup_deps=false
+opt_features=false
+opt_finish=false
+opt_help=false
+opt_help_all=false
+opt_silent=:
+opt_warning=:
+opt_verbose=:
+opt_silent=false
+opt_verbose=false
+
+
+# Parse options once, thoroughly. This comes as soon as possible in the
+# script to make things like `--version' happen as quickly as we can.
+{
+ # this just eases exit handling
+ while test $# -gt 0; do
+ opt="$1"
+ shift
+ case $opt in
+ --debug|-x) opt_debug='set -x'
+ func_echo "enabling shell trace mode"
+ $opt_debug
+ ;;
+ --dry-run|--dryrun|-n)
+ opt_dry_run=:
+ ;;
+ --config)
+ opt_config=:
+func_config
+ ;;
+ --dlopen|-dlopen)
+ optarg="$1"
+ opt_dlopen="${opt_dlopen+$opt_dlopen
+}$optarg"
+ shift
+ ;;
+ --preserve-dup-deps)
+ opt_preserve_dup_deps=:
+ ;;
+ --features)
+ opt_features=:
+func_features
+ ;;
+ --finish)
+ opt_finish=:
+set dummy --mode finish ${1+"$@"}; shift
+ ;;
+ --help)
+ opt_help=:
+ ;;
+ --help-all)
+ opt_help_all=:
+opt_help=': help-all'
+ ;;
+ --mode)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_mode="$optarg"
+case $optarg in
+ # Valid mode arguments:
+ clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+ # Catch anything else as an error
+ *) func_error "invalid argument for $opt"
+ exit_cmd=exit
+ break
+ ;;
+esac
+ shift
+ ;;
+ --no-silent|--no-quiet)
+ opt_silent=false
+func_append preserve_args " $opt"
+ ;;
+ --no-warning|--no-warn)
+ opt_warning=false
+func_append preserve_args " $opt"
+ ;;
+ --no-verbose)
+ opt_verbose=false
+func_append preserve_args " $opt"
+ ;;
+ --silent|--quiet)
+ opt_silent=:
+func_append preserve_args " $opt"
+ opt_verbose=false
+ ;;
+ --verbose|-v)
+ opt_verbose=:
+func_append preserve_args " $opt"
+opt_silent=false
+ ;;
+ --tag)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_tag="$optarg"
+func_append preserve_args " $opt $optarg"
+func_enable_tag "$optarg"
+ shift
+ ;;
+
+ -\?|-h) func_usage ;;
+ --help) func_help ;;
+ --version) func_version ;;
+
+ # Separate optargs to long options:
+ --*=*)
+ func_split_long_opt "$opt"
+ set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ # Separate non-argument short options:
+ -\?*|-h*|-n*|-v*)
+ func_split_short_opt "$opt"
+ set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ --) break ;;
+ -*) func_fatal_help "unrecognized option \`$opt'" ;;
+ *) set dummy "$opt" ${1+"$@"}; shift; break ;;
+ esac
+ done
+
+ # Validate options:
+
+ # save first non-option argument
+ if test "$#" -gt 0; then
+ nonopt="$opt"
+ shift
+ fi
+
+ # preserve --debug
+ test "$opt_debug" = : || func_append preserve_args " --debug"
+
+ case $host in
+ *cygwin* | *mingw* | *pw32* | *cegcc*)
+ # don't eliminate duplications in $postdeps and $predeps
+ opt_duplicate_compiler_generated_deps=:
+ ;;
+ *)
+ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+ ;;
+ esac
+
+ $opt_help || {
+ # Sanity checks first:
+ func_check_version_match
+
+ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ func_fatal_configuration "not configured to build any kind of library"
+ fi
+
+ # Darwin sucks
+ eval std_shrext=\"$shrext_cmds\"
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
+ func_error "unrecognized option \`-dlopen'"
+ $ECHO "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$progname --help --mode=$opt_mode' for more information."
+ }
+
+
+ # Bail if the options were screwed
+ $exit_cmd $EXIT_FAILURE
+}
+
+
+
+
+## ----------- ##
+## Main. ##
+## ----------- ##
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+ test -f "$1" &&
+ $SED -e 4q "$1" 2>/dev/null \
+ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs. To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway. Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+ lalib_p=no
+ if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+ for lalib_p_l in 1 2 3 4
+ do
+ read lalib_p_line
+ case "$lalib_p_line" in
+ \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+ esac
+ done
+ exec 0<&5 5<&-
+ fi
+ test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+ func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+ func_ltwrapper_exec_suffix=
+ case $1 in
+ *.exe) ;;
+ *) func_ltwrapper_exec_suffix=.exe ;;
+ esac
+ $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+ func_dirname_and_basename "$1" "" "."
+ func_stripname '' '.exe' "$func_basename_result"
+ func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+ func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+ $opt_debug
+ save_ifs=$IFS; IFS='~'
+ for cmd in $1; do
+ IFS=$save_ifs
+ eval cmd=\"$cmd\"
+ func_show_eval "$cmd" "${2-:}"
+ done
+ IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE 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.
+func_source ()
+{
+ $opt_debug
+ case $1 in
+ */* | *\\*) . "$1" ;;
+ *) . "./$1" ;;
+ esac
+}
+
+
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot. Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+ func_resolve_sysroot_result=$1
+ case $func_resolve_sysroot_result in
+ =*)
+ func_stripname '=' '' "$func_resolve_sysroot_result"
+ func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+ ;;
+ esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+ case "$lt_sysroot:$1" in
+ ?*:"$lt_sysroot"*)
+ func_stripname "$lt_sysroot" '' "$1"
+ func_replace_sysroot_result="=$func_stripname_result"
+ ;;
+ *)
+ # Including no sysroot.
+ func_replace_sysroot_result=$1
+ ;;
+ esac
+}
+
+# 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 ()
+{
+ $opt_debug
+ if test -n "$available_tags" && test -z "$tagname"; then
+ CC_quoted=
+ for arg in $CC; do
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ 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 "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+ # 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.
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case "$@ " in
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+ # 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
+ func_echo "unable to infer tagged configuration"
+ func_fatal_error "specify a tag with \`--tag'"
+# else
+# func_verbose "using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+ write_libobj=${1}
+ if test "$build_libtool_libs" = yes; then
+ write_lobj=\'${2}\'
+ else
+ write_lobj=none
+ fi
+
+ if test "$build_old_libs" = yes; then
+ write_oldobj=\'${3}\'
+ else
+ write_oldobj=none
+ fi
+
+ $opt_dry_run || {
+ cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+ $MV "${write_libobj}T" "${write_libobj}"
+ }
+}
+
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+ $opt_debug
+ func_convert_core_file_wine_to_w32_result="$1"
+ if test -n "$1"; then
+ # Unfortunately, winepath does not exit with a non-zero error code, so we
+ # are forced to check the contents of stdout. On the other hand, if the
+ # command is not found, the shell will set an exit code of 127 and print
+ # *an error message* to stdout. So we must check for both error code of
+ # zero AND non-empty stdout, which explains the odd construction:
+ func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+ if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+ func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+ $SED -e "$lt_sed_naive_backslashify"`
+ else
+ func_convert_core_file_wine_to_w32_result=
+ fi
+ fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+ $opt_debug
+ # unfortunately, winepath doesn't convert paths, only file names
+ func_convert_core_path_wine_to_w32_result=""
+ if test -n "$1"; then
+ oldIFS=$IFS
+ IFS=:
+ for func_convert_core_path_wine_to_w32_f in $1; do
+ IFS=$oldIFS
+ func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+ if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+ if test -z "$func_convert_core_path_wine_to_w32_result"; then
+ func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+ else
+ func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+ fi
+ fi
+ done
+ IFS=$oldIFS
+ fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+ $opt_debug
+ if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+ func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+ if test "$?" -ne 0; then
+ # on failure, ensure result is empty
+ func_cygpath_result=
+ fi
+ else
+ func_cygpath_result=
+ func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+ fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format. Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+ $opt_debug
+ # awkward: cmd appends spaces to result
+ func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+ $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+ $opt_debug
+ if test -z "$2" && test -n "$1" ; then
+ func_error "Could not determine host file name corresponding to"
+ func_error " \`$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback:
+ func_to_host_file_result="$1"
+ fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+ $opt_debug
+ if test -z "$4" && test -n "$3"; then
+ func_error "Could not determine the host path corresponding to"
+ func_error " \`$3'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback. This is a deliberately simplistic "conversion" and
+ # should not be "improved". See libtool.info.
+ if test "x$1" != "x$2"; then
+ lt_replace_pathsep_chars="s|$1|$2|g"
+ func_to_host_path_result=`echo "$3" |
+ $SED -e "$lt_replace_pathsep_chars"`
+ else
+ func_to_host_path_result="$3"
+ fi
+ fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+ $opt_debug
+ case $4 in
+ $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+ ;;
+ esac
+ case $4 in
+ $2 ) func_append func_to_host_path_result "$3"
+ ;;
+ esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via `$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+ $opt_debug
+ $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result. If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+ $opt_debug
+ case ,$2, in
+ *,"$to_tool_file_cmd",*)
+ func_to_tool_file_result=$1
+ ;;
+ *)
+ $to_tool_file_cmd "$1"
+ func_to_tool_file_result=$func_to_host_file_result
+ ;;
+ esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+ func_to_host_file_result="$1"
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+ # LT_CYGPATH in this case.
+ func_to_host_file_result=`cygpath -m "$1"`
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format. Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_file_wine_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_msys_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+ func_convert_core_file_wine_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via `$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format. If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+# file name conversion function : func_convert_file_X_to_Y ()
+# path conversion function : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same. If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+ $opt_debug
+ if test -z "$to_host_path_cmd"; then
+ func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+ to_host_path_cmd="func_convert_path_${func_stripname_result}"
+ fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+ $opt_debug
+ func_init_to_host_path_cmd
+ $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+ func_to_host_path_result="$1"
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from ARG. MSYS
+ # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+ # and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format. Requires a wine environment and
+# a working winepath. Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from
+ # ARG. msys behavior is inconsistent here, cygpath turns them
+ # into '.;' and ';.', and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+ $opt_debug
+ # 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=
+ pie_flag=
+
+ 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)
+ test -n "$libobj" && \
+ func_fatal_error "you cannot specify \`-o' more than once"
+ arg_mode=target
+ continue
+ ;;
+
+ -pie | -fpie | -fPIE)
+ func_append pie_flag " $arg"
+ continue
+ ;;
+
+ -shared | -static | -prefer-pic | -prefer-non-pic)
+ func_append 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,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ lastarg=
+ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
+ func_append_quoted lastarg "$arg"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$lastarg"
+ lastarg=$func_stripname_result
+
+ # Add the arguments to base_compile.
+ func_append 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.
+ func_append_quoted base_compile "$lastarg"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ func_fatal_error "you must specify an argument for -Xcompile"
+ ;;
+ target)
+ func_fatal_error "you must specify a target with \`-o'"
+ ;;
+ *)
+ # Get the name of the library object.
+ test -z "$libobj" && {
+ func_basename "$srcfile"
+ libobj="$func_basename_result"
+ }
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ case $libobj in
+ *.[cCFSifmso] | \
+ *.ada | *.adb | *.ads | *.asm | \
+ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
+ func_xform "$libobj"
+ libobj=$func_xform_result
+ ;;
+ esac
+
+ case $libobj in
+ *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+ *)
+ func_fatal_error "cannot determine name of library object from \`$libobj'"
+ ;;
+ esac
+
+ func_infer_tag $base_compile
+
+ for arg in $later; do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ continue
+ ;;
+
+ -static)
+ build_libtool_libs=no
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+ esac
+ done
+
+ func_quote_for_eval "$libobj"
+ test "X$libobj" != "X$func_quote_for_eval_result" \
+ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
+ && func_warning "libobj name \`$libobj' may not contain shell special characters."
+ func_dirname_and_basename "$obj" "/" ""
+ objname="$func_basename_result"
+ xdir="$func_dirname_result"
+ lobj=${xdir}$objdir/$objname
+
+ test -z "$base_compile" && \
+ func_fatal_help "you must specify a compilation command"
+
+ # 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
+
+ # On Cygwin there's no "real" PIC flag so we must build both object types
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2* | cegcc*)
+ 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 "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ 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 $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "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."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+ func_append removelist " $output_obj"
+ $ECHO "$srcfile" > "$lockfile"
+ fi
+
+ $opt_dry_run || $RM $removelist
+ func_append removelist " $lockfile"
+ trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+ srcfile=$func_to_tool_file_result
+ func_quote_for_eval "$srcfile"
+ qsrcfile=$func_quote_for_eval_result
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test "$pic_mode" != no; then
+ command="$base_compile $qsrcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $qsrcfile"
+ fi
+
+ func_mkdir_p "$xdir$objdir"
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ func_append command " -o $lobj"
+ fi
+
+ func_show_eval_locale "$command" \
+ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/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."
+
+ $opt_dry_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
+ func_show_eval '$MV "$output_obj" "$lobj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+
+ # Allow error messages only from the first compilation.
+ if test "$suppress_opt" = yes; then
+ suppress_output=' >/dev/null 2>&1'
+ fi
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ if test "$pic_mode" != yes; then
+ # Don't build PIC code
+ command="$base_compile $qsrcfile$pie_flag"
+ else
+ command="$base_compile $qsrcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+ func_append command " -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ func_append command "$suppress_output"
+ func_show_eval_locale "$command" \
+ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/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."
+
+ $opt_dry_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
+ func_show_eval '$MV "$output_obj" "$obj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+ fi
+
+ $opt_dry_run || {
+ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ removelist=$lockfile
+ $RM "$lockfile"
+ fi
+ }
+
+ exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+ test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+ # We need to display help for each of the modes.
+ case $opt_mode in
+ "")
+ # Generic help is extracted from the usage comments
+ # at the start of this file.
+ func_help
+ ;;
+
+ clean)
+ $ECHO \
+"Usage: $progname [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: $progname [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
+ -no-suppress do not suppress compiler output for multiple passes
+ -prefer-pic try to build PIC objects only
+ -prefer-non-pic try to build non-PIC objects only
+ -shared do not build a \`.o' file suitable for static linking
+ -static only build a \`.o' file suitable for static linking
+ -Wc,FLAG pass FLAG directly to the compiler
+
+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: $progname [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: $progname [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: $progname [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 following components of INSTALL-COMMAND are treated specially:
+
+ -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+ link)
+ $ECHO \
+"Usage: $progname [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
+ -bindir BINDIR specify path to binaries directory (for systems where
+ libraries must be found in the PATH setting at runtime)
+ -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
+ -shared only do dynamic linking of libtool libraries
+ -shrext SUFFIX override the standard shared library file extension
+ -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]
+ -weak LIBNAME declare that the target provides the LIBNAME interface
+ -Wc,FLAG
+ -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
+ -Wl,FLAG
+ -Xlinker FLAG pass linker-specific FLAG directly to the linker
+ -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
+
+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: $progname [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."
+ ;;
+
+ *)
+ func_fatal_help "invalid operation mode \`$opt_mode'"
+ ;;
+ esac
+
+ echo
+ $ECHO "Try \`$progname --help' for more information about other modes."
+}
+
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+ if test "$opt_help" = :; then
+ func_mode_help
+ else
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ func_mode_help
+ done
+ } | sed -n '1p; 2,$s/^Usage:/ or: /p'
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ echo
+ func_mode_help
+ done
+ } |
+ sed '1d
+ /^When reporting/,/^Report/{
+ H
+ d
+ }
+ $x
+ /information about other modes/d
+ /more detailed .*MODE/d
+ s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+ fi
+ exit $?
+fi
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+ $opt_debug
+ # The first argument is the command name.
+ cmd="$nonopt"
+ test -z "$cmd" && \
+ func_fatal_help "you must specify a COMMAND"
+
+ # Handle -dlopen flags immediately.
+ for file in $opt_dlopen; do
+ test -f "$file" \
+ || func_fatal_help "\`$file' is not a file"
+
+ dir=
+ case $file in
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+ func_source "$file"
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && \
+ func_warning "\`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+
+ if test -f "$dir/$objdir/$dlname"; then
+ func_append dir "/$objdir"
+ else
+ if test ! -f "$dir/$dlname"; then
+ func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+ fi
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ ;;
+
+ *)
+ func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+ 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
+ -* | *.la | *.lo ) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if func_ltwrapper_script_p "$file"; then
+ func_source "$file"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ elif func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ func_source "$func_ltwrapper_scriptname_result"
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ func_append_quoted args "$file"
+ done
+
+ if test "X$opt_dry_run" = Xfalse; 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 LANGUAGE 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
+ else
+ $lt_unset $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
+}
+
+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+ $opt_debug
+ libs=
+ libdirs=
+ admincmds=
+
+ for opt in "$nonopt" ${1+"$@"}
+ do
+ if test -d "$opt"; then
+ func_append libdirs " $opt"
+
+ elif test -f "$opt"; then
+ if func_lalib_unsafe_p "$opt"; then
+ func_append libs " $opt"
+ else
+ func_warning "\`$opt' is not a valid libtool archive"
+ fi
+
+ else
+ func_fatal_error "invalid argument \`$opt'"
+ fi
+ done
+
+ if test -n "$libs"; then
+ if test -n "$lt_sysroot"; then
+ sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+ sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+ else
+ sysroot_cmd=
+ fi
+
+ # Remove sysroot references
+ if $opt_dry_run; then
+ for lib in $libs; do
+ echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+ done
+ else
+ tmpdir=`func_mktempdir`
+ for lib in $libs; do
+ sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+ > $tmpdir/tmp-la
+ mv -f $tmpdir/tmp-la $lib
+ done
+ ${RM}r "$tmpdir"
+ fi
+ fi
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $opt_dry_run || eval "$cmds" || func_append admincmds "
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ $opt_silent && exit $EXIT_SUCCESS
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ echo "----------------------------------------------------------------------"
+ 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"
+ case $host in
+ solaris2.[6789]|solaris2.1[0-9])
+ echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+ echo "pages."
+ ;;
+ *)
+ echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ ;;
+ esac
+ echo "----------------------------------------------------------------------"
+ fi
+ exit $EXIT_SUCCESS
+}
+
+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+ $opt_debug
+ # 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.
+ case $nonopt in *shtool*) :;; *) false;; esac; then
+ # Aesthetically quote it.
+ func_quote_for_eval "$nonopt"
+ install_prog="$func_quote_for_eval_result "
+ arg=$1
+ shift
+ else
+ install_prog=
+ arg=$nonopt
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ func_quote_for_eval "$arg"
+ func_append install_prog "$func_quote_for_eval_result"
+ install_shared_prog=$install_prog
+ case " $install_prog " in
+ *[\\\ /]cp\ *) install_cp=: ;;
+ *) install_cp=false ;;
+ esac
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ no_mode=:
+ for arg
+ do
+ arg2=
+ if test -n "$dest"; then
+ func_append files " $dest"
+ dest=$arg
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=yes ;;
+ -f)
+ if $install_cp; then :; else
+ prev=$arg
+ fi
+ ;;
+ -g | -m | -o)
+ prev=$arg
+ ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*)
+ ;;
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ if test "x$prev" = x-m && test -n "$install_override_mode"; then
+ arg2=$install_override_mode
+ no_mode=false
+ fi
+ prev=
+ else
+ dest=$arg
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ func_quote_for_eval "$arg"
+ func_append install_prog " $func_quote_for_eval_result"
+ if test -n "$arg2"; then
+ func_quote_for_eval "$arg2"
+ fi
+ func_append install_shared_prog " $func_quote_for_eval_result"
+ done
+
+ test -z "$install_prog" && \
+ func_fatal_help "you must specify an install program"
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prev' option requires an argument"
+
+ if test -n "$install_override_mode" && $no_mode; then
+ if $install_cp; then :; else
+ func_quote_for_eval "$install_override_mode"
+ func_append install_shared_prog " -m $func_quote_for_eval_result"
+ fi
+ fi
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ func_fatal_help "no file or destination specified"
+ else
+ func_fatal_help "you must specify a destination"
+ fi
+ fi
+
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$dest"
+ dest=$func_stripname_result
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ func_dirname_and_basename "$dest" "" "."
+ destdir="$func_dirname_result"
+ destname="$func_basename_result"
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files; shift
+ test "$#" -gt 1 && \
+ func_fatal_help "\`$dest' is not a directory"
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ func_fatal_help "\`$destdir' must be an absolute directory name"
+ ;;
+ 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.
+ func_append staticlibs " $file"
+ ;;
+
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "\`$file' is not a valid libtool archive"
+
+ library_names=
+ old_library=
+ relink_command=
+ func_source "$file"
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append current_libdirs " $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append future_libdirs " $libdir" ;;
+ esac
+ fi
+
+ func_dirname "$file" "/" ""
+ dir="$func_dirname_result"
+ func_append 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 -e "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.
+ test "$inst_prefix_dir" = "$destdir" && \
+ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ else
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+ fi
+
+ func_warning "relinking \`$file'"
+ func_show_eval "$relink_command" \
+ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names; shift
+ if test -n "$1"; then
+ realname="$1"
+ shift
+
+ srcname="$realname"
+ test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+ 'exit $?'
+ tstripme="$stripme"
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $realname in
+ *.dll.a)
+ tstripme=""
+ ;;
+ esac
+ ;;
+ esac
+ if test -n "$tstripme" && test -n "$striplib"; then
+ func_show_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
+ test "$linkname" != "$realname" \
+ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ func_execute_cmds "$postinstall_cmds" 'exit $?'
+ fi
+
+ # Install the pseudo-library for information purposes.
+ func_basename "$file"
+ name="$func_basename_result"
+ instname="$dir/$name"i
+ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && func_append 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
+ func_basename "$file"
+ destfile="$func_basename_result"
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ func_lo2o "$destfile"
+ staticdest=$func_lo2o_result
+ ;;
+ *.$objext)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ func_fatal_help "cannot copy a libtool object to \`$destfile'"
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ test -n "$destfile" && \
+ func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ func_lo2o "$file"
+ staticobj=$func_lo2o_result
+ func_show_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
+ func_basename "$file"
+ destfile="$func_basename_result"
+ 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
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin* | *mingw*)
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ wrapper=$func_ltwrapper_scriptname_result
+ else
+ func_stripname '' '.exe' "$file"
+ wrapper=$func_stripname_result
+ fi
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if func_ltwrapper_script_p "$wrapper"; then
+ notinst_deplibs=
+ relink_command=
+
+ func_source "$wrapper"
+
+ # Check the variables that should have been set.
+ test -z "$generated_by_libtool_version" && \
+ func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+ finalize=yes
+ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ func_source "$lib"
+ fi
+ libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ func_warning "\`$lib' has not been installed in \`$libdir'"
+ finalize=no
+ fi
+ done
+
+ relink_command=
+ func_source "$wrapper"
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ $opt_dry_run || {
+ if test "$finalize" = yes; then
+ tmpdir=`func_mktempdir`
+ func_basename "$file$stripped_ext"
+ file="$func_basename_result"
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $opt_silent || {
+ func_quote_for_expand "$relink_command"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ if eval "$relink_command"; then :
+ else
+ func_error "error: relink \`$file' with the above command before installing it"
+ $opt_dry_run || ${RM}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ func_warning "cannot relink \`$file'"
+ fi
+ }
+ else
+ # Install the binary that we compiled earlier.
+ file=`$ECHO "$file$stripped_ext" | $SED "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)
+ func_stripname '' '.exe' "$destfile"
+ destfile=$func_stripname_result
+ ;;
+ esac
+ ;;
+ esac
+ func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+ $opt_dry_run || if test -n "$outputname"; then
+ ${RM}r "$tmpdir"
+ fi
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ func_basename "$file"
+ name="$func_basename_result"
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+ tool_oldlib=$func_to_tool_file_result
+
+ func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+ if test -n "$stripme" && test -n "$old_striplib"; then
+ func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
+ fi
+
+ # Do each command in the postinstall commands.
+ func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+ done
+
+ test -n "$future_libdirs" && \
+ func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ $opt_dry_run && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+ else
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test "$opt_mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+ $opt_debug
+ my_outputname="$1"
+ my_originator="$2"
+ my_pic_p="${3-no}"
+ my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+ my_dlsyms=
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ my_dlsyms="${my_outputname}S.c"
+ else
+ func_error "not configured to extract global symbols from dlpreopened files"
+ fi
+ fi
+
+ if test -n "$my_dlsyms"; then
+ case $my_dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${my_outputname}.nm"
+
+ func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+ # Parse the name list into a source file.
+ func_verbose "creating $output_objdir/$my_dlsyms"
+
+ $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ func_verbose "generating symbol list for \`$output'"
+
+ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ for progfile in $progfiles; do
+ func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+ func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+ $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $opt_dry_run || {
+ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $opt_dry_run || {
+ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$outputname.exp"
+ $opt_dry_run || {
+ $RM $export_symbols
+ eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ else
+ $opt_dry_run || {
+ eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ fi
+ fi
+
+ for dlprefile in $dlprefiles; do
+ func_verbose "extracting global C symbols from \`$dlprefile'"
+ func_basename "$dlprefile"
+ name="$func_basename_result"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ # if an import library, we need to obtain dlname
+ if func_win32_import_lib_p "$dlprefile"; then
+ func_tr_sh "$dlprefile"
+ eval "curr_lafile=\$libfile_$func_tr_sh_result"
+ dlprefile_dlbasename=""
+ if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+ # Use subshell, to avoid clobbering current variable values
+ dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+ if test -n "$dlprefile_dlname" ; then
+ func_basename "$dlprefile_dlname"
+ dlprefile_dlbasename="$func_basename_result"
+ else
+ # no lafile. user explicitly requested -dlpreopen <import library>.
+ $sharedlib_from_linklib_cmd "$dlprefile"
+ dlprefile_dlbasename=$sharedlib_from_linklib_result
+ fi
+ fi
+ $opt_dry_run || {
+ if test -n "$dlprefile_dlbasename" ; then
+ eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+ else
+ func_warning "Could not compute DLL name from $name"
+ eval '$ECHO ": $name " >> "$nlist"'
+ fi
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+ }
+ else # not an import lib
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ fi
+ ;;
+ *)
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ ;;
+ esac
+ done
+
+ $opt_dry_run || {
+ # 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 >/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/$my_dlsyms"'
+ else
+ echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
+ fi
+
+ echo >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols. */
+typedef struct {
+ const char *name;
+ void *address;
+} lt_dlsymlist;
+extern LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+ { \"$my_originator\", (void *) 0 },"
+
+ case $need_lib_prefix in
+ no)
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ *)
+ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ esac
+ echo >> "$output_objdir/$my_dlsyms" "\
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ } # !$opt_dry_run
+
+ pic_flag_for_symtable=
+ case "$compile_command " in
+ *" -static "*) ;;
+ *)
+ 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*)
+ pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+ *-*-hpux*)
+ pic_flag_for_symtable=" $pic_flag" ;;
+ *)
+ if test "X$my_pic_p" != Xno; then
+ pic_flag_for_symtable=" $pic_flag"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ symtab_cflags=
+ for arg in $LTCFLAGS; do
+ case $arg in
+ -pie | -fpie | -fPIE) ;;
+ *) func_append symtab_cflags " $arg" ;;
+ esac
+ done
+
+ # Now compile the dynamic symbol file.
+ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+ # Clean up the generated files.
+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+ # Transform the symbol file into the correct name.
+ symfileobj="$output_objdir/${my_outputname}S.$objext"
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ if test -f "$output_objdir/$my_outputname.def"; then
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ else
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ fi
+ ;;
+ *)
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ ;;
+ esac
+ ;;
+ *)
+ func_fatal_error "unknown suffix for \`$my_dlsyms'"
+ ;;
+ 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 "$compile_command" | $SED "s% @SYMFILE@%%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
+ fi
+}
+
+# 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.
+# Despite the name, also deal with 64 bit binaries.
+func_win32_libid ()
+{
+ $opt_debug
+ 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
+ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+ $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+ $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_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+ $opt_debug
+ sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+ $opt_debug
+ match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+ $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+ $SED '/^Contents of section '"$match_literal"':/{
+ # Place marker at beginning of archive member dllname section
+ s/.*/====MARK====/
+ p
+ d
+ }
+ # These lines can sometimes be longer than 43 characters, but
+ # are always uninteresting
+ /:[ ]*file format pe[i]\{,1\}-/d
+ /^In archive [^:]*:/d
+ # Ensure marker is printed
+ /^====MARK====/p
+ # Remove all lines with less than 43 characters
+ /^.\{43\}/!d
+ # From remaining lines, remove first 43 characters
+ s/^.\{43\}//' |
+ $SED -n '
+ # Join marker and all lines until next marker into a single line
+ /^====MARK====/ b para
+ H
+ $ b para
+ b
+ :para
+ x
+ s/\n//g
+ # Remove the marker
+ s/^====MARK====//
+ # Remove trailing dots and whitespace
+ s/[\. \t]*$//
+ # Print
+ /./p' |
+ # we now have a list, one entry per line, of the stringified
+ # contents of the appropriate section of all members of the
+ # archive which possess that section. Heuristic: eliminate
+ # all those which have a first or second character that is
+ # a '.' (that is, objdump's representation of an unprintable
+ # character.) This should work for all archives with less than
+ # 0x302f exports -- but will fail for DLLs whose name actually
+ # begins with a literal '.' or a single character followed by
+ # a '.'.
+ #
+ # Of those that remain, print the first one.
+ $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+ test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+ test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+ $opt_debug
+ if func_cygming_gnu_implib_p "$1" ; then
+ # binutils import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+ elif func_cygming_ms_implib_p "$1" ; then
+ # ms-generated import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+ else
+ # unknown
+ sharedlib_from_linklib_result=""
+ fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+ $opt_debug
+ f_ex_an_ar_dir="$1"; shift
+ f_ex_an_ar_oldlib="$1"
+ if test "$lock_old_archive_extraction" = yes; then
+ lockfile=$f_ex_an_ar_oldlib.lock
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ fi
+ func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+ 'stat=$?; rm -f "$lockfile"; exit $stat'
+ if test "$lock_old_archive_extraction" = yes; then
+ $opt_dry_run || rm -f "$lockfile"
+ fi
+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+ fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+ $opt_debug
+ my_gentop="$1"; shift
+ my_oldlibs=${1+"$@"}
+ my_oldobjs=""
+ my_xlib=""
+ my_xabs=""
+ my_xdir=""
+
+ 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
+ func_basename "$my_xlib"
+ my_xlib="$func_basename_result"
+ my_xlib_u=$my_xlib
+ while :; do
+ case " $extracted_archives " in
+ *" $my_xlib_u "*)
+ func_arith $extracted_serial + 1
+ extracted_serial=$func_arith_result
+ 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"
+
+ func_mkdir_p "$my_xdir"
+
+ case $host in
+ *-darwin*)
+ func_verbose "Extracting $my_xabs"
+ # Do not bother doing anything if just a dry run
+ $opt_dry_run || {
+ darwin_orig_dir=`pwd`
+ cd $my_xdir || exit $?
+ darwin_archive=$my_xabs
+ darwin_curdir=`pwd`
+ darwin_base_archive=`basename "$darwin_archive"`
+ darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+ if test -n "$darwin_arches"; then
+ darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+ darwin_arch=
+ func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+ for darwin_arch in $darwin_arches ; do
+ func_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've a bunch of thin objects, gotta fatten them up :)
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+ darwin_file=
+ darwin_files=
+ for darwin_file in $darwin_filelist; do
+ darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+ $LIPO -create -output "$darwin_file" $darwin_files
+ done # $darwin_filelist
+ $RM -rf unfat-$$
+ cd "$darwin_orig_dir"
+ else
+ cd $darwin_orig_dir
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ fi # $darwin_arches
+ } # !$opt_dry_run
+ ;;
+ *)
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ ;;
+ esac
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+ done
+
+ func_extract_archives_result="$my_oldobjs"
+}
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable. Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take. If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory. This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+ func_emit_wrapper_arg1=${1-no}
+
+ $ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# 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.
+sed_quote_subst='$sed_quote_subst'
+
+# Be 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 variables:
+ generated_by_libtool_version='$macro_version'
+ 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
+ file=\"\$0\""
+
+ qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+ $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+ ECHO=\"$qECHO\"
+ fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+ lt_script_arg0=\$0
+ shift
+ for lt_opt
+ do
+ case \"\$lt_opt\" in
+ --lt-debug) lt_option_debug=1 ;;
+ --lt-dump-script)
+ lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+ test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+ lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+ cat \"\$lt_dump_D/\$lt_dump_F\"
+ exit 0
+ ;;
+ --lt-*)
+ \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+
+ # Print the debug banner immediately:
+ if test -n \"\$lt_option_debug\"; then
+ echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+ fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+ lt_dump_args_N=1;
+ for lt_arg
+ do
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+ lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+ done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2* | *-cegcc*)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $ECHO "\
+ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+ exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+ case \" \$* \" in
+ *\\ --lt-*)
+ for lt_wr_arg
+ do
+ case \$lt_wr_arg in
+ --lt-*) ;;
+ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+ esac
+ shift
+ done ;;
+ esac
+ func_exec_program_core \${1+\"\$@\"}
+}
+
+ # Parse options
+ func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$ECHO \"\$file\" | $SED '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 \"\$file\" | $SED '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 \"\$file\" | $SED 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+ done
+
+ # Usually 'no', except on cygwin/mingw when embedded into
+ # the cwrapper.
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+ if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+ # special case for '.'
+ if test \"\$thisdir\" = \".\"; then
+ thisdir=\`pwd\`
+ fi
+ # remove .libs from thisdir
+ case \"\$thisdir\" in
+ *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+ $objdir ) thisdir=. ;;
+ esac
+ fi
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ $ECHO "\
+ 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 "\
+
+ # 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 1
+ fi
+ fi
+
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $RM \"\$progdir/\$program\";
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $RM \"\$progdir/\$file\"
+ fi"
+ else
+ $ECHO "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $ECHO "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # fixup the dll searchpath if we need to.
+ #
+ # Fix the DLL searchpath if we need to. Do this before prepending
+ # to shlibpath, because on Windows, both are PATH and uninstalled
+ # libraries must come first.
+ if test -n "$dllsearchpath"; then
+ $ECHO "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $ECHO "\
+ # 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 \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ $ECHO "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+ func_exec_program \${1+\"\$@\"}
+ 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 1
+ fi
+fi\
+"
+}
+
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+ cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+*/
+EOF
+ cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+# include <io.h>
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/* declarations of non-ANSI functions */
+#if defined(__MINGW32__)
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined(__CYGWIN__)
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined (other platforms) ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined(_MSC_VER)
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+# define S_IXUSR _S_IEXEC
+# ifndef _INTPTR_T_DEFINED
+# define _INTPTR_T_DEFINED
+# define intptr_t int
+# endif
+#elif defined(__MINGW32__)
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+#elif defined(__CYGWIN__)
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined (other platforms) ... */
+#endif
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+/* path handling portability macros */
+#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
+# define FOPEN_WB "wb"
+# 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 */
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#if defined(LT_DEBUGWRAPPER)
+static int lt_debug = 1;
+#else
+static int lt_debug = 0;
+#endif
+
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
+EOF
+
+ cat <<EOF
+volatile const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ func_to_host_path "$temp_rpath"
+ cat <<EOF
+const char * LIB_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * LIB_PATH_VALUE = "";
+EOF
+ fi
+
+ if test -n "$dllsearchpath"; then
+ func_to_host_path "$dllsearchpath:"
+ cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE = "";
+EOF
+ fi
+
+ if test "$fast_install" = yes; then
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+ else
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+ fi
+
+
+ cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX "--lt-"
+
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
+static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int newargc;
+ char *tmp_pathspec;
+ char *actual_cwrapper_path;
+ char *actual_cwrapper_name;
+ char *target_name;
+ char *lt_argv_zero;
+ intptr_t rval = 127;
+
+ int i;
+
+ program_name = (char *) xstrdup (base_name (argv[0]));
+ newargz = XMALLOC (char *, argc + 1);
+
+ /* very simple arg parsing; don't want to rely on getopt
+ * also, copy all non cwrapper options to newargz, except
+ * argz[0], which is handled differently
+ */
+ newargc=0;
+ for (i = 1; i < argc; i++)
+ {
+ if (strcmp (argv[i], dumpscript_opt) == 0)
+ {
+EOF
+ case "$host" in
+ *mingw* | *cygwin* )
+ # make stdout use "unix" line endings
+ echo " setmode(1,_O_BINARY);"
+ ;;
+ esac
+
+ cat <<"EOF"
+ lt_dump_script (stdout);
+ return 0;
+ }
+ if (strcmp (argv[i], debug_opt) == 0)
+ {
+ lt_debug = 1;
+ continue;
+ }
+ if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+ {
+ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+ namespace, but it is not one of the ones we know about and
+ have already dealt with, above (inluding dump-script), then
+ report an error. Otherwise, targets might begin to believe
+ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+ namespace. The first time any user complains about this, we'll
+ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+ or a configure.ac-settable value.
+ */
+ lt_fatal (__FILE__, __LINE__,
+ "unrecognized %s option: '%s'",
+ ltwrapper_option_prefix, argv[i]);
+ }
+ /* otherwise ... */
+ newargz[++newargc] = xstrdup (argv[i]);
+ }
+ newargz[++newargc] = NULL;
+
+EOF
+ cat <<EOF
+ /* The GNU banner must be the first non-error debug message */
+ lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+EOF
+ cat <<"EOF"
+ lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+
+ tmp_pathspec = find_executable (argv[0]);
+ if (tmp_pathspec == NULL)
+ lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (before symlink chase) at: %s\n",
+ tmp_pathspec);
+
+ actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (after symlink chase) at: %s\n",
+ actual_cwrapper_path);
+ XFREE (tmp_pathspec);
+
+ actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+ strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+ /* wrapper name transforms */
+ strendzap (actual_cwrapper_name, ".exe");
+ tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+ XFREE (actual_cwrapper_name);
+ actual_cwrapper_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ /* target_name transforms -- use actual target program name; might have lt- prefix */
+ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+ strendzap (target_name, ".exe");
+ tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+ XFREE (target_name);
+ target_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) libtool target name: %s\n",
+ target_name);
+EOF
+
+ cat <<EOF
+ newargz[0] =
+ XMALLOC (char, (strlen (actual_cwrapper_path) +
+ strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+ strcpy (newargz[0], actual_cwrapper_path);
+ strcat (newargz[0], "$objdir");
+ strcat (newargz[0], "/");
+EOF
+
+ cat <<"EOF"
+ /* stop here, and copy so we don't have to do this twice */
+ tmp_pathspec = xstrdup (newargz[0]);
+
+ /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+ strcat (newargz[0], actual_cwrapper_name);
+
+ /* DO want the lt- prefix here if it exists, so use target_name */
+ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+ XFREE (tmp_pathspec);
+ tmp_pathspec = NULL;
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ {
+ char* p;
+ while ((p = strchr (newargz[0], '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ }
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+ XFREE (target_name);
+ XFREE (actual_cwrapper_path);
+ XFREE (actual_cwrapper_name);
+
+ lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+ lt_setenv ("DUALCASE", "1"); /* for MSK sh */
+ /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
+ be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+ because on Windows, both *_VARNAMEs are PATH but uninstalled
+ libraries must come first. */
+ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+
+ lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+ nonnull (lt_argv_zero));
+ for (i = 0; i < newargc; i++)
+ {
+ lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+ i, nonnull (newargz[i]));
+ }
+
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ /* execv doesn't actually work on mingw as expected on unix */
+ newargz = prepare_spawn (newargz);
+ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+ if (rval == -1)
+ {
+ /* failed to start process */
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) failed to launch target \"%s\": %s\n",
+ lt_argv_zero, nonnull (strerror (errno)));
+ return 127;
+ }
+ return rval;
+EOF
+ ;;
+ *)
+ cat <<"EOF"
+ execv (lt_argv_zero, newargz);
+ return rval; /* =127, but avoids unused variable warning */
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+ void *p = (void *) malloc (num);
+ if (!p)
+ lt_fatal (__FILE__, __LINE__, "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;
+
+ lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if ((stat (path, &st) >= 0)
+ && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+ return 1;
+ else
+ return 0;
+}
+
+int
+make_executable (const char *path)
+{
+ int rval = 0;
+ struct stat st;
+
+ lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if (stat (path, &st) >= 0)
+ {
+ rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+ }
+ return rval;
+}
+
+/* Searches for the full path of the wrapper. Returns
+ newly allocated full path name if found, NULL otherwise
+ Does not chase symlinks, even on platforms that support them.
+*/
+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;
+
+ lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+ nonempty (wrapper));
+
+ 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 (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ 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 (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ 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 *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+ return xstrdup (pathspec);
+#else
+ char buf[LT_PATHMAX];
+ struct stat s;
+ char *tmp_pathspec = xstrdup (pathspec);
+ char *p;
+ int has_symlinks = 0;
+ while (strlen (tmp_pathspec) && !has_symlinks)
+ {
+ lt_debugprintf (__FILE__, __LINE__,
+ "checking path component for symlinks: %s\n",
+ tmp_pathspec);
+ if (lstat (tmp_pathspec, &s) == 0)
+ {
+ if (S_ISLNK (s.st_mode) != 0)
+ {
+ has_symlinks = 1;
+ break;
+ }
+
+ /* search backwards for last DIR_SEPARATOR */
+ p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+ while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ p--;
+ if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ {
+ /* no more DIR_SEPARATORS left */
+ break;
+ }
+ *p = '\0';
+ }
+ else
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "error accessing file \"%s\": %s",
+ tmp_pathspec, nonnull (strerror (errno)));
+ }
+ }
+ XFREE (tmp_pathspec);
+
+ if (!has_symlinks)
+ {
+ return xstrdup (pathspec);
+ }
+
+ tmp_pathspec = realpath (pathspec, buf);
+ if (tmp_pathspec == 0)
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "could not follow symlinks for %s", pathspec);
+ }
+ return xstrdup (tmp_pathspec);
+#endif
+}
+
+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;
+}
+
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+ va_list args;
+ if (lt_debug)
+ {
+ (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+ va_start (args, fmt);
+ (void) vfprintf (stderr, fmt, args);
+ va_end (args);
+ }
+}
+
+static void
+lt_error_core (int exit_status, const char *file,
+ int line, const char *mode,
+ const char *message, va_list ap)
+{
+ fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *file, int line, const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+ va_end (ap);
+}
+
+static const char *
+nonnull (const char *s)
+{
+ return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+ return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_setenv) setting '%s' to '%s'\n",
+ nonnull (name), nonnull (value));
+ {
+#ifdef HAVE_SETENV
+ /* always make a copy, for consistency with !HAVE_SETENV */
+ char *str = xstrdup (value);
+ setenv (name, str, 1);
+#else
+ int len = strlen (name) + 1 + strlen (value) + 1;
+ char *str = XMALLOC (char, len);
+ sprintf (str, "%s=%s", name, value);
+ if (putenv (str) != EXIT_SUCCESS)
+ {
+ XFREE (str);
+ }
+#endif
+ }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+ char *new_value;
+ if (orig_value && *orig_value)
+ {
+ int orig_value_len = strlen (orig_value);
+ int add_len = strlen (add);
+ new_value = XMALLOC (char, add_len + orig_value_len + 1);
+ if (to_end)
+ {
+ strcpy (new_value, orig_value);
+ strcpy (new_value + orig_value_len, add);
+ }
+ else
+ {
+ strcpy (new_value, add);
+ strcpy (new_value + add_len, orig_value);
+ }
+ }
+ else
+ {
+ new_value = xstrdup (add);
+ }
+ return new_value;
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ /* some systems can't cope with a ':'-terminated path #' */
+ int len = strlen (new_value);
+ while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+ {
+ new_value[len-1] = '\0';
+ }
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+EOF
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+ Note that spawn() does not by itself call the command interpreter
+ (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+ ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&v);
+ v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+ }) ? "cmd.exe" : "command.com").
+ Instead it simply concatenates the arguments, separated by ' ', and calls
+ CreateProcess(). We must quote the arguments since Win32 CreateProcess()
+ interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+ special way:
+ - Space and tab are interpreted as delimiters. They are not treated as
+ delimiters if they are surrounded by double quotes: "...".
+ - Unescaped double quotes are removed from the input. Their only effect is
+ that within double quotes, space and tab are treated like normal
+ characters.
+ - Backslashes not followed by double quotes are not special.
+ - But 2*n+1 backslashes followed by a double quote become
+ n backslashes followed by a double quote (n >= 0):
+ \" -> "
+ \\\" -> \"
+ \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+ size_t argc;
+ char **new_argv;
+ size_t i;
+
+ /* Count number of arguments. */
+ for (argc = 0; argv[argc] != NULL; argc++)
+ ;
+
+ /* Allocate new argument vector. */
+ new_argv = XMALLOC (char *, argc + 1);
+
+ /* Put quoted arguments into the new argument vector. */
+ for (i = 0; i < argc; i++)
+ {
+ const char *string = argv[i];
+
+ if (string[0] == '\0')
+ new_argv[i] = xstrdup ("\"\"");
+ else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+ {
+ int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+ size_t length;
+ unsigned int backslashes;
+ const char *s;
+ char *quoted_string;
+ char *p;
+
+ length = 0;
+ backslashes = 0;
+ if (quote_around)
+ length++;
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ length += backslashes + 1;
+ length++;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ length += backslashes + 1;
+
+ quoted_string = XMALLOC (char, length + 1);
+
+ p = quoted_string;
+ backslashes = 0;
+ if (quote_around)
+ *p++ = '"';
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ {
+ unsigned int j;
+ for (j = backslashes + 1; j > 0; j--)
+ *p++ = '\\';
+ }
+ *p++ = c;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ {
+ unsigned int j;
+ for (j = backslashes; j > 0; j--)
+ *p++ = '\\';
+ *p++ = '"';
+ }
+ *p = '\0';
+
+ new_argv[i] = quoted_string;
+ }
+ else
+ new_argv[i] = (char *) string;
+ }
+ new_argv[argc] = NULL;
+
+ return new_argv;
+}
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+ func_emit_wrapper yes |
+ $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/ fputs ("\1", f);/p
+g
+D'
+ cat <<"EOF"
+}
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+ $opt_debug
+ case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+ *import*) : ;;
+ *) false ;;
+ esac
+}
+
+# func_mode_link arg...
+func_mode_link ()
+{
+ $opt_debug
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # which system we are compiling for in order to pass an extra
+ # flag for every libtool invocation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll which has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ libtool_args=$nonopt
+ base_compile="$nonopt $@"
+ compile_command=$nonopt
+ finalize_command=$nonopt
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ old_deplibs=
+ compiler_flags=
+ linker_flags=
+ dllsearchpath=
+ lib_search_path=`pwd`
+ inst_prefix_dir=
+ new_inherited_linker_flags=
+
+ avoid_version=no
+ bindir=
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ ltlibs=
+ module=no
+ no_install=no
+ objs=
+ non_pic_objects=
+ precious_files_regex=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+ weak_libs=
+ single_module="${wl}-single_module"
+ func_infer_tag $base_compile
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case $arg in
+ -shared)
+ test "$build_libtool_libs" != yes && \
+ func_fatal_configuration "can not build a shared library"
+ build_old_libs=no
+ break
+ ;;
+ -all-static | -static | -static-libtool-libs)
+ case $arg in
+ -all-static)
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ func_warning "complete static linking is impossible in this configuration"
+ 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
+ func_quote_for_eval "$arg"
+ qarg=$func_quote_for_eval_unquoted_result
+ func_append libtool_args " $func_quote_for_eval_result"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ output)
+ func_append compile_command " @OUTPUT@"
+ func_append finalize_command " @OUTPUT@"
+ ;;
+ esac
+
+ case $prev in
+ bindir)
+ bindir="$arg"
+ prev=
+ continue
+ ;;
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+ func_append compile_command " @SYMFILE@"
+ func_append 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
+ func_append dlfiles " $arg"
+ else
+ func_append dlprefiles " $arg"
+ fi
+ prev=
+ continue
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols="$arg"
+ test -f "$arg" \
+ || func_fatal_error "symbol file \`$arg' does not exist"
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ framework)
+ case $host in
+ *-*-darwin*)
+ case "$deplibs " in
+ *" $qarg.ltframework "*) ;;
+ *) func_append deplibs " $qarg.ltframework" # this is fixed later
+ ;;
+ esac
+ ;;
+ esac
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat "$save_arg"`
+ do
+# func_append moreargs " $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ 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
+ func_append 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.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append 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
+ func_append 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"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ done
+ else
+ func_fatal_error "link input file \`$arg' does not exist"
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
+ precious_regex)
+ precious_files_regex="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case $arg in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) func_append rpath " $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) func_append xrpath " $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ shrext)
+ shrext_cmds="$arg"
+ prev=
+ continue
+ ;;
+ weak)
+ func_append weak_libs " $arg"
+ prev=
+ continue
+ ;;
+ xcclinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xcompiler)
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xlinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $wl$qarg"
+ prev=
+ func_append compile_command " $wl$qarg"
+ func_append finalize_command " $wl$qarg"
+ 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
+ # See comment for -static flag below, for more details.
+ func_append compile_command " $link_static_flag"
+ func_append finalize_command " $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -bindir)
+ prev=bindir
+ 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
+ func_fatal_error "more than one -exported-symbols argument is not allowed"
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -framework)
+ prev=framework
+ 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*)
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ ;;
+ esac
+ continue
+ ;;
+
+ -L*)
+ func_stripname "-L" '' "$arg"
+ if test -z "$func_stripname_result"; then
+ if test "$#" -gt 0; then
+ func_fatal_error "require no space between \`-L' and \`$1'"
+ else
+ func_fatal_error "need path for \`-L' option"
+ fi
+ fi
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ test -z "$absdir" && \
+ func_fatal_error "cannot determine absolute directory name of \`$dir'"
+ dir="$absdir"
+ ;;
+ esac
+ case "$deplibs " in
+ *" -L$dir "* | *" $arg "*)
+ # Will only happen for absolute or sysroot arguments
+ ;;
+ *)
+ # Preserve sysroot, but never include relative directories
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+ *) func_append deplibs " -L$dir" ;;
+ esac
+ func_append lib_search_path " $dir"
+ ;;
+ esac
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ ::) dllsearchpath=$dir;;
+ *) func_append dllsearchpath ":$dir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append 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* | *-cegcc* | *-*-haiku*)
+ # 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
+ func_append deplibs " System.ltframework"
+ 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
+ func_append deplibs " $arg"
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
+ # classes, name mangling, and exception handling.
+ # Darwin uses the -arch flag to determine output architecture.
+ -model|-arch|-isysroot|--sysroot)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ prev=xcompiler
+ continue
+ ;;
+
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ case "$new_inherited_linker_flags " in
+ *" $arg "*) ;;
+ * ) func_append new_inherited_linker_flags " $arg" ;;
+ esac
+ continue
+ ;;
+
+ -multi_module)
+ single_module="${wl}-multi_module"
+ continue
+ ;;
+
+ -no-fast-install)
+ fast_install=no
+ continue
+ ;;
+
+ -no-install)
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+ # The PATH hackery in wrapper scripts is required on Windows
+ # and Darwin in order for the loader to find any dlls it needs.
+ func_warning "\`-no-install' is ignored for $host"
+ func_warning "assuming \`-no-fast-install' instead"
+ 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*)
+ func_stripname '-R' '' "$arg"
+ dir=$func_stripname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ continue
+ ;;
+
+ -shared)
+ # The effects of -shared are defined in a previous loop.
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ 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
+ ;;
+
+ -weak)
+ prev=weak
+ continue
+ ;;
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ func_append arg " $func_quote_for_eval_result"
+ func_append compiler_flags " $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Wl,*)
+ func_stripname '-Wl,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ func_quote_for_eval "$flag"
+ func_append arg " $wl$func_quote_for_eval_result"
+ func_append compiler_flags " $wl$func_quote_for_eval_result"
+ func_append linker_flags " $func_quote_for_eval_result"
+ done
+ IFS="$save_ifs"
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Xcompiler)
+ prev=xcompiler
+ continue
+ ;;
+
+ -Xlinker)
+ prev=xlinker
+ continue
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
+ # -msg_* for osf cc
+ -msg_*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ # Flags to be passed through unchanged, with rationale:
+ # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
+ # -r[0-9][0-9]* specify processor for the SGI compiler
+ # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+ # +DA*, +DD* enable 64-bit mode for the HP compiler
+ # -q* compiler args for the IBM compiler
+ # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+ # -F/path path to uninstalled frameworks, gcc on darwin
+ # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
+ # @file GCC response files
+ # -tp=* Portland pgcc target processor selection
+ # --sysroot=* for sysroot support
+ # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+ -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ func_append compiler_flags " $arg"
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+
+ *.$objext)
+ # A standard object.
+ func_append objs " $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none &&
+ test "$non_pic_object" = none; then
+ func_fatal_error "cannot find name of object for \`$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ 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
+ func_append 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.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append 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
+ func_append 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"
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir="$func_dirname_result"
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "\`$arg' is not a valid libtool object"
+ fi
+ fi
+ ;;
+
+ *.$libext)
+ # An archive.
+ func_append deplibs " $arg"
+ func_append old_deplibs " $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ func_resolve_sysroot "$arg"
+ if test "$prev" = dlfiles; then
+ # This library was specified with -dlopen.
+ func_append dlfiles " $func_resolve_sysroot_result"
+ prev=
+ elif test "$prev" = dlprefiles; then
+ # The library was specified with -dlpreopen.
+ func_append dlprefiles " $func_resolve_sysroot_result"
+ prev=
+ else
+ func_append deplibs " $func_resolve_sysroot_result"
+ 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.
+ func_quote_for_eval "$arg"
+ arg="$func_quote_for_eval_result"
+ ;;
+ esac # arg
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+ done # argument parsing loop
+
+ test -n "$prev" && \
+ func_fatal_help "the \`$prevarg' option requires an argument"
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ func_basename "$output"
+ outputname="$func_basename_result"
+ libobjs_save="$libobjs"
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'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\"
+
+ func_dirname "$output" "/" ""
+ output_objdir="$func_dirname_result$objdir"
+ func_to_tool_file "$output_objdir/"
+ tool_output_objdir=$func_to_tool_file_result
+ # Create the object directory.
+ func_mkdir_p "$output_objdir"
+
+ # Determine the type of output
+ case $output in
+ "")
+ func_fatal_help "you must specify an output file"
+ ;;
+ *.$libext) linkmode=oldlib ;;
+ *.lo | *.$objext) linkmode=obj ;;
+ *.la) linkmode=lib ;;
+ *) linkmode=prog ;; # Anything else should be a program.
+ 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 $opt_preserve_dup_deps ; then
+ case "$libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append 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 $opt_duplicate_compiler_generated_deps; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+ esac
+ func_append 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
+ notinst_path= # paths that contain not-installed libtool libraries
+
+ case $linkmode in
+ lib)
+ passes="conv dlpreopen link"
+ for file in $dlfiles $dlprefiles; do
+ case $file in
+ *.la) ;;
+ *)
+ func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+ ;;
+ 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
+ # The preopen pass in lib mode reverses $deplibs; put it back here
+ # so that -L comes before libs that need it for instance...
+ if test "$linkmode,$pass" = "lib,link"; then
+ ## FIXME: Find the place where the list is rebuilt in the wrong
+ ## order, and fix it there properly
+ tmp_deplibs=
+ for deplib in $deplibs; do
+ tmp_deplibs="$deplib $tmp_deplibs"
+ done
+ deplibs="$tmp_deplibs"
+ fi
+
+ 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 "$linkmode,$pass" = "lib,dlpreopen"; then
+ # Collect and forward deplibs of preopened libtool libs
+ for lib in $dlprefiles; do
+ # Ignore non-libtool-libs
+ dependency_libs=
+ func_resolve_sysroot "$lib"
+ case $lib in
+ *.la) func_source "$func_resolve_sysroot_result" ;;
+ esac
+
+ # Collect preopened libtool deplibs, except any this library
+ # has declared as weak libs
+ for deplib in $dependency_libs; do
+ func_basename "$deplib"
+ deplib_base=$func_basename_result
+ case " $weak_libs " in
+ *" $deplib_base "*) ;;
+ *) func_append deplibs " $deplib" ;;
+ esac
+ done
+ done
+ libs="$dlprefiles"
+ 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|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append compiler_flags " $deplib"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -l*)
+ if test "$linkmode" != lib && test "$linkmode" != prog; then
+ func_warning "\`-l' is ignored for archives/objects"
+ continue
+ fi
+ func_stripname '-l' '' "$deplib"
+ name=$func_stripname_result
+ if test "$linkmode" = lib; then
+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+ else
+ searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+ fi
+ for searchdir in $searchdirs; 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 func_lalib_p "$lib"; then
+ library_names=
+ old_library=
+ func_source "$lib"
+ 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
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+ 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
+ *.ltframework)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ if test "$linkmode" = lib ; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -L*)
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ 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
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ *)
+ func_warning "\`-L' is ignored for archives/objects"
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+ if test "$pass" = link; then
+ func_stripname '-R' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ lib=$func_resolve_sysroot_result
+ ;;
+ *.$libext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ case $linkmode in
+ lib)
+ # Linking convenience modules into shared libraries is allowed,
+ # but linking other static libraries is non-portable.
+ case " $dlpreconveniencelibs " in
+ *" $deplib "*) ;;
+ *)
+ valid_a_lib=no
+ case $deplibs_check_method in
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ 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 use here."
+ else
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the"
+ $ECHO "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ fi
+ ;;
+ esac
+ 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.
+ func_append newdlprefiles " $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append newdlfiles " $deplib"
+ fi
+ fi
+ continue
+ ;;
+ %DEPLIBS%)
+ alldeplibs=yes
+ continue
+ ;;
+ esac # case $deplib
+
+ if test "$found" = yes || test -f "$lib"; then :
+ else
+ func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+ fi
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$lib" \
+ || func_fatal_error "\`$lib' is not a valid libtool archive"
+
+ func_dirname "$lib" "" "."
+ ladir="$func_dirname_result"
+
+ dlname=
+ dlopen=
+ dlpreopen=
+ libdir=
+ library_names=
+ old_library=
+ inherited_linker_flags=
+ # 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
+ func_source "$lib"
+
+ # Convert "-framework foo" to "foo.ltframework"
+ if test -n "$inherited_linker_flags"; then
+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+ for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+ case " $new_inherited_linker_flags " in
+ *" $tmp_inherited_linker_flag "*) ;;
+ *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+ esac
+ done
+ fi
+ dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+ test -n "$dlopen" && func_append dlfiles " $dlopen"
+ test -n "$dlpreopen" && func_append 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
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+ # It is a libtool convenience library, so add in its objects.
+ func_append convenience " $ladir/$objdir/$old_library"
+ func_append old_convenience " $ladir/$objdir/$old_library"
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ func_fatal_error "\`$lib' is not a convenience library"
+ fi
+ continue
+ fi # $pass = conv
+
+
+ # Get the name of the library we link against.
+ linklib=
+ if test -n "$old_library" &&
+ { test "$prefer_static_libs" = yes ||
+ test "$prefer_static_libs,$installed" = "built,no"; }; then
+ linklib=$old_library
+ else
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+ fi
+ if test -z "$linklib"; then
+ func_fatal_error "cannot find name of link library for \`$lib'"
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$pass" = dlopen; then
+ if test -z "$libdir"; then
+ func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+ 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.
+ func_append dlprefiles " $lib $dependency_libs"
+ else
+ func_append 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
+ func_warning "cannot determine absolute directory name of \`$ladir'"
+ func_warning "passing it literally to the linker, although it might fail"
+ abs_ladir="$ladir"
+ fi
+ ;;
+ esac
+ func_basename "$lib"
+ laname="$func_basename_result"
+
+ # Find the relevant object directory and library name.
+ if test "X$installed" = Xyes; then
+ if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ func_warning "library \`$lib' was moved."
+ dir="$ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+ dir="$lt_sysroot$libdir"
+ absdir="$lt_sysroot$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
+ func_append notinst_path " $abs_ladir"
+ else
+ dir="$ladir/$objdir"
+ absdir="$abs_ladir/$objdir"
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ fi
+ fi # $installed = yes
+ func_stripname 'lib' '.la' "$laname"
+ name=$func_stripname_result
+
+ # This library was specified with -dlpreopen.
+ if test "$pass" = dlpreopen; then
+ if test -z "$libdir" && test "$linkmode" = prog; then
+ func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+ fi
+ case "$host" in
+ # special handling for platforms with PE-DLLs.
+ *cygwin* | *mingw* | *cegcc* )
+ # Linker will automatically link against shared library if both
+ # static and shared are present. Therefore, ensure we extract
+ # symbols from the import library if a shared library is present
+ # (otherwise, the dlopen module name will be incorrect). We do
+ # this by putting the import library name into $newdlprefiles.
+ # We recover the dlopen module name by 'saving' the la file
+ # name in a special purpose variable, and (later) extracting the
+ # dlname from the la file.
+ if test -n "$dlname"; then
+ func_tr_sh "$dir/$linklib"
+ eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+ func_append newdlprefiles " $dir/$linklib"
+ else
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ fi
+ ;;
+ * )
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ func_append newdlprefiles " $dir/$dlname"
+ else
+ func_append newdlprefiles " $dir/$linklib"
+ fi
+ ;;
+ esac
+ 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
+ func_append 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*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ 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 $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append 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
+ *"$absdir:"*) ;;
+ *) func_append 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 "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append 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
+ case $host in
+ *cygwin* | *mingw* | *cegcc*)
+ # No point in relinking DLLs because paths are not encoded
+ func_append notinst_deplibs " $lib"
+ need_relink=no
+ ;;
+ *)
+ if test "$installed" = no; then
+ func_append notinst_deplibs " $lib"
+ need_relink=yes
+ fi
+ ;;
+ esac
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on some
+ # systems (darwin). Don't bleat about dlopened modules though!
+ dlopenmodule=""
+ for dlpremoduletest in $dlprefiles; do
+ if test "X$dlpremoduletest" = "X$lib"; then
+ dlopenmodule="$dlpremoduletest"
+ break
+ fi
+ done
+ if test -z "$dlopenmodule" && 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 "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi
+
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+ set dummy $library_names
+ shift
+ realname="$1"
+ 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
+ x86_64-*mingw32*)
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="6-$major"
+ ;;
+ *cygwin* | mingw* | *cegcc*)
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ ;;
+ esac
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+ func_basename "$soroot"
+ soname="$func_basename_result"
+ func_stripname 'lib' '.dll' "$soname"
+ newlib=libimp-$func_stripname_result.a
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ func_verbose "extracting exported symbol list from \`$soname'"
+ func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+ fi
+
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ func_verbose "generating import library for \`$soname'"
+ func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+ 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 "$opt_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 (non-dlopened) module then we can not
+ # link against it, someone is ignoring the earlier warnings
+ if /usr/bin/file -L $add 2> /dev/null |
+ $GREP ": [^:]* bundle" >/dev/null ; then
+ if test "X$dlopenmodule" != "X$lib"; 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
+ elif test -n "$old_library"; then
+ 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 &&
+ test "$hardcode_direct_absolute" = no; then
+ add="$dir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$absdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ func_append 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
+ func_fatal_configuration "unsupported hardcode properties"
+ fi
+
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+ *) func_append 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:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+ if test "$linkmode" = prog || test "$opt_mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes &&
+ test "$hardcode_direct_absolute" = no; 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:"*) ;;
+ *) func_append 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
+ [\\/]*)
+ func_append 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*) func_stripname '-R' '' "$libdir"
+ temp_xrpath=$func_stripname_result
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) func_append xrpath " $temp_xrpath";;
+ esac;;
+ *) func_append temp_deplibs " $libdir";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ fi
+
+ func_append 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"
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result";;
+ *) func_resolve_sysroot "$deplib" ;;
+ esac
+ if $opt_preserve_dup_deps ; then
+ case "$tmp_libs " in
+ *" $func_resolve_sysroot_result "*)
+ func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+ esac
+ fi
+ func_append tmp_libs " $func_resolve_sysroot_result"
+ done
+
+ if test "$link_all_deplibs" != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ path=
+ case $deplib in
+ -L*) path="$deplib" ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ deplib=$func_resolve_sysroot_result
+ func_dirname "$deplib" "" "."
+ dir=$func_dirname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ func_warning "cannot determine absolute directory name of \`$dir'"
+ absdir="$dir"
+ fi
+ ;;
+ esac
+ if $GREP "^installed=no" $deplib > /dev/null; then
+ case $host in
+ *-*-darwin*)
+ depdepl=
+ 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 "$absdir/$objdir/$depdepl" ; then
+ depdepl="$absdir/$objdir/$depdepl"
+ darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ if test -z "$darwin_install_name"; then
+ darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ fi
+ func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+ func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+ path=
+ fi
+ fi
+ ;;
+ *)
+ path="-L$absdir/$objdir"
+ ;;
+ esac
+ else
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ test "$absdir" != "$libdir" && \
+ func_warning "\`$deplib' seems to be moved"
+
+ path="-L$absdir"
+ fi
+ ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$path $deplibs" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ if test "$pass" = link; then
+ if test "$linkmode" = "prog"; then
+ compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+ finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ fi
+ fi
+ 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 "*) ;;
+ *) func_append 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 "*) ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append 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
+ func_append tmp_libs " $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test "$linkmode" = prog; then
+ dlfiles="$newdlfiles"
+ fi
+ if test "$linkmode" = prog || test "$linkmode" = lib; then
+ dlprefiles="$newdlprefiles"
+ fi
+
+ case $linkmode in
+ oldlib)
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for archives"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for archives" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for archives"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for archives"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for archives"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for archives"
+
+ test -n "$export_symbols$export_symbols_regex" && \
+ func_warning "\`-export-symbols' is ignored for archives"
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+ func_append objs "$old_deplibs"
+ ;;
+
+ lib)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case $outputname in
+ lib*)
+ func_stripname 'lib' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ test "$module" = no && \
+ func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
+ if test "$need_lib_prefix" != no; then
+ # Add the "lib" prefix for modules if required
+ func_stripname '' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ else
+ func_stripname '' '.la' "$outputname"
+ libname=$func_stripname_result
+ fi
+ ;;
+ esac
+
+ if test -n "$objs"; then
+ if test "$deplibs_check_method" != pass_all; then
+ func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+ else
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+ $ECHO "*** objects $objs is not portable!"
+ func_append libobjs " $objs"
+ fi
+ fi
+
+ test "$dlself" != no && \
+ func_warning "\`-dlopen self' is ignored for libtool libraries"
+
+ set dummy $rpath
+ shift
+ test "$#" -gt 1 && \
+ func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+ install_libdir="$1"
+
+ 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
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for convenience libraries"
+ else
+
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ shift
+ IFS="$save_ifs"
+
+ test -n "$7" && \
+ func_fatal_help "too many parameters to \`-version-info'"
+
+ # 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="$1"
+ number_minor="$2"
+ number_revision="$3"
+ #
+ # 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
+ # correct linux to gnu/linux during the next big refactor
+ darwin|linux|osf|windows|none)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|qnx|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+ ;;
+ irix|nonstopux)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age="$number_minor"
+ revision="$number_minor"
+ lt_irix_increment=no
+ ;;
+ *)
+ func_fatal_configuration "$modename: unknown library version type \`$version_type'"
+ ;;
+ esac
+ ;;
+ no)
+ current="$1"
+ revision="$2"
+ age="$3"
+ ;;
+ 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]) ;;
+ *)
+ func_error "CURRENT \`$current' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ 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]) ;;
+ *)
+ func_error "REVISION \`$revision' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ 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]) ;;
+ *)
+ func_error "AGE \`$age' must be a nonnegative integer"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ ;;
+ esac
+
+ if test "$age" -gt "$current"; then
+ func_error "AGE \`$age' is greater than the current interface number \`$current'"
+ func_fatal_error "\`$vinfo' is not valid version information"
+ 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
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ # Darwin ld doesn't like 0 for these options...
+ func_arith $current + 1
+ minor_current=$func_arith_result
+ 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
+ func_arith $current - $age
+ else
+ func_arith $current - $age + 1
+ fi
+ major=$func_arith_result
+
+ 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
+ func_arith $revision - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring_prefix$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+ major=.$major
+ versuffix="$major.$revision"
+ ;;
+
+ linux) # correct to gnu/linux during the next big refactor
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ func_arith $current - $age
+ major=.$func_arith_result
+ 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
+ func_arith $current - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ func_append verstring ":${current}.0"
+ ;;
+
+ qnx)
+ major=".$current"
+ versuffix=".$current"
+ ;;
+
+ sunos)
+ major=".$current"
+ versuffix=".$current.$revision"
+ ;;
+
+ windows)
+ # Use '-' rather than '.', since we only want one
+ # extension on DOS 8.3 filesystems.
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix="-$major"
+ case $host in
+ x86_64-*mingw32*)
+ versuffix="6-$major"
+ ;;
+ *)
+ versuffix="-$major"
+ ;;
+ esac
+ ;;
+
+ *)
+ func_fatal_configuration "unknown library version type \`$version_type'"
+ ;;
+ 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
+ func_warning "undefined symbols not allowed in $host shared libraries"
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+
+ fi
+
+ func_generate_dlsyms "$libname" "$libname" "yes"
+ func_append libobjs " $symfileobj"
+ test "X$libobjs" = "X " && libobjs=
+
+ if test "$opt_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 | *.gcno)
+ ;;
+ $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
+ func_append removelist " $p"
+ ;;
+ *) ;;
+ esac
+ done
+ test -n "$removelist" && \
+ func_show_eval "${RM}r \$removelist"
+ fi
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ func_append oldlibs " $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+ fi
+
+ # Eliminate all temporary directories.
+ #for path in $notinst_path; do
+ # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+ # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+ # dependency_libs=`$ECHO "$dependency_libs " | $SED "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
+ func_replace_sysroot "$libdir"
+ func_append temp_xrpath " -R$func_replace_sysroot_result"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append 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 "*) ;;
+ *) func_append 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 "*) ;;
+ *) func_append dlprefiles " $lib" ;;
+ esac
+ done
+
+ if test "$build_libtool_libs" = yes; then
+ if test -n "$rpath"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+ func_append deplibs " System.ltframework"
+ ;;
+ *-*-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
+ func_append 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.
+ $opt_dry_run || $RM conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ 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 I believe you do not have"
+ echo "*** because a test_compile did reveal that the linker did not use it for"
+ echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+ ldd_output=`ldd conftest`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ 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 a test_compile did reveal that the linker did not use this one"
+ echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ fi
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
+ echo "*** make it link in! You will probably need to install it or some"
+ echo "*** library that it depends on before this library will be fully"
+ echo "*** functional. Installing it before continuing would be even better."
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method; shift
+ file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ if test -n "$file_magic_glob"; then
+ libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+ else
+ libnameglob=$libname
+ fi
+ test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ if test "$want_nocaseglob" = yes; then
+ shopt -s nocaseglob
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ $nocaseglob
+ else
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ fi
+ 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 "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+ $SED -e 10q |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ func_append 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
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append 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
+ func_append 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
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=""
+ tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; 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 " $tmp_deplibs" | $SED "s,$i,,"`
+ done
+ fi
+ case $tmp_deplibs in
+ *[!\ \ ]*)
+ 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
+ ;;
+ esac
+ ;;
+ 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 with the System framework
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ 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
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ case $host in
+ *-*-darwin*)
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ 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 " $deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append 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
+ # Remove ${wl} instances when linking with ld.
+ # FIXME: should test the right _cmds variable.
+ case $archive_cmds in
+ *\$LD\ *) wl= ;;
+ esac
+ if test "$hardcode_into_libs" = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+ rpath="$finalize_rpath"
+ test "$opt_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
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
+ 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"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append dep_rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append 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 "dep_rpath=\"$hardcode_libdir_flag_spec\""
+ fi
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ func_append 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 "$opt_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
+ shift
+ realname="$1"
+ 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
+ func_append linknames " $link"
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ test "X$libobjs" = "X " && libobjs=
+
+ delfiles=
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+ export_symbols="$output_objdir/$libname.uexp"
+ func_append delfiles " $export_symbols"
+ fi
+
+ orig_export_symbols=
+ case $host_os in
+ cygwin* | mingw* | cegcc*)
+ if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+ # exporting using user supplied symfile
+ if test "x`$SED "$sed_uncomment_deffile" $export_symbols | $SED 1q`" != xEXPORTS; then
+ # and it's NOT already a .def file. Must figure out
+ # which of the given symbols are data symbols and tag
+ # them as such. So, trigger use of export_symbols_cmds.
+ # export_symbols gets reassigned inside the "prepare
+ # the list of exported symbols" if statement, so the
+ # include_expsyms logic still works.
+ orig_export_symbols="$export_symbols"
+ export_symbols=
+ always_export_symbols=yes
+ fi
+ fi
+ ;;
+ esac
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ cmds=$export_symbols_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd1 in $cmds; do
+ IFS="$save_ifs"
+ # Take the normal branch if the nm_file_list_spec branch
+ # doesn't work or if tool conversion is not needed.
+ case $nm_file_list_spec~$to_tool_file_cmd in
+ *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+ try_normal_branch=yes
+ eval cmd=\"$cmd1\"
+ func_len " $cmd"
+ len=$func_len_result
+ ;;
+ *)
+ try_normal_branch=no
+ ;;
+ esac
+ if test "$try_normal_branch" = yes \
+ && { test "$len" -lt "$max_cmd_len" \
+ || test "$max_cmd_len" -le -1; }
+ then
+ func_show_eval "$cmd" 'exit $?'
+ skipped_export=false
+ elif test -n "$nm_file_list_spec"; then
+ func_basename "$output"
+ output_la=$func_basename_result
+ save_libobjs=$libobjs
+ save_output=$output
+ output=${output_objdir}/${output_la}.nm
+ func_to_tool_file "$output"
+ libobjs=$nm_file_list_spec$func_to_tool_file_result
+ func_append delfiles " $output"
+ func_verbose "creating $NM input file list: $output"
+ for obj in $save_libobjs; do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > "$output"
+ eval cmd=\"$cmd1\"
+ func_show_eval "$cmd" 'exit $?'
+ output=$save_output
+ libobjs=$save_libobjs
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ func_verbose "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" && test "X$skipped_export" != "X:"; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ func_append tmp_deplibs " $test_deplib"
+ ;;
+ esac
+ done
+ deplibs="$tmp_deplibs"
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec" &&
+ test "$compiler_needs_object" = yes &&
+ test -z "$libobjs"; then
+ # extract the archives, so we have objects to list.
+ # TODO: could optimize this to just extract one archive.
+ whole_archive_flag_spec=
+ fi
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ else
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ func_append linker_flags " $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+ if test "$opt_mode" = relink; then
+ $opt_dry_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:" &&
+ func_len " $test_cmds" &&
+ len=$func_len_result &&
+ test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise
+ # or, if using GNU ld and skipped_export is not :, use a linker
+ # script.
+
+ # 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
+ func_basename "$output"
+ output_la=$func_basename_result
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ last_robj=
+ k=1
+
+ if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+ output=${output_objdir}/${output_la}.lnkscript
+ func_verbose "creating GNU ld script: $output"
+ echo 'INPUT (' > $output
+ for obj in $save_libobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ echo ')' >> $output
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$func_to_tool_file_result
+ elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+ output=${output_objdir}/${output_la}.lnk
+ func_verbose "creating linker input file list: $output"
+ : > $output
+ set x $save_libobjs
+ shift
+ firstobj=
+ if test "$compiler_needs_object" = yes; then
+ firstobj="$1 "
+ shift
+ fi
+ for obj
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+ else
+ if test -n "$save_libobjs"; then
+ func_verbose "creating reloadable object files..."
+ output=$output_objdir/$output_la-${k}.$objext
+ eval test_cmds=\"$reload_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ if test "X$objlist" = X ||
+ test "$len" -lt "$max_cmd_len"; then
+ func_append 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.
+ reload_objs=$objlist
+ eval concat_cmds=\"$reload_cmds\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+ fi
+ last_robj=$output_objdir/$output_la-${k}.$objext
+ func_arith $k + 1
+ k=$func_arith_result
+ output=$output_objdir/$output_la-${k}.$objext
+ objlist=" $obj"
+ func_len " $last_robj"
+ func_arith $len0 + $func_len_result
+ len=$func_arith_result
+ 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~
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+ fi
+ func_append delfiles " $output"
+
+ else
+ output=
+ fi
+
+ if ${skipped_export-false}; then
+ func_verbose "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $opt_dry_run || $RM $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ fi
+ fi
+
+ test -n "$save_libobjs" &&
+ func_verbose "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"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+
+ if ${skipped_export-false}; then
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols="$export_symbols"
+ test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+ fi
+
+ 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\"
+ test "X$libobjs" = "X " && libobjs=
+ 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
+ fi
+
+ if test -n "$delfiles"; then
+ # Append the command to remove temporary files to $cmds.
+ eval cmds=\"\$cmds~\$RM $delfiles\"
+ fi
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $opt_silent || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$opt_mode" = relink; then
+ ( 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 "$opt_mode" = relink; then
+ $opt_dry_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
+ func_show_eval '${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
+ func_show_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 "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ func_warning "\`-dlopen' is ignored for objects"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "\`-l' and \`-L' are ignored for objects" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "\`-rpath' is ignored for objects"
+
+ test -n "$xrpath" && \
+ func_warning "\`-R' is ignored for objects"
+
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for objects"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for objects"
+
+ case $output in
+ *.lo)
+ test -n "$objs$old_deplibs" && \
+ func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+ libobj=$output
+ func_lo2o "$libobj"
+ obj=$func_lo2o_result
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $opt_dry_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 "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+ else
+ gentop="$output_objdir/${obj}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ reload_conv_objs="$reload_objs $func_extract_archives_result"
+ fi
+ fi
+
+ # If we're not building shared, we need to use non_pic_objs
+ test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+
+ # Create the old-style object.
+ reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+ output="$obj"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ func_show_eval '${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"
+ # $opt_dry_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"
+ func_execute_cmds "$reload_cmds" 'exit $?'
+ fi
+
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ prog)
+ case $host in
+ *cygwin*) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result.exe;;
+ esac
+ test -n "$vinfo" && \
+ func_warning "\`-version-info' is ignored for programs"
+
+ test -n "$release" && \
+ func_warning "\`-release' is ignored for programs"
+
+ test "$preload" = yes \
+ && test "$dlopen_support" = unknown \
+ && test "$dlopen_self" = unknown \
+ && test "$dlopen_self_static" = unknown && \
+ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ case $host in
+ *-*-darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ # But is supposedly fixed on 10.4 or later (yay!).
+ if test "$tagname" = CXX ; then
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+ 10.[0123])
+ func_append compile_command " ${wl}-bind_at_load"
+ func_append finalize_command " ${wl}-bind_at_load"
+ ;;
+ esac
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ 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 "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $compile_deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ compile_deplibs="$new_libs"
+
+
+ func_append compile_command " $compile_deplibs"
+ func_append 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 "*) ;;
+ *) func_append 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"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append perm_rpath " $libdir" ;;
+ esac
+ fi
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ ::) dllsearchpath=$libdir;;
+ *) func_append dllsearchpath ":$libdir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append 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"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append 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 "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ fi
+
+ func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+
+ # template prelinking step
+ if test -n "$prelink_cmds"; then
+ func_execute_cmds "$prelink_cmds" 'exit $?'
+ fi
+
+ wrappers_required=yes
+ case $host in
+ *cegcc* | *mingw32ce*)
+ # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+ wrappers_required=no
+ ;;
+ *cygwin* | *mingw* )
+ if test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ *)
+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+ wrappers_required=no
+ fi
+ ;;
+ esac
+ if test "$wrappers_required" = no; then
+ # Replace the output file specification.
+ compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ exit_status=0
+ func_show_eval "$link_command" 'exit_status=$?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Delete the generated files.
+ if test -f "$output_objdir/${outputname}S.${objext}"; then
+ func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+ fi
+
+ exit $exit_status
+ 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
+ func_append 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
+ func_append 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 "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ # Delete the old output file.
+ $opt_dry_run || $RM $output
+ # Link the executable and exit
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ 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"
+
+ func_warning "this platform does not like uninstalled shared libraries"
+ func_warning "\`$output' will be relinked during installation"
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+ 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 "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output_objdir/$outputname"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Now create the wrapper script.
+ func_verbose "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}\" || $lt_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
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if not in dry run mode.
+ $opt_dry_run || {
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+ *cygwin*)
+ exeext=.exe
+ func_stripname '' '.exe' "$outputname"
+ outputname=$func_stripname_result ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ func_dirname_and_basename "$output" "" "."
+ output_name=$func_basename_result
+ output_path=$func_dirname_result
+ 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
+
+ func_emit_cwrapperexe_src > $cwrappersource
+
+ # The wrapper executable is built using the $host compiler,
+ # because it contains $host paths and files. If cross-
+ # compiling, it, like the target executable, must be
+ # executed on the $host or under an emulation environment.
+ $opt_dry_run || {
+ $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+ $STRIP $cwrapper
+ }
+
+ # Now, create the wrapper script for func_source use:
+ func_ltwrapper_scriptname $cwrapper
+ $RM $func_ltwrapper_scriptname_result
+ trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+ $opt_dry_run || {
+ # note: this script will not be executed, so do not chmod.
+ if test "x$build" = "x$host" ; then
+ $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+ else
+ func_emit_wrapper no > $func_ltwrapper_scriptname_result
+ fi
+ }
+ ;;
+ * )
+ $RM $output
+ trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_wrapper no > $output
+ chmod +x $output
+ ;;
+ esac
+ }
+ 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 $symfileobj"
+ 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"
+ if test "$preload" = yes && test -f "$symfileobj"; then
+ func_append oldobjs " $symfileobj"
+ fi
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $addlibs
+ func_append 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
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # 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
+ func_basename "$obj"
+ $ECHO "$func_basename_result"
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ echo "copying selected object files to avoid basename conflicts..."
+ gentop="$output_objdir/${outputname}x"
+ func_append generated " $gentop"
+ func_mkdir_p "$gentop"
+ save_oldobjs=$oldobjs
+ oldobjs=
+ counter=1
+ for obj in $save_oldobjs
+ do
+ func_basename "$obj"
+ objbase="$func_basename_result"
+ case " $oldobjs " in
+ " ") oldobjs=$obj ;;
+ *[\ /]"$objbase "*)
+ while :; do
+ # Make sure we don't pick an alternate name that also
+ # overlaps.
+ newobj=lt$counter-$objbase
+ func_arith $counter + 1
+ counter=$func_arith_result
+ case " $oldobjs " in
+ *[\ /]"$newobj "*) ;;
+ *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+ esac
+ done
+ func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+ func_append oldobjs " $gentop/$newobj"
+ ;;
+ *) func_append oldobjs " $obj" ;;
+ esac
+ done
+ fi
+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+ tool_oldlib=$func_to_tool_file_result
+ eval cmds=\"$old_archive_cmds\"
+
+ func_len " $cmds"
+ len=$func_len_result
+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ cmds=$old_archive_cmds
+ elif test -n "$archiver_list_spec"; then
+ func_verbose "using command file archive linking..."
+ for obj in $oldobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > $output_objdir/$libname.libcmd
+ func_to_tool_file "$output_objdir/$libname.libcmd"
+ oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+ cmds=$old_archive_cmds
+ else
+ # the command line is too long to link in one step, link in parts
+ func_verbose "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$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
+ eval test_cmds=\"$old_archive_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+ for obj in $save_oldobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ func_append objlist " $obj"
+ if test "$len" -lt "$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=
+ len=$len0
+ 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
+ func_execute_cmds "$cmds" 'exit $?'
+ done
+
+ test -n "$generated" && \
+ func_show_eval "${RM}r$generated"
+
+ # Now create the libtool archive.
+ case $output in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ func_verbose "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}\" || $lt_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
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; 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 "$relink_command" | $SED "$sed_quote_subst"`
+ if test "$hardcode_automatic" = yes ; then
+ relink_command=
+ fi
+
+ # Only create the output if not a dry run.
+ $opt_dry_run || {
+ 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)
+ func_basename "$deplib"
+ name="$func_basename_result"
+ func_resolve_sysroot "$deplib"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+ test -z "$libdir" && \
+ func_fatal_error "\`$deplib' is not a valid libtool archive"
+ func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ -L*)
+ func_stripname -L '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -L$func_replace_sysroot_result"
+ ;;
+ -R*)
+ func_stripname -R '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -R$func_replace_sysroot_result"
+ ;;
+ *) func_append newdependency_libs " $deplib" ;;
+ esac
+ done
+ dependency_libs="$newdependency_libs"
+ newdlfiles=
+
+ for lib in $dlfiles; do
+ case $lib in
+ *.la)
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ *) func_append newdlfiles " $lib" ;;
+ esac
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ *.la)
+ # Only pass preopened files to the pseudo-archive (for
+ # eventual linking with the app. that links it) if we
+ # didn't already link the preopened objects directly into
+ # the library:
+ func_basename "$lib"
+ name="$func_basename_result"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "\`$lib' is not a valid libtool archive"
+ func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ esac
+ done
+ dlprefiles="$newdlprefiles"
+ else
+ newdlfiles=
+ for lib in $dlfiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlfiles " $abs"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlprefiles " $abs"
+ done
+ dlprefiles="$newdlprefiles"
+ fi
+ $RM $output
+ # place dlname in correct position for cygwin
+ # In fact, it would be nice if we could use this code for all target
+ # systems that can't hard-code library paths into their executables
+ # and that have no shared library path variable independent of PATH,
+ # but it turns out we can't easily determine that from inspecting
+ # libtool variables, so we have to hard-code the OSs to which it
+ # applies here; at the moment, that means platforms that use the PE
+ # object format with DLL files. See the long comment at the top of
+ # tests/bindir.at for full details.
+ tdlname=$dlname
+ case $host,$output,$installed,$module,$dlname in
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+ # If a -bindir argument was supplied, place the dll there.
+ if test "x$bindir" != x ;
+ then
+ func_relative_path "$install_libdir" "$bindir"
+ tdlname=$func_relative_path_result$dlname
+ else
+ # Otherwise fall back on heuristic.
+ tdlname=../bin/$dlname
+ fi
+ ;;
+ esac
+ $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# 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'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_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
+ }
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+ ;;
+ esac
+ exit $EXIT_SUCCESS
+}
+
+{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
+ func_mode_link ${1+"$@"}
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+ $opt_debug
+ 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) func_append RM " $arg"; rmforce=yes ;;
+ -*) func_append RM " $arg" ;;
+ *) func_append files " $arg" ;;
+ esac
+ done
+
+ test -z "$RM" && \
+ func_fatal_help "you must specify an RM program"
+
+ rmdirs=
+
+ for file in $files; do
+ func_dirname "$file" "" "."
+ dir="$func_dirname_result"
+ if test "X$dir" = X.; then
+ odir="$objdir"
+ else
+ odir="$dir/$objdir"
+ fi
+ func_basename "$file"
+ name="$func_basename_result"
+ test "$opt_mode" = uninstall && odir="$dir"
+
+ # Remember odir for removal later, being careful to avoid duplicates
+ if test "$opt_mode" = clean; then
+ case " $rmdirs " in
+ *" $odir "*) ;;
+ *) func_append rmdirs " $odir" ;;
+ 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 func_lalib_p "$file"; then
+ func_source $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ func_append rmfiles " $odir/$n"
+ done
+ test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+
+ case "$opt_mode" in
+ clean)
+ case " $library_names " in
+ *" $dlname "*) ;;
+ *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
+ esac
+ test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
+ ;;
+ uninstall)
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ ;;
+ esac
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if func_lalib_p "$file"; then
+
+ # Read the .lo file
+ func_source $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" &&
+ test "$pic_object" != none; then
+ func_append 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
+ func_append rmfiles " $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test "$opt_mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ func_stripname '' '.exe' "$name"
+ noexename=$func_stripname_result
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ func_append rmfiles " $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if func_ltwrapper_p "$file"; then
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ relink_command=
+ func_source $func_ltwrapper_scriptname_result
+ func_append rmfiles " $func_ltwrapper_scriptname_result"
+ else
+ relink_command=
+ func_source $dir/$noexename
+ fi
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+ func_append rmfiles " $odir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+ func_append rmfiles " $odir/lt-${noexename}.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ func_show_eval "$RM $rmfiles" 'exit_status=1'
+ done
+
+ # Try to remove the ${objdir}s in the directories where we deleted files
+ for dir in $rmdirs; do
+ if test -d "$dir"; then
+ func_show_eval "rmdir $dir >/dev/null 2>&1"
+ fi
+ done
+
+ exit $exit_status
+}
+
+{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
+ func_mode_uninstall ${1+"$@"}
+
+test -z "$opt_mode" && {
+ help="$generic_help"
+ func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+ func_fatal_help "invalid operation mode \`$opt_mode'"
+
+if test -n "$exec_cmd"; then
+ eval exec "$exec_cmd"
+ exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# 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
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# vi:sw=2
diff --git a/build-aux/mdate-sh b/build-aux/mdate-sh
new file mode 100755
index 0000000..39f48bb
--- /dev/null
+++ b/build-aux/mdate-sh
@@ -0,0 +1,224 @@
+#!/bin/sh
+# Get modification time of a file or directory and pretty-print it.
+
+scriptversion=2010-08-21.06; # UTC
+
+# Copyright (C) 1995-2013 Free Software Foundation, Inc.
+# written by Ulrich Drepper <[email protected]>, June 1995
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <[email protected]> or send patches to
+
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+fi
+
+case $1 in
+ '')
+ echo "$0: No file. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: mdate-sh [--help] [--version] FILE
+
+Pretty-print the modification day of FILE, in the format:
+1 January 1970
+
+Report bugs to <[email protected]>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "mdate-sh $scriptversion"
+ exit $?
+ ;;
+esac
+
+error ()
+{
+ echo "$0: $1" >&2
+ exit 1
+}
+
+
+# Prevent date giving response in another language.
+LANG=C
+export LANG
+LC_ALL=C
+export LC_ALL
+LC_TIME=C
+export LC_TIME
+
+# GNU ls changes its time format in response to the TIME_STYLE
+# variable. Since we cannot assume 'unset' works, revert this
+# variable to its documented default.
+if test "${TIME_STYLE+set}" = set; then
+ TIME_STYLE=posix-long-iso
+ export TIME_STYLE
+fi
+
+save_arg1=$1
+
+# Find out how to get the extended ls output of a file or directory.
+if ls -L /dev/null 1>/dev/null 2>&1; then
+ ls_command='ls -L -l -d'
+else
+ ls_command='ls -l -d'
+fi
+# Avoid user/group names that might have spaces, when possible.
+if ls -n /dev/null 1>/dev/null 2>&1; then
+ ls_command="$ls_command -n"
+fi
+
+# A 'ls -l' line looks as follows on OS/2.
+# drwxrwx--- 0 Aug 11 2001 foo
+# This differs from Unix, which adds ownership information.
+# drwxrwx--- 2 root root 4096 Aug 11 2001 foo
+#
+# To find the date, we split the line on spaces and iterate on words
+# until we find a month. This cannot work with files whose owner is a
+# user named "Jan", or "Feb", etc. However, it's unlikely that '/'
+# will be owned by a user whose name is a month. So we first look at
+# the extended ls output of the root directory to decide how many
+# words should be skipped to get the date.
+
+# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
+set x`$ls_command /`
+
+# Find which argument is the month.
+month=
+command=
+until test $month
+do
+ test $# -gt 0 || error "failed parsing '$ls_command /' output"
+ shift
+ # Add another shift to the command.
+ command="$command shift;"
+ case $1 in
+ Jan) month=January; nummonth=1;;
+ Feb) month=February; nummonth=2;;
+ Mar) month=March; nummonth=3;;
+ Apr) month=April; nummonth=4;;
+ May) month=May; nummonth=5;;
+ Jun) month=June; nummonth=6;;
+ Jul) month=July; nummonth=7;;
+ Aug) month=August; nummonth=8;;
+ Sep) month=September; nummonth=9;;
+ Oct) month=October; nummonth=10;;
+ Nov) month=November; nummonth=11;;
+ Dec) month=December; nummonth=12;;
+ esac
+done
+
+test -n "$month" || error "failed parsing '$ls_command /' output"
+
+# Get the extended ls output of the file or directory.
+set dummy x`eval "$ls_command \"\\\$save_arg1\""`
+
+# Remove all preceding arguments
+eval $command
+
+# Because of the dummy argument above, month is in $2.
+#
+# On a POSIX system, we should have
+#
+# $# = 5
+# $1 = file size
+# $2 = month
+# $3 = day
+# $4 = year or time
+# $5 = filename
+#
+# On Darwin 7.7.0 and 7.6.0, we have
+#
+# $# = 4
+# $1 = day
+# $2 = month
+# $3 = year or time
+# $4 = filename
+
+# Get the month.
+case $2 in
+ Jan) month=January; nummonth=1;;
+ Feb) month=February; nummonth=2;;
+ Mar) month=March; nummonth=3;;
+ Apr) month=April; nummonth=4;;
+ May) month=May; nummonth=5;;
+ Jun) month=June; nummonth=6;;
+ Jul) month=July; nummonth=7;;
+ Aug) month=August; nummonth=8;;
+ Sep) month=September; nummonth=9;;
+ Oct) month=October; nummonth=10;;
+ Nov) month=November; nummonth=11;;
+ Dec) month=December; nummonth=12;;
+esac
+
+case $3 in
+ ???*) day=$1;;
+ *) day=$3; shift;;
+esac
+
+# Here we have to deal with the problem that the ls output gives either
+# the time of day or the year.
+case $3 in
+ *:*) set `date`; eval year=\$$#
+ case $2 in
+ Jan) nummonthtod=1;;
+ Feb) nummonthtod=2;;
+ Mar) nummonthtod=3;;
+ Apr) nummonthtod=4;;
+ May) nummonthtod=5;;
+ Jun) nummonthtod=6;;
+ Jul) nummonthtod=7;;
+ Aug) nummonthtod=8;;
+ Sep) nummonthtod=9;;
+ Oct) nummonthtod=10;;
+ Nov) nummonthtod=11;;
+ Dec) nummonthtod=12;;
+ esac
+ # For the first six month of the year the time notation can also
+ # be used for files modified in the last year.
+ if (expr $nummonth \> $nummonthtod) > /dev/null;
+ then
+ year=`expr $year - 1`
+ fi;;
+ *) year=$3;;
+esac
+
+# The result.
+echo $day $month $year
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/missing b/build-aux/missing
new file mode 100755
index 0000000..295de3f
--- /dev/null
+++ b/build-aux/missing
@@ -0,0 +1,215 @@
+#! /bin/sh
+# Common wrapper for a few potentially missing GNU programs.
+
+scriptversion=2013-10-28.13; # UTC
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Originally written by Fran,cois Pinard <[email protected]>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try '$0 --help' for more information"
+ exit 1
+fi
+
+case $1 in
+
+ --is-lightweight)
+ # Used by our autoconf macros to check whether the available missing
+ # script is modern enough.
+ exit 0
+ ;;
+
+ --run)
+ # Back-compat with the calling convention used by older automake.
+ shift
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+
+Supported PROGRAM values:
+ aclocal autoconf autoheader autom4te automake makeinfo
+ bison yacc flex lex help2man
+
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
+
+Send bug reports to <[email protected]>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: unknown '$1' option"
+ echo 1>&2 "Try '$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch. This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+ msg="probably too old"
+elif test $st -eq 127; then
+ # Program was missing.
+ msg="missing on your system"
+else
+ # Program was found and executed, but failed. Give up.
+ exit $st
+fi
+
+perl_URL=https://www.perl.org/
+flex_URL=http://flex.sourceforge.net/
+gnu_software_URL=https://www.gnu.org/software
+
+program_details ()
+{
+ case $1 in
+ aclocal|automake)
+ echo "The '$1' program is part of the GNU Automake package:"
+ echo "<$gnu_software_URL/automake>"
+ echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/autoconf>"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ autoconf|autom4te|autoheader)
+ echo "The '$1' program is part of the GNU Autoconf package:"
+ echo "<$gnu_software_URL/autoconf/>"
+ echo "It also requires GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ esac
+}
+
+give_advice ()
+{
+ # Normalize program name to check for.
+ normalized_program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
+ printf '%s\n' "'$1' is $msg."
+
+ configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+ case $normalized_program in
+ autoconf*)
+ echo "You should only need it if you modified 'configure.ac',"
+ echo "or m4 files included by it."
+ program_details 'autoconf'
+ ;;
+ autoheader*)
+ echo "You should only need it if you modified 'acconfig.h' or"
+ echo "$configure_deps."
+ program_details 'autoheader'
+ ;;
+ automake*)
+ echo "You should only need it if you modified 'Makefile.am' or"
+ echo "$configure_deps."
+ program_details 'automake'
+ ;;
+ aclocal*)
+ echo "You should only need it if you modified 'acinclude.m4' or"
+ echo "$configure_deps."
+ program_details 'aclocal'
+ ;;
+ autom4te*)
+ echo "You might have modified some maintainer files that require"
+ echo "the 'autom4te' program to be rebuilt."
+ program_details 'autom4te'
+ ;;
+ bison*|yacc*)
+ echo "You should only need it if you modified a '.y' file."
+ echo "You may want to install the GNU Bison package:"
+ echo "<$gnu_software_URL/bison/>"
+ ;;
+ lex*|flex*)
+ echo "You should only need it if you modified a '.l' file."
+ echo "You may want to install the Fast Lexical Analyzer package:"
+ echo "<$flex_URL>"
+ ;;
+ help2man*)
+ echo "You should only need it if you modified a dependency" \
+ "of a man page."
+ echo "You may want to install the GNU Help2man package:"
+ echo "<$gnu_software_URL/help2man/>"
+ ;;
+ makeinfo*)
+ echo "You should only need it if you modified a '.texi' file, or"
+ echo "any other file indirectly affecting the aspect of the manual."
+ echo "You might want to install the Texinfo package:"
+ echo "<$gnu_software_URL/texinfo/>"
+ echo "The spurious makeinfo call might also be the consequence of"
+ echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+ echo "want to install GNU make:"
+ echo "<$gnu_software_URL/make/>"
+ ;;
+ *)
+ echo "You might have modified some files without having the proper"
+ echo "tools for further handling them. Check the 'README' file, it"
+ echo "often tells you about the needed prerequisites for installing"
+ echo "this package. You may also peek at any GNU archive site, in"
+ echo "case some other package contains this missing '$1' program."
+ ;;
+ esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+ -e '2,$s/^/ /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/build-aux/texinfo.tex b/build-aux/texinfo.tex
new file mode 100644
index 0000000..b1f0d2e
--- /dev/null
+++ b/build-aux/texinfo.tex
@@ -0,0 +1,8638 @@
+% texinfo.tex -- TeX macros to handle Texinfo files.
+%
+% Load plain if necessary, i.e., if running under initex.
+\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
+%
+\def\texinfoversion{2007-05-03.09}
+%
+% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
+% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+% 2007 Free Software Foundation, Inc.
+%
+% This texinfo.tex file is free software; you can redistribute it and/or
+% modify it under the terms of the GNU General Public License as
+% published by the Free Software Foundation; either version 3, or (at
+% your option) any later version.
+%
+% This texinfo.tex file is distributed in the hope that it will be
+% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+% General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this texinfo.tex file; see the file COPYING. If not,
+% see <https://www.gnu.org/licenses/>.
+%
+% As a special exception, when this file is read by TeX when processing
+% a Texinfo source document, you may use the result without
+% restriction. (This has been our intent since Texinfo was invented.)
+%
+% Please try the latest version of texinfo.tex before submitting bug
+% reports; you can get the latest version from:
+% https://www.gnu.org/software/texinfo/ (the Texinfo home page), or
+% ftp://tug.org/tex/texinfo.tex
+% (and all CTAN mirrors, see https://www.ctan.org).
+% The texinfo.tex in any given distribution could well be out
+% of date, so if that's what you're using, please check.
+%
+% Send bug reports to [email protected]. Please include including a
+% complete document in each bug report with which we can reproduce the
+% problem. Patches are, of course, greatly appreciated.
+%
+% To process a Texinfo manual with TeX, it's most reliable to use the
+% texi2dvi shell script that comes with the distribution. For a simple
+% manual foo.texi, however, you can get away with this:
+% tex foo.texi
+% texindex foo.??
+% tex foo.texi
+% tex foo.texi
+% dvips foo.dvi -o # or whatever; this makes foo.ps.
+% The extra TeX runs get the cross-reference information correct.
+% Sometimes one run after texindex suffices, and sometimes you need more
+% than two; texi2dvi does it as many times as necessary.
+%
+% It is possible to adapt texinfo.tex for other languages, to some
+% extent. You can get the existing language-specific files from the
+% full Texinfo distribution.
+%
+% The GNU Texinfo home page is https://www.gnu.org/software/texinfo.
+
+
+\message{Loading texinfo [version \texinfoversion]:}
+
+% If in a .fmt file, print the version number
+% and turn on active characters that we couldn't do earlier because
+% they might have appeared in the input file name.
+\everyjob{\message{[Texinfo version \texinfoversion]}%
+ \catcode`+=\active \catcode`\_=\active}
+
+
+\chardef\other=12
+
+% We never want plain's \outer definition of \+ in Texinfo.
+% For @tex, we can use \tabalign.
+\let\+ = \relax
+
+% Save some plain tex macros whose names we will redefine.
+\let\ptexb=\b
+\let\ptexbullet=\bullet
+\let\ptexc=\c
+\let\ptexcomma=\,
+\let\ptexdot=\.
+\let\ptexdots=\dots
+\let\ptexend=\end
+\let\ptexequiv=\equiv
+\let\ptexexclam=\!
+\let\ptexfootnote=\footnote
+\let\ptexgtr=>
+\let\ptexhat=^
+\let\ptexi=\i
+\let\ptexindent=\indent
+\let\ptexinsert=\insert
+\let\ptexlbrace=\{
+\let\ptexless=<
+\let\ptexnewwrite\newwrite
+\let\ptexnoindent=\noindent
+\let\ptexplus=+
+\let\ptexrbrace=\}
+\let\ptexslash=\/
+\let\ptexstar=\*
+\let\ptext=\t
+
+% If this character appears in an error message or help string, it
+% starts a new line in the output.
+\newlinechar = `^^J
+
+% Use TeX 3.0's \inputlineno to get the line number, for better error
+% messages, but if we're using an old version of TeX, don't do anything.
+%
+\ifx\inputlineno\thisisundefined
+ \let\linenumber = \empty % Pre-3.0.
+\else
+ \def\linenumber{l.\the\inputlineno:\space}
+\fi
+
+% Set up fixed words for English if not already set.
+\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
+\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
+\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
+\ifx\putwordin\undefined \gdef\putwordin{in}\fi
+\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
+\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
+\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
+\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
+\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
+\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
+\ifx\putwordof\undefined \gdef\putwordof{of}\fi
+\ifx\putwordon\undefined \gdef\putwordon{on}\fi
+\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
+\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
+\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
+\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
+\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
+\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
+\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
+%
+\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
+\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
+\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
+\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
+\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
+\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
+\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
+\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
+\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
+\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
+\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
+\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
+%
+\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
+\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
+\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
+\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
+\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
+
+% Since the category of space is not known, we have to be careful.
+\chardef\spacecat = 10
+\def\spaceisspace{\catcode`\ =\spacecat}
+
+% sometimes characters are active, so we need control sequences.
+\chardef\colonChar = `\:
+\chardef\commaChar = `\,
+\chardef\dashChar = `\-
+\chardef\dotChar = `\.
+\chardef\exclamChar= `\!
+\chardef\lquoteChar= `\`
+\chardef\questChar = `\?
+\chardef\rquoteChar= `\'
+\chardef\semiChar = `\;
+\chardef\underChar = `\_
+
+% Ignore a token.
+%
+\def\gobble#1{}
+
+% The following is used inside several \edef's.
+\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
+
+% Hyphenation fixes.
+\hyphenation{
+ Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
+ ap-pen-dix bit-map bit-maps
+ data-base data-bases eshell fall-ing half-way long-est man-u-script
+ man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
+ par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
+ spell-ing spell-ings
+ stand-alone strong-est time-stamp time-stamps which-ever white-space
+ wide-spread wrap-around
+}
+
+% Margin to add to right of even pages, to left of odd pages.
+\newdimen\bindingoffset
+\newdimen\normaloffset
+\newdimen\pagewidth \newdimen\pageheight
+
+% For a final copy, take out the rectangles
+% that mark overfull boxes (in case you have decided
+% that the text looks ok even though it passes the margin).
+%
+\def\finalout{\overfullrule=0pt}
+
+% @| inserts a changebar to the left of the current line. It should
+% surround any changed text. This approach does *not* work if the
+% change spans more than two lines of output. To handle that, we would
+% have adopt a much more difficult approach (putting marks into the main
+% vertical list for the beginning and end of each change).
+%
+\def\|{%
+ % \vadjust can only be used in horizontal mode.
+ \leavevmode
+ %
+ % Append this vertical mode material after the current line in the output.
+ \vadjust{%
+ % We want to insert a rule with the height and depth of the current
+ % leading; that is exactly what \strutbox is supposed to record.
+ \vskip-\baselineskip
+ %
+ % \vadjust-items are inserted at the left edge of the type. So
+ % the \llap here moves out into the left-hand margin.
+ \llap{%
+ %
+ % For a thicker or thinner bar, change the `1pt'.
+ \vrule height\baselineskip width1pt
+ %
+ % This is the space between the bar and the text.
+ \hskip 12pt
+ }%
+ }%
+}
+
+% Sometimes it is convenient to have everything in the transcript file
+% and nothing on the terminal. We don't just call \tracingall here,
+% since that produces some useless output on the terminal. We also make
+% some effort to order the tracing commands to reduce output in the log
+% file; cf. trace.sty in LaTeX.
+%
+\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
+\def\loggingall{%
+ \tracingstats2
+ \tracingpages1
+ \tracinglostchars2 % 2 gives us more in etex
+ \tracingparagraphs1
+ \tracingoutput1
+ \tracingmacros2
+ \tracingrestores1
+ \showboxbreadth\maxdimen \showboxdepth\maxdimen
+ \ifx\eTeXversion\undefined\else % etex gives us more logging
+ \tracingscantokens1
+ \tracingifs1
+ \tracinggroups1
+ \tracingnesting2
+ \tracingassigns1
+ \fi
+ \tracingcommands3 % 3 gives us more in etex
+ \errorcontextlines16
+}%
+
+% add check for \lastpenalty to plain's definitions. If the last thing
+% we did was a \nobreak, we don't want to insert more space.
+%
+\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
+ \removelastskip\penalty-50\smallskip\fi\fi}
+\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
+ \removelastskip\penalty-100\medskip\fi\fi}
+\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
+ \removelastskip\penalty-200\bigskip\fi\fi}
+
+% For @cropmarks command.
+% Do @cropmarks to get crop marks.
+%
+\newif\ifcropmarks
+\let\cropmarks = \cropmarkstrue
+%
+% Dimensions to add cropmarks at corners.
+% Added by P. A. MacKay, 12 Nov. 1986
+%
+\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
+\newdimen\cornerlong \cornerlong=1pc
+\newdimen\cornerthick \cornerthick=.3pt
+\newdimen\topandbottommargin \topandbottommargin=.75in
+
+% Main output routine.
+\chardef\PAGE = 255
+\output = {\onepageout{\pagecontents\PAGE}}
+
+\newbox\headlinebox
+\newbox\footlinebox
+
+% \onepageout takes a vbox as an argument. Note that \pagecontents
+% does insertions, but you have to call it yourself.
+\def\onepageout#1{%
+ \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
+ %
+ \ifodd\pageno \advance\hoffset by \bindingoffset
+ \else \advance\hoffset by -\bindingoffset\fi
+ %
+ % Do this outside of the \shipout so @code etc. will be expanded in
+ % the headline as they should be, not taken literally (outputting ''code).
+ \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
+ \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
+ %
+ {%
+ % Have to do this stuff outside the \shipout because we want it to
+ % take effect in \write's, yet the group defined by the \vbox ends
+ % before the \shipout runs.
+ %
+ \indexdummies % don't expand commands in the output.
+ \normalturnoffactive % \ in index entries must not stay \, e.g., if
+ % the page break happens to be in the middle of an example.
+ % We don't want .vr (or whatever) entries like this:
+ % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
+ % "\acronym" won't work when it's read back in;
+ % it needs to be
+ % {\code {{\tt \backslashcurfont }acronym}
+ \shipout\vbox{%
+ % Do this early so pdf references go to the beginning of the page.
+ \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
+ %
+ \ifcropmarks \vbox to \outervsize\bgroup
+ \hsize = \outerhsize
+ \vskip-\topandbottommargin
+ \vtop to0pt{%
+ \line{\ewtop\hfil\ewtop}%
+ \nointerlineskip
+ \line{%
+ \vbox{\moveleft\cornerthick\nstop}%
+ \hfill
+ \vbox{\moveright\cornerthick\nstop}%
+ }%
+ \vss}%
+ \vskip\topandbottommargin
+ \line\bgroup
+ \hfil % center the page within the outer (page) hsize.
+ \ifodd\pageno\hskip\bindingoffset\fi
+ \vbox\bgroup
+ \fi
+ %
+ \unvbox\headlinebox
+ \pagebody{#1}%
+ \ifdim\ht\footlinebox > 0pt
+ % Only leave this space if the footline is nonempty.
+ % (We lessened \vsize for it in \oddfootingyyy.)
+ % The \baselineskip=24pt in plain's \makefootline has no effect.
+ \vskip 24pt
+ \unvbox\footlinebox
+ \fi
+ %
+ \ifcropmarks
+ \egroup % end of \vbox\bgroup
+ \hfil\egroup % end of (centering) \line\bgroup
+ \vskip\topandbottommargin plus1fill minus1fill
+ \boxmaxdepth = \cornerthick
+ \vbox to0pt{\vss
+ \line{%
+ \vbox{\moveleft\cornerthick\nsbot}%
+ \hfill
+ \vbox{\moveright\cornerthick\nsbot}%
+ }%
+ \nointerlineskip
+ \line{\ewbot\hfil\ewbot}%
+ }%
+ \egroup % \vbox from first cropmarks clause
+ \fi
+ }% end of \shipout\vbox
+ }% end of group with \indexdummies
+ \advancepageno
+ \ifnum\outputpenalty>-20000 \else\dosupereject\fi
+}
+
+\newinsert\margin \dimen\margin=\maxdimen
+
+\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
+{\catcode`\@ =11
+\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
+% marginal hacks, [email protected] (Juha Takala)
+\ifvoid\margin\else % marginal info is present
+ \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
+\dimen@=\dp#1 \unvbox#1
+\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
+\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
+}
+
+% Here are the rules for the cropmarks. Note that they are
+% offset so that the space between them is truly \outerhsize or \outervsize
+% (P. A. MacKay, 12 November, 1986)
+%
+\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
+\def\nstop{\vbox
+ {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
+\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
+\def\nsbot{\vbox
+ {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
+
+% Parse an argument, then pass it to #1. The argument is the rest of
+% the input line (except we remove a trailing comment). #1 should be a
+% macro which expects an ordinary undelimited TeX argument.
+%
+\def\parsearg{\parseargusing{}}
+\def\parseargusing#1#2{%
+ \def\argtorun{#2}%
+ \begingroup
+ \obeylines
+ \spaceisspace
+ #1%
+ \parseargline\empty% Insert the \empty token, see \finishparsearg below.
+}
+
+{\obeylines %
+ \gdef\parseargline#1^^M{%
+ \endgroup % End of the group started in \parsearg.
+ \argremovecomment #1\comment\ArgTerm%
+ }%
+}
+
+% First remove any @comment, then any @c comment.
+\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
+\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
+
+% Each occurence of `\^^M' or `<space>\^^M' is replaced by a single space.
+%
+% \argremovec might leave us with trailing space, e.g.,
+% @end itemize @c foo
+% This space token undergoes the same procedure and is eventually removed
+% by \finishparsearg.
+%
+\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
+\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
+\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
+ \def\temp{#3}%
+ \ifx\temp\empty
+ % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
+ \let\temp\finishparsearg
+ \else
+ \let\temp\argcheckspaces
+ \fi
+ % Put the space token in:
+ \temp#1 #3\ArgTerm
+}
+
+% If a _delimited_ argument is enclosed in braces, they get stripped; so
+% to get _exactly_ the rest of the line, we had to prevent such situation.
+% We prepended an \empty token at the very beginning and we expand it now,
+% just before passing the control to \argtorun.
+% (Similarily, we have to think about #3 of \argcheckspacesY above: it is
+% either the null string, or it ends with \^^M---thus there is no danger
+% that a pair of braces would be stripped.
+%
+% But first, we have to remove the trailing space token.
+%
+\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
+
+% \parseargdef\foo{...}
+% is roughly equivalent to
+% \def\foo{\parsearg\Xfoo}
+% \def\Xfoo#1{...}
+%
+% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
+% favourite TeX trick. --kasal, 16nov03
+
+\def\parseargdef#1{%
+ \expandafter \doparseargdef \csname\string#1\endcsname #1%
+}
+\def\doparseargdef#1#2{%
+ \def#2{\parsearg#1}%
+ \def#1##1%
+}
+
+% Several utility definitions with active space:
+{
+ \obeyspaces
+ \gdef\obeyedspace{ }
+
+ % Make each space character in the input produce a normal interword
+ % space in the output. Don't allow a line break at this space, as this
+ % is used only in environments like @example, where each line of input
+ % should produce a line of output anyway.
+ %
+ \gdef\sepspaces{\obeyspaces\let =\tie}
+
+ % If an index command is used in an @example environment, any spaces
+ % therein should become regular spaces in the raw index file, not the
+ % expansion of \tie (\leavevmode \penalty \@M \ ).
+ \gdef\unsepspaces{\let =\space}
+}
+
+
+\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
+
+% Define the framework for environments in texinfo.tex. It's used like this:
+%
+% \envdef\foo{...}
+% \def\Efoo{...}
+%
+% It's the responsibility of \envdef to insert \begingroup before the
+% actual body; @end closes the group after calling \Efoo. \envdef also
+% defines \thisenv, so the current environment is known; @end checks
+% whether the environment name matches. The \checkenv macro can also be
+% used to check whether the current environment is the one expected.
+%
+% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
+% are not treated as enviroments; they don't open a group. (The
+% implementation of @end takes care not to call \endgroup in this
+% special case.)
+
+
+% At runtime, environments start with this:
+\def\startenvironment#1{\begingroup\def\thisenv{#1}}
+% initialize
+\let\thisenv\empty
+
+% ... but they get defined via ``\envdef\foo{...}'':
+\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
+\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
+
+% Check whether we're in the right environment:
+\def\checkenv#1{%
+ \def\temp{#1}%
+ \ifx\thisenv\temp
+ \else
+ \badenverr
+ \fi
+}
+
+% Evironment mismatch, #1 expected:
+\def\badenverr{%
+ \errhelp = \EMsimple
+ \errmessage{This command can appear only \inenvironment\temp,
+ not \inenvironment\thisenv}%
+}
+\def\inenvironment#1{%
+ \ifx#1\empty
+ out of any environment%
+ \else
+ in environment \expandafter\string#1%
+ \fi
+}
+
+% @end foo executes the definition of \Efoo.
+% But first, it executes a specialized version of \checkenv
+%
+\parseargdef\end{%
+ \if 1\csname iscond.#1\endcsname
+ \else
+ % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03
+ \expandafter\checkenv\csname#1\endcsname
+ \csname E#1\endcsname
+ \endgroup
+ \fi
+}
+
+\newhelp\EMsimple{Press RETURN to continue.}
+
+
+%% Simple single-character @ commands
+
+% @@ prints an @
+% Kludge this until the fonts are right (grr).
+\def\@{{\tt\char64}}
+
+% This is turned off because it was never documented
+% and you can use @w{...} around a quote to suppress ligatures.
+%% Define @` and @' to be the same as ` and '
+%% but suppressing ligatures.
+%\def\`{{`}}
+%\def\'{{'}}
+
+% Used to generate quoted braces.
+\def\mylbrace {{\tt\char123}}
+\def\myrbrace {{\tt\char125}}
+\let\{=\mylbrace
+\let\}=\myrbrace
+\begingroup
+ % Definitions to produce \{ and \} commands for indices,
+ % and @{ and @} for the aux/toc files.
+ \catcode`\{ = \other \catcode`\} = \other
+ \catcode`\[ = 1 \catcode`\] = 2
+ \catcode`\! = 0 \catcode`\\ = \other
+ !gdef!lbracecmd[\{]%
+ !gdef!rbracecmd[\}]%
+ !gdef!lbraceatcmd[@{]%
+ !gdef!rbraceatcmd[@}]%
+!endgroup
+
+% @comma{} to avoid , parsing problems.
+\let\comma = ,
+
+% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
+% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
+\let\, = \c
+\let\dotaccent = \.
+\def\ringaccent#1{{\accent23 #1}}
+\let\tieaccent = \t
+\let\ubaraccent = \b
+\let\udotaccent = \d
+
+% Other special characters: @questiondown @exclamdown @ordf @ordm
+% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
+\def\questiondown{?`}
+\def\exclamdown{!`}
+\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
+\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
+
+% Dotless i and dotless j, used for accents.
+\def\imacro{i}
+\def\jmacro{j}
+\def\dotless#1{%
+ \def\temp{#1}%
+ \ifx\temp\imacro \ptexi
+ \else\ifx\temp\jmacro \j
+ \else \errmessage{@dotless can be used only with i or j}%
+ \fi\fi
+}
+
+% The \TeX{} logo, as in plain, but resetting the spacing so that a
+% period following counts as ending a sentence. (Idea found in latex.)
+%
+\edef\TeX{\TeX \spacefactor=1000 }
+
+% @LaTeX{} logo. Not quite the same results as the definition in
+% latex.ltx, since we use a different font for the raised A; it's most
+% convenient for us to use an explicitly smaller font, rather than using
+% the \scriptstyle font (since we don't reset \scriptstyle and
+% \scriptscriptstyle).
+%
+\def\LaTeX{%
+ L\kern-.36em
+ {\setbox0=\hbox{T}%
+ \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}%
+ \kern-.15em
+ \TeX
+}
+
+% Be sure we're in horizontal mode when doing a tie, since we make space
+% equivalent to this in @example-like environments. Otherwise, a space
+% at the beginning of a line will start with \penalty -- and
+% since \penalty is valid in vertical mode, we'd end up putting the
+% penalty on the vertical list instead of in the new paragraph.
+{\catcode`@ = 11
+ % Avoid using \@M directly, because that causes trouble
+ % if the definition is written into an index file.
+ \global\let\tiepenalty = \@M
+ \gdef\tie{\leavevmode\penalty\tiepenalty\ }
+}
+
+% @: forces normal size whitespace following.
+\def\:{\spacefactor=1000 }
+
+% @* forces a line break.
+\def\*{\hfil\break\hbox{}\ignorespaces}
+
+% @/ allows a line break.
+\let\/=\allowbreak
+
+% @. is an end-of-sentence period.
+\def\.{.\spacefactor=\endofsentencespacefactor\space}
+
+% @! is an end-of-sentence bang.
+\def\!{!\spacefactor=\endofsentencespacefactor\space}
+
+% @? is an end-of-sentence query.
+\def\?{?\spacefactor=\endofsentencespacefactor\space}
+
+% @frenchspacing on|off says whether to put extra space after punctuation.
+%
+\def\onword{on}
+\def\offword{off}
+%
+\parseargdef\frenchspacing{%
+ \def\temp{#1}%
+ \ifx\temp\onword \plainfrenchspacing
+ \else\ifx\temp\offword \plainnonfrenchspacing
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @frenchspacing option `\temp', must be on/off}%
+ \fi\fi
+}
+
+% @w prevents a word break. Without the \leavevmode, @w at the
+% beginning of a paragraph, when TeX is still in vertical mode, would
+% produce a whole line of output instead of starting the paragraph.
+\def\w#1{\leavevmode\hbox{#1}}
+
+% @group ... @end group forces ... to be all on one page, by enclosing
+% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
+% to keep its height that of a normal line. According to the rules for
+% \topskip (p.114 of the TeXbook), the glue inserted is
+% max (\topskip - \ht (first item), 0). If that height is large,
+% therefore, no glue is inserted, and the space between the headline and
+% the text is small, which looks bad.
+%
+% Another complication is that the group might be very large. This can
+% cause the glue on the previous page to be unduly stretched, because it
+% does not have much material. In this case, it's better to add an
+% explicit \vfill so that the extra space is at the bottom. The
+% threshold for doing this is if the group is more than \vfilllimit
+% percent of a page (\vfilllimit can be changed inside of @tex).
+%
+\newbox\groupbox
+\def\vfilllimit{0.7}
+%
+\envdef\group{%
+ \ifnum\catcode`\^^M=\active \else
+ \errhelp = \groupinvalidhelp
+ \errmessage{@group invalid in context where filling is enabled}%
+ \fi
+ \startsavinginserts
+ %
+ \setbox\groupbox = \vtop\bgroup
+ % Do @comment since we are called inside an environment such as
+ % @example, where each end-of-line in the input causes an
+ % end-of-line in the output. We don't want the end-of-line after
+ % the `@group' to put extra space in the output. Since @group
+ % should appear on a line by itself (according to the Texinfo
+ % manual), we don't worry about eating any user text.
+ \comment
+}
+%
+% The \vtop produces a box with normal height and large depth; thus, TeX puts
+% \baselineskip glue before it, and (when the next line of text is done)
+% \lineskip glue after it. Thus, space below is not quite equal to space
+% above. But it's pretty close.
+\def\Egroup{%
+ % To get correct interline space between the last line of the group
+ % and the first line afterwards, we have to propagate \prevdepth.
+ \endgraf % Not \par, as it may have been set to \lisppar.
+ \global\dimen1 = \prevdepth
+ \egroup % End the \vtop.
+ % \dimen0 is the vertical size of the group's box.
+ \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
+ % \dimen2 is how much space is left on the page (more or less).
+ \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
+ % if the group doesn't fit on the current page, and it's a big big
+ % group, force a page break.
+ \ifdim \dimen0 > \dimen2
+ \ifdim \pagetotal < \vfilllimit\pageheight
+ \page
+ \fi
+ \fi
+ \box\groupbox
+ \prevdepth = \dimen1
+ \checkinserts
+}
+%
+% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
+% message, so this ends up printing `@group can only ...'.
+%
+\newhelp\groupinvalidhelp{%
+group can only be used in environments such as @example,^^J%
+where each line of input produces a line of output.}
+
+% @need space-in-mils
+% forces a page break if there is not space-in-mils remaining.
+
+\newdimen\mil \mil=0.001in
+
+% Old definition--didn't work.
+%\parseargdef\need{\par %
+%% This method tries to make TeX break the page naturally
+%% if the depth of the box does not fit.
+%{\baselineskip=0pt%
+%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
+%\prevdepth=-1000pt
+%}}
+
+\parseargdef\need{%
+ % Ensure vertical mode, so we don't make a big box in the middle of a
+ % paragraph.
+ \par
+ %
+ % If the @need value is less than one line space, it's useless.
+ \dimen0 = #1\mil
+ \dimen2 = \ht\strutbox
+ \advance\dimen2 by \dp\strutbox
+ \ifdim\dimen0 > \dimen2
+ %
+ % Do a \strut just to make the height of this box be normal, so the
+ % normal leading is inserted relative to the preceding line.
+ % And a page break here is fine.
+ \vtop to #1\mil{\strut\vfil}%
+ %
+ % TeX does not even consider page breaks if a penalty added to the
+ % main vertical list is 10000 or more. But in order to see if the
+ % empty box we just added fits on the page, we must make it consider
+ % page breaks. On the other hand, we don't want to actually break the
+ % page after the empty box. So we use a penalty of 9999.
+ %
+ % There is an extremely small chance that TeX will actually break the
+ % page at this \penalty, if there are no other feasible breakpoints in
+ % sight. (If the user is using lots of big @group commands, which
+ % almost-but-not-quite fill up a page, TeX will have a hard time doing
+ % good page breaking, for example.) However, I could not construct an
+ % example where a page broke at this \penalty; if it happens in a real
+ % document, then we can reconsider our strategy.
+ \penalty9999
+ %
+ % Back up by the size of the box, whether we did a page break or not.
+ \kern -#1\mil
+ %
+ % Do not allow a page break right after this kern.
+ \nobreak
+ \fi
+}
+
+% @br forces paragraph break (and is undocumented).
+
+\let\br = \par
+
+% @page forces the start of a new page.
+%
+\def\page{\par\vfill\supereject}
+
+% @exdent text....
+% outputs text on separate line in roman font, starting at standard page margin
+
+% This records the amount of indent in the innermost environment.
+% That's how much \exdent should take out.
+\newskip\exdentamount
+
+% This defn is used inside fill environments such as @defun.
+\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
+
+% This defn is used inside nofill environments such as @example.
+\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
+ \leftline{\hskip\leftskip{\rm#1}}}}
+
+% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
+% paragraph. For more general purposes, use the \margin insertion
+% class. WHICH is `l' or `r'.
+%
+\newskip\inmarginspacing \inmarginspacing=1cm
+\def\strutdepth{\dp\strutbox}
+%
+\def\doinmargin#1#2{\strut\vadjust{%
+ \nobreak
+ \kern-\strutdepth
+ \vtop to \strutdepth{%
+ \baselineskip=\strutdepth
+ \vss
+ % if you have multiple lines of stuff to put here, you'll need to
+ % make the vbox yourself of the appropriate size.
+ \ifx#1l%
+ \llap{\ignorespaces #2\hskip\inmarginspacing}%
+ \else
+ \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
+ \fi
+ \null
+ }%
+}}
+\def\inleftmargin{\doinmargin l}
+\def\inrightmargin{\doinmargin r}
+%
+% @inmargin{TEXT [, RIGHT-TEXT]}
+% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
+% else use TEXT for both).
+%
+\def\inmargin#1{\parseinmargin #1,,\finish}
+\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \def\lefttext{#1}% have both texts
+ \def\righttext{#2}%
+ \else
+ \def\lefttext{#1}% have only one text
+ \def\righttext{#1}%
+ \fi
+ %
+ \ifodd\pageno
+ \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
+ \else
+ \def\temp{\inleftmargin\lefttext}%
+ \fi
+ \temp
+}
+
+% @include file insert text of that file as input.
+%
+\def\include{\parseargusing\filenamecatcodes\includezzz}
+\def\includezzz#1{%
+ \pushthisfilestack
+ \def\thisfile{#1}%
+ {%
+ \makevalueexpandable
+ \def\temp{\input #1 }%
+ \expandafter
+ }\temp
+ \popthisfilestack
+}
+\def\filenamecatcodes{%
+ \catcode`\\=\other
+ \catcode`~=\other
+ \catcode`^=\other
+ \catcode`_=\other
+ \catcode`|=\other
+ \catcode`<=\other
+ \catcode`>=\other
+ \catcode`+=\other
+ \catcode`-=\other
+}
+
+\def\pushthisfilestack{%
+ \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
+}
+\def\pushthisfilestackX{%
+ \expandafter\pushthisfilestackY\thisfile\StackTerm
+}
+\def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
+ \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
+}
+
+\def\popthisfilestack{\errthisfilestackempty}
+\def\errthisfilestackempty{\errmessage{Internal error:
+ the stack of filenames is empty.}}
+
+\def\thisfile{}
+
+% @center line
+% outputs that line, centered.
+%
+\parseargdef\center{%
+ \ifhmode
+ \let\next\centerH
+ \else
+ \let\next\centerV
+ \fi
+ \next{\hfil \ignorespaces#1\unskip \hfil}%
+}
+\def\centerH#1{%
+ {%
+ \hfil\break
+ \advance\hsize by -\leftskip
+ \advance\hsize by -\rightskip
+ \line{#1}%
+ \break
+ }%
+}
+\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
+
+% @sp n outputs n lines of vertical space
+
+\parseargdef\sp{\vskip #1\baselineskip}
+
+% @comment ...line which is ignored...
+% @c is the same as @comment
+% @ignore ... @end ignore is another way to write a comment
+
+\def\comment{\begingroup \catcode`\^^M=\other%
+\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
+\commentxxx}
+{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
+
+\let\c=\comment
+
+% @paragraphindent NCHARS
+% We'll use ems for NCHARS, close enough.
+% NCHARS can also be the word `asis' or `none'.
+% We cannot feasibly implement @paragraphindent asis, though.
+%
+\def\asisword{asis} % no translation, these are keywords
+\def\noneword{none}
+%
+\parseargdef\paragraphindent{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
+ \else
+ \ifx\temp\noneword
+ \defaultparindent = 0pt
+ \else
+ \defaultparindent = #1em
+ \fi
+ \fi
+ \parindent = \defaultparindent
+}
+
+% @exampleindent NCHARS
+% We'll use ems for NCHARS like @paragraphindent.
+% It seems @exampleindent asis isn't necessary, but
+% I preserve it to make it similar to @paragraphindent.
+\parseargdef\exampleindent{%
+ \def\temp{#1}%
+ \ifx\temp\asisword
+ \else
+ \ifx\temp\noneword
+ \lispnarrowing = 0pt
+ \else
+ \lispnarrowing = #1em
+ \fi
+ \fi
+}
+
+% @firstparagraphindent WORD
+% If WORD is `none', then suppress indentation of the first paragraph
+% after a section heading. If WORD is `insert', then do indent at such
+% paragraphs.
+%
+% The paragraph indentation is suppressed or not by calling
+% \suppressfirstparagraphindent, which the sectioning commands do.
+% We switch the definition of this back and forth according to WORD.
+% By default, we suppress indentation.
+%
+\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
+\def\insertword{insert}
+%
+\parseargdef\firstparagraphindent{%
+ \def\temp{#1}%
+ \ifx\temp\noneword
+ \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
+ \else\ifx\temp\insertword
+ \let\suppressfirstparagraphindent = \relax
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @firstparagraphindent option `\temp'}%
+ \fi\fi
+}
+
+% Here is how we actually suppress indentation. Redefine \everypar to
+% \kern backwards by \parindent, and then reset itself to empty.
+%
+% We also make \indent itself not actually do anything until the next
+% paragraph.
+%
+\gdef\dosuppressfirstparagraphindent{%
+ \gdef\indent{%
+ \restorefirstparagraphindent
+ \indent
+ }%
+ \gdef\noindent{%
+ \restorefirstparagraphindent
+ \noindent
+ }%
+ \global\everypar = {%
+ \kern -\parindent
+ \restorefirstparagraphindent
+ }%
+}
+
+\gdef\restorefirstparagraphindent{%
+ \global \let \indent = \ptexindent
+ \global \let \noindent = \ptexnoindent
+ \global \everypar = {}%
+}
+
+
+% @asis just yields its argument. Used with @table, for example.
+%
+\def\asis#1{#1}
+
+% @math outputs its argument in math mode.
+%
+% One complication: _ usually means subscripts, but it could also mean
+% an actual _ character, as in @math{@var{some_variable} + 1}. So make
+% _ active, and distinguish by seeing if the current family is \slfam,
+% which is what @var uses.
+{
+ \catcode`\_ = \active
+ \gdef\mathunderscore{%
+ \catcode`\_=\active
+ \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
+ }
+}
+% Another complication: we want \\ (and @\) to output a \ character.
+% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
+% this is not advertised and we don't care. Texinfo does not
+% otherwise define @\.
+%
+% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
+\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
+%
+\def\math{%
+ \tex
+ \mathunderscore
+ \let\\ = \mathbackslash
+ \mathactive
+ $\finishmath
+}
+\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
+
+% Some active characters (such as <) are spaced differently in math.
+% We have to reset their definitions in case the @math was an argument
+% to a command which sets the catcodes (such as @item or @section).
+%
+{
+ \catcode`^ = \active
+ \catcode`< = \active
+ \catcode`> = \active
+ \catcode`+ = \active
+ \gdef\mathactive{%
+ \let^ = \ptexhat
+ \let< = \ptexless
+ \let> = \ptexgtr
+ \let+ = \ptexplus
+ }
+}
+
+% @bullet and @minus need the same treatment as @math, just above.
+\def\bullet{$\ptexbullet$}
+\def\minus{$-$}
+
+% @dots{} outputs an ellipsis using the current font.
+% We do .5em per period so that it has the same spacing in the cm
+% typewriter fonts as three actual period characters; on the other hand,
+% in other typewriter fonts three periods are wider than 1.5em. So do
+% whichever is larger.
+%
+\def\dots{%
+ \leavevmode
+ \setbox0=\hbox{...}% get width of three periods
+ \ifdim\wd0 > 1.5em
+ \dimen0 = \wd0
+ \else
+ \dimen0 = 1.5em
+ \fi
+ \hbox to \dimen0{%
+ \hskip 0pt plus.25fil
+ .\hskip 0pt plus1fil
+ .\hskip 0pt plus1fil
+ .\hskip 0pt plus.5fil
+ }%
+}
+
+% @enddots{} is an end-of-sentence ellipsis.
+%
+\def\enddots{%
+ \dots
+ \spacefactor=\endofsentencespacefactor
+}
+
+% @comma{} is so commas can be inserted into text without messing up
+% Texinfo's parsing.
+%
+\let\comma = ,
+
+% @refill is a no-op.
+\let\refill=\relax
+
+% If working on a large document in chapters, it is convenient to
+% be able to disable indexing, cross-referencing, and contents, for test runs.
+% This is done with @novalidate (before @setfilename).
+%
+\newif\iflinks \linkstrue % by default we want the aux files.
+\let\novalidate = \linksfalse
+
+% @setfilename is done at the beginning of every texinfo file.
+% So open here the files we need to have open while reading the input.
+% This makes it possible to make a .fmt file for texinfo.
+\def\setfilename{%
+ \fixbackslash % Turn off hack to swallow `\input texinfo'.
+ \iflinks
+ \tryauxfile
+ % Open the new aux file. TeX will close it automatically at exit.
+ \immediate\openout\auxfile=\jobname.aux
+ \fi % \openindices needs to do some work in any case.
+ \openindices
+ \let\setfilename=\comment % Ignore extra @setfilename cmds.
+ %
+ % If texinfo.cnf is present on the system, read it.
+ % Useful for site-wide @afourpaper, etc.
+ \openin 1 texinfo.cnf
+ \ifeof 1 \else \input texinfo.cnf \fi
+ \closein 1
+ %
+ \comment % Ignore the actual filename.
+}
+
+% Called from \setfilename.
+%
+\def\openindices{%
+ \newindex{cp}%
+ \newcodeindex{fn}%
+ \newcodeindex{vr}%
+ \newcodeindex{tp}%
+ \newcodeindex{ky}%
+ \newcodeindex{pg}%
+}
+
+% @bye.
+\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
+
+
+\message{pdf,}
+% adobe `portable' document format
+\newcount\tempnum
+\newcount\lnkcount
+\newtoks\filename
+\newcount\filenamelength
+\newcount\pgn
+\newtoks\toksA
+\newtoks\toksB
+\newtoks\toksC
+\newtoks\toksD
+\newbox\boxA
+\newcount\countA
+\newif\ifpdf
+\newif\ifpdfmakepagedest
+
+% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
+% can be set). So we test for \relax and 0 as well as \undefined,
+% borrowed from ifpdf.sty.
+\ifx\pdfoutput\undefined
+\else
+ \ifx\pdfoutput\relax
+ \else
+ \ifcase\pdfoutput
+ \else
+ \pdftrue
+ \fi
+ \fi
+\fi
+
+% PDF uses PostScript string constants for the names of xref targets,
+% for display in the outlines, and in other places. Thus, we have to
+% double any backslashes. Otherwise, a name like "\node" will be
+% interpreted as a newline (\n), followed by o, d, e. Not good.
+% https://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html
+% (and related messages, the final outcome is that it is up to the TeX
+% user to double the backslashes and otherwise make the string valid, so
+% that's what we do).
+
+% double active backslashes.
+%
+{\catcode`\@=0 \catcode`\\=\active
+ @gdef@activebackslashdouble{%
+ @catcode`@\=@active
+ @let\=@doublebackslash}
+}
+
+% To handle parens, we must adopt a different approach, since parens are
+% not active characters. hyperref.dtx (which has the same problem as
+% us) handles it with this amazing macro to replace tokens, with minor
+% changes for Texinfo. It is included here under the GPL by permission
+% from the author, Heiko Oberdiek.
+%
+% #1 is the tokens to replace.
+% #2 is the replacement.
+% #3 is the control sequence with the string.
+%
+\def\HyPsdSubst#1#2#3{%
+ \def\HyPsdReplace##1#1##2\END{%
+ ##1%
+ \ifx\\##2\\%
+ \else
+ #2%
+ \HyReturnAfterFi{%
+ \HyPsdReplace##2\END
+ }%
+ \fi
+ }%
+ \xdef#3{\expandafter\HyPsdReplace#3#1\END}%
+}
+\long\def\HyReturnAfterFi#1\fi{\fi#1}
+
+% #1 is a control sequence in which to do the replacements.
+\def\backslashparens#1{%
+ \xdef#1{#1}% redefine it as its expansion; the definition is simply
+ % \lastnode when called from \setref -> \pdfmkdest.
+ \HyPsdSubst{(}{\realbackslash(}{#1}%
+ \HyPsdSubst{)}{\realbackslash)}{#1}%
+}
+
+\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
+with PDF output, and none of those formats could be found. (.eps cannot
+be supported due to the design of the PDF format; use regular TeX (DVI
+output) for that.)}
+
+\ifpdf
+ \input pdfcolor
+ \pdfcatalog{/PageMode /UseOutlines}
+ %
+ % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
+ \def\dopdfimage#1#2#3{%
+ \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
+ \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
+ %
+ % pdftex (and the PDF format) support .png, .jpg, .pdf (among
+ % others). Let's try in that order.
+ \let\pdfimgext=\empty
+ \begingroup
+ \openin 1 #1.png \ifeof 1
+ \openin 1 #1.jpg \ifeof 1
+ \openin 1 #1.jpeg \ifeof 1
+ \openin 1 #1.JPG \ifeof 1
+ \openin 1 #1.pdf \ifeof 1
+ \errhelp = \nopdfimagehelp
+ \errmessage{Could not find image file #1 for pdf}%
+ \else \gdef\pdfimgext{pdf}%
+ \fi
+ \else \gdef\pdfimgext{JPG}%
+ \fi
+ \else \gdef\pdfimgext{jpeg}%
+ \fi
+ \else \gdef\pdfimgext{jpg}%
+ \fi
+ \else \gdef\pdfimgext{png}%
+ \fi
+ \closein 1
+ \endgroup
+ %
+ % without \immediate, pdftex seg faults when the same image is
+ % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
+ \ifnum\pdftexversion < 14
+ \immediate\pdfimage
+ \else
+ \immediate\pdfximage
+ \fi
+ \ifdim \wd0 >0pt width \imagewidth \fi
+ \ifdim \wd2 >0pt height \imageheight \fi
+ \ifnum\pdftexversion<13
+ #1.\pdfimgext
+ \else
+ {#1.\pdfimgext}%
+ \fi
+ \ifnum\pdftexversion < 14 \else
+ \pdfrefximage \pdflastximage
+ \fi}
+ %
+ \def\pdfmkdest#1{{%
+ % We have to set dummies so commands such as @code, and characters
+ % such as \, aren't expanded when present in a section title.
+ \indexnofonts
+ \turnoffactive
+ \activebackslashdouble
+ \makevalueexpandable
+ \def\pdfdestname{#1}%
+ \backslashparens\pdfdestname
+ \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
+ }}
+ %
+ % used to mark target names; must be expandable.
+ \def\pdfmkpgn#1{#1}
+ %
+ % by default, use a color that is dark enough to print on paper as
+ % nearly black, but still distinguishable for online viewing.
+ % (Defined in pdfcolor.tex.)
+ \let\urlcolor = \BrickRed
+ \let\linkcolor = \BrickRed
+ \def\endlink{\Black\pdfendlink}
+ %
+ % Adding outlines to PDF; macros for calculating structure of outlines
+ % come from Petr Olsak
+ \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
+ \else \csname#1\endcsname \fi}
+ \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
+ \advance\tempnum by 1
+ \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
+ %
+ % #1 is the section text, which is what will be displayed in the
+ % outline by the pdf viewer. #2 is the pdf expression for the number
+ % of subentries (or empty, for subsubsections). #3 is the node text,
+ % which might be empty if this toc entry had no corresponding node.
+ % #4 is the page number
+ %
+ \def\dopdfoutline#1#2#3#4{%
+ % Generate a link to the node text if that exists; else, use the
+ % page number. We could generate a destination for the section
+ % text in the case where a section has no node, but it doesn't
+ % seem worth the trouble, since most documents are normally structured.
+ \def\pdfoutlinedest{#3}%
+ \ifx\pdfoutlinedest\empty
+ \def\pdfoutlinedest{#4}%
+ \else
+ % Doubled backslashes in the name.
+ {\activebackslashdouble \xdef\pdfoutlinedest{#3}%
+ \backslashparens\pdfoutlinedest}%
+ \fi
+ %
+ % Also double the backslashes in the display string.
+ {\activebackslashdouble \xdef\pdfoutlinetext{#1}%
+ \backslashparens\pdfoutlinetext}%
+ %
+ \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
+ }
+ %
+ \def\pdfmakeoutlines{%
+ \begingroup
+ % Thanh's hack / proper braces in bookmarks
+ \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
+ \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
+ %
+ % Read toc silently, to get counts of subentries for \pdfoutline.
+ \def\numchapentry##1##2##3##4{%
+ \def\thischapnum{##2}%
+ \def\thissecnum{0}%
+ \def\thissubsecnum{0}%
+ }%
+ \def\numsecentry##1##2##3##4{%
+ \advancenumber{chap\thischapnum}%
+ \def\thissecnum{##2}%
+ \def\thissubsecnum{0}%
+ }%
+ \def\numsubsecentry##1##2##3##4{%
+ \advancenumber{sec\thissecnum}%
+ \def\thissubsecnum{##2}%
+ }%
+ \def\numsubsubsecentry##1##2##3##4{%
+ \advancenumber{subsec\thissubsecnum}%
+ }%
+ \def\thischapnum{0}%
+ \def\thissecnum{0}%
+ \def\thissubsecnum{0}%
+ %
+ % use \def rather than \let here because we redefine \chapentry et
+ % al. a second time, below.
+ \def\appentry{\numchapentry}%
+ \def\appsecentry{\numsecentry}%
+ \def\appsubsecentry{\numsubsecentry}%
+ \def\appsubsubsecentry{\numsubsubsecentry}%
+ \def\unnchapentry{\numchapentry}%
+ \def\unnsecentry{\numsecentry}%
+ \def\unnsubsecentry{\numsubsecentry}%
+ \def\unnsubsubsecentry{\numsubsubsecentry}%
+ \readdatafile{toc}%
+ %
+ % Read toc second time, this time actually producing the outlines.
+ % The `-' means take the \expnumber as the absolute number of
+ % subentries, which we calculated on our first read of the .toc above.
+ %
+ % We use the node names as the destinations.
+ \def\numchapentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
+ \def\numsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
+ \def\numsubsecentry##1##2##3##4{%
+ \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
+ \def\numsubsubsecentry##1##2##3##4{% count is always zero
+ \dopdfoutline{##1}{}{##3}{##4}}%
+ %
+ % PDF outlines are displayed using system fonts, instead of
+ % document fonts. Therefore we cannot use special characters,
+ % since the encoding is unknown. For example, the eogonek from
+ % Latin 2 (0xea) gets translated to a | character. Info from
+ % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
+ %
+ % xx to do this right, we have to translate 8-bit characters to
+ % their "best" equivalent, based on the @documentencoding. Right
+ % now, I guess we'll just let the pdf reader have its way.
+ \indexnofonts
+ \setupdatafile
+ \catcode`\\=\active \otherbackslash
+ \input \jobname.toc
+ \endgroup
+ }
+ %
+ \def\skipspaces#1{\def\PP{#1}\def\D{|}%
+ \ifx\PP\D\let\nextsp\relax
+ \else\let\nextsp\skipspaces
+ \ifx\p\space\else\addtokens{\filename}{\PP}%
+ \advance\filenamelength by 1
+ \fi
+ \fi
+ \nextsp}
+ \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
+ \ifnum\pdftexversion < 14
+ \let \startlink \pdfannotlink
+ \else
+ \let \startlink \pdfstartlink
+ \fi
+ % make a live url in pdf output.
+ \def\pdfurl#1{%
+ \begingroup
+ % it seems we really need yet another set of dummies; have not
+ % tried to figure out what each command should do in the context
+ % of @url. for now, just make @/ a no-op, that's the only one
+ % people have actually reported a problem with.
+ %
+ \normalturnoffactive
+ \def\@{@}%
+ \let\/=\empty
+ \makevalueexpandable
+ \leavevmode\urlcolor
+ \startlink attr{/Border [0 0 0]}%
+ user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
+ \endgroup}
+ \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
+ \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
+ \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
+ \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
+ \def\maketoks{%
+ \expandafter\poptoks\the\toksA|ENDTOKS|\relax
+ \ifx\first0\adn0
+ \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
+ \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
+ \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
+ \else
+ \ifnum0=\countA\else\makelink\fi
+ \ifx\first.\let\next=\done\else
+ \let\next=\maketoks
+ \addtokens{\toksB}{\the\toksD}
+ \ifx\first,\addtokens{\toksB}{\space}\fi
+ \fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \next}
+ \def\makelink{\addtokens{\toksB}%
+ {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
+ \def\pdflink#1{%
+ \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
+ \linkcolor #1\endlink}
+ \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
+\else
+ \let\pdfmkdest = \gobble
+ \let\pdfurl = \gobble
+ \let\endlink = \relax
+ \let\linkcolor = \relax
+ \let\pdfmakeoutlines = \relax
+\fi % \ifx\pdfoutput
+
+
+\message{fonts,}
+
+% Change the current font style to #1, remembering it in \curfontstyle.
+% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
+% italics, not bold italics.
+%
+\def\setfontstyle#1{%
+ \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
+ \csname ten#1\endcsname % change the current font
+}
+
+% Select #1 fonts with the current style.
+%
+\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
+
+\def\rm{\fam=0 \setfontstyle{rm}}
+\def\it{\fam=\itfam \setfontstyle{it}}
+\def\sl{\fam=\slfam \setfontstyle{sl}}
+\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
+\def\tt{\fam=\ttfam \setfontstyle{tt}}
+
+% Texinfo sort of supports the sans serif font style, which plain TeX does not.
+% So we set up a \sf.
+\newfam\sffam
+\def\sf{\fam=\sffam \setfontstyle{sf}}
+\let\li = \sf % Sometimes we call it \li, not \sf.
+
+% We don't need math for this font style.
+\def\ttsl{\setfontstyle{ttsl}}
+
+
+% Default leading.
+\newdimen\textleading \textleading = 13.2pt
+
+% Set the baselineskip to #1, and the lineskip and strut size
+% correspondingly. There is no deep meaning behind these magic numbers
+% used as factors; they just match (closely enough) what Knuth defined.
+%
+\def\lineskipfactor{.08333}
+\def\strutheightpercent{.70833}
+\def\strutdepthpercent {.29167}
+%
+\def\setleading#1{%
+ \normalbaselineskip = #1\relax
+ \normallineskip = \lineskipfactor\normalbaselineskip
+ \normalbaselines
+ \setbox\strutbox =\hbox{%
+ \vrule width0pt height\strutheightpercent\baselineskip
+ depth \strutdepthpercent \baselineskip
+ }%
+}
+
+%
+% PDF CMaps. See also LaTeX's t1.cmap.
+%
+% \cmapOT1
+\ifpdf
+ \begingroup
+ \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
+ \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-OT1-0)
+%%Title: (TeX-OT1-0 TeX OT1 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (OT1)
+/Supplement 0
+>> def
+/CMapName /TeX-OT1-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <7F>
+endcodespacerange
+8 beginbfrange
+<00> <01> <0393>
+<09> <0A> <03A8>
+<23> <26> <0023>
+<28> <3B> <0028>
+<3F> <5B> <003F>
+<5D> <5E> <005D>
+<61> <7A> <0061>
+<7B> <7C> <2013>
+endbfrange
+40 beginbfchar
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<07> <03D2>
+<08> <03A6>
+<0B> <00660066>
+<0C> <00660069>
+<0D> <0066006C>
+<0E> <006600660069>
+<0F> <00660066006C>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<21> <0021>
+<22> <201D>
+<27> <2019>
+<3C> <00A1>
+<3D> <003D>
+<3E> <00BF>
+<5C> <201C>
+<5F> <02D9>
+<60> <2018>
+<7D> <02DD>
+<7E> <007E>
+<7F> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+ }\endgroup
+ \expandafter\edef\csname cmapOT1\endcsname#1{%
+ \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
+ }%
+%
+% \cmapOT1IT
+ \begingroup
+ \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
+ \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-OT1IT-0)
+%%Title: (TeX-OT1IT-0 TeX OT1IT 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (OT1IT)
+/Supplement 0
+>> def
+/CMapName /TeX-OT1IT-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <7F>
+endcodespacerange
+8 beginbfrange
+<00> <01> <0393>
+<09> <0A> <03A8>
+<25> <26> <0025>
+<28> <3B> <0028>
+<3F> <5B> <003F>
+<5D> <5E> <005D>
+<61> <7A> <0061>
+<7B> <7C> <2013>
+endbfrange
+42 beginbfchar
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<07> <03D2>
+<08> <03A6>
+<0B> <00660066>
+<0C> <00660069>
+<0D> <0066006C>
+<0E> <006600660069>
+<0F> <00660066006C>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<21> <0021>
+<22> <201D>
+<23> <0023>
+<24> <00A3>
+<27> <2019>
+<3C> <00A1>
+<3D> <003D>
+<3E> <00BF>
+<5C> <201C>
+<5F> <02D9>
+<60> <2018>
+<7D> <02DD>
+<7E> <007E>
+<7F> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+ }\endgroup
+ \expandafter\edef\csname cmapOT1IT\endcsname#1{%
+ \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
+ }%
+%
+% \cmapOT1TT
+ \begingroup
+ \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
+ \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-OT1TT-0)
+%%Title: (TeX-OT1TT-0 TeX OT1TT 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (OT1TT)
+/Supplement 0
+>> def
+/CMapName /TeX-OT1TT-0 def
+/CMapType 2 def
+1 begincodespacerange
+<00> <7F>
+endcodespacerange
+5 beginbfrange
+<00> <01> <0393>
+<09> <0A> <03A8>
+<21> <26> <0021>
+<28> <5F> <0028>
+<61> <7E> <0061>
+endbfrange
+32 beginbfchar
+<02> <0398>
+<03> <039B>
+<04> <039E>
+<05> <03A0>
+<06> <03A3>
+<07> <03D2>
+<08> <03A6>
+<0B> <2191>
+<0C> <2193>
+<0D> <0027>
+<0E> <00A1>
+<0F> <00BF>
+<10> <0131>
+<11> <0237>
+<12> <0060>
+<13> <00B4>
+<14> <02C7>
+<15> <02D8>
+<16> <00AF>
+<17> <02DA>
+<18> <00B8>
+<19> <00DF>
+<1A> <00E6>
+<1B> <0153>
+<1C> <00F8>
+<1D> <00C6>
+<1E> <0152>
+<1F> <00D8>
+<20> <2423>
+<27> <2019>
+<60> <2018>
+<7F> <00A8>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+ }\endgroup
+ \expandafter\edef\csname cmapOT1TT\endcsname#1{%
+ \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
+ }%
+\else
+ \expandafter\let\csname cmapOT1\endcsname\gobble
+ \expandafter\let\csname cmapOT1IT\endcsname\gobble
+ \expandafter\let\csname cmapOT1TT\endcsname\gobble
+\fi
+
+
+% Set the font macro #1 to the font named #2, adding on the
+% specified font prefix (normally `cm').
+% #3 is the font's design size, #4 is a scale factor, #5 is the CMap
+% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
+% empty to omit).
+\def\setfont#1#2#3#4#5{%
+ \font#1=\fontprefix#2#3 scaled #4
+ \csname cmap#5\endcsname#1%
+}
+% This is what gets called when #5 of \setfont is empty.
+\let\cmap\gobble
+
+
+% Use cm as the default font prefix.
+% To specify the font prefix, you must define \fontprefix
+% before you read in texinfo.tex.
+\ifx\fontprefix\undefined
+\def\fontprefix{cm}
+\fi
+% Support font families that don't use the same naming scheme as CM.
+\def\rmshape{r}
+\def\rmbshape{bx} %where the normal face is bold
+\def\bfshape{b}
+\def\bxshape{bx}
+\def\ttshape{tt}
+\def\ttbshape{tt}
+\def\ttslshape{sltt}
+\def\itshape{ti}
+\def\itbshape{bxti}
+\def\slshape{sl}
+\def\slbshape{bxsl}
+\def\sfshape{ss}
+\def\sfbshape{ss}
+\def\scshape{csc}
+\def\scbshape{csc}
+
+% Definitions for a main text size of 11pt. This is the default in
+% Texinfo.
+%
+\def\definetextfontsizexi{%
+% Text fonts (11.2pt, magstep1).
+\def\textnominalsize{11pt}
+\edef\mainmagstep{\magstephalf}
+\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
+\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
+\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
+\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
+\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
+\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
+\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+
+% A few fonts for @defun names and args.
+\setfont\defbf\bfshape{10}{\magstep1}{OT1}
+\setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
+\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
+
+% Fonts for indices, footnotes, small examples (9pt).
+\def\smallnominalsize{9pt}
+\setfont\smallrm\rmshape{9}{1000}{OT1}
+\setfont\smalltt\ttshape{9}{1000}{OT1TT}
+\setfont\smallbf\bfshape{10}{900}{OT1}
+\setfont\smallit\itshape{9}{1000}{OT1IT}
+\setfont\smallsl\slshape{9}{1000}{OT1}
+\setfont\smallsf\sfshape{9}{1000}{OT1}
+\setfont\smallsc\scshape{10}{900}{OT1}
+\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
+
+% Fonts for small examples (8pt).
+\def\smallernominalsize{8pt}
+\setfont\smallerrm\rmshape{8}{1000}{OT1}
+\setfont\smallertt\ttshape{8}{1000}{OT1TT}
+\setfont\smallerbf\bfshape{10}{800}{OT1}
+\setfont\smallerit\itshape{8}{1000}{OT1IT}
+\setfont\smallersl\slshape{8}{1000}{OT1}
+\setfont\smallersf\sfshape{8}{1000}{OT1}
+\setfont\smallersc\scshape{10}{800}{OT1}
+\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
+\font\smalleri=cmmi8
+\font\smallersy=cmsy8
+
+% Fonts for title page (20.4pt):
+\def\titlenominalsize{20pt}
+\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
+\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
+\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
+\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
+\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
+\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\authorrm{\secrm}
+\def\authortt{\sectt}
+
+% Chapter (and unnumbered) fonts (17.28pt).
+\def\chapnominalsize{17pt}
+\setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
+\setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
+\setfont\chapsl\slbshape{10}{\magstep3}{OT1}
+\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
+\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
+\setfont\chapsf\sfbshape{17}{1000}{OT1}
+\let\chapbf=\chaprm
+\setfont\chapsc\scbshape{10}{\magstep3}{OT1}
+\font\chapi=cmmi12 scaled \magstep2
+\font\chapsy=cmsy10 scaled \magstep3
+
+% Section fonts (14.4pt).
+\def\secnominalsize{14pt}
+\setfont\secrm\rmbshape{12}{\magstep1}{OT1}
+\setfont\secit\itbshape{10}{\magstep2}{OT1IT}
+\setfont\secsl\slbshape{10}{\magstep2}{OT1}
+\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
+\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
+\setfont\secsf\sfbshape{12}{\magstep1}{OT1}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep2}{OT1}
+\font\seci=cmmi12 scaled \magstep1
+\font\secsy=cmsy10 scaled \magstep2
+
+% Subsection fonts (13.15pt).
+\def\ssecnominalsize{13pt}
+\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
+\setfont\ssecit\itbshape{10}{1315}{OT1IT}
+\setfont\ssecsl\slbshape{10}{1315}{OT1}
+\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
+\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
+\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{1315}{OT1}
+\font\sseci=cmmi12 scaled \magstephalf
+\font\ssecsy=cmsy10 scaled 1315
+
+% Reduced fonts for @acro in text (10pt).
+\def\reducednominalsize{10pt}
+\setfont\reducedrm\rmshape{10}{1000}{OT1}
+\setfont\reducedtt\ttshape{10}{1000}{OT1TT}
+\setfont\reducedbf\bfshape{10}{1000}{OT1}
+\setfont\reducedit\itshape{10}{1000}{OT1IT}
+\setfont\reducedsl\slshape{10}{1000}{OT1}
+\setfont\reducedsf\sfshape{10}{1000}{OT1}
+\setfont\reducedsc\scshape{10}{1000}{OT1}
+\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
+\font\reducedi=cmmi10
+\font\reducedsy=cmsy10
+
+% reset the current fonts
+\textfonts
+\rm
+} % end of 11pt text font size definitions
+
+
+% Definitions to make the main text be 10pt Computer Modern, with
+% section, chapter, etc., sizes following suit. This is for the GNU
+% Press printing of the Emacs 22 manual. Maybe other manuals in the
+% future. Used with @smallbook, which sets the leading to 12pt.
+%
+\def\definetextfontsizex{%
+% Text fonts (10pt).
+\def\textnominalsize{10pt}
+\edef\mainmagstep{1000}
+\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
+\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
+\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
+\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
+\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
+\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
+\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
+\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
+\font\texti=cmmi10 scaled \mainmagstep
+\font\textsy=cmsy10 scaled \mainmagstep
+
+% A few fonts for @defun names and args.
+\setfont\defbf\bfshape{10}{\magstephalf}{OT1}
+\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
+\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
+\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
+
+% Fonts for indices, footnotes, small examples (9pt).
+\def\smallnominalsize{9pt}
+\setfont\smallrm\rmshape{9}{1000}{OT1}
+\setfont\smalltt\ttshape{9}{1000}{OT1TT}
+\setfont\smallbf\bfshape{10}{900}{OT1}
+\setfont\smallit\itshape{9}{1000}{OT1IT}
+\setfont\smallsl\slshape{9}{1000}{OT1}
+\setfont\smallsf\sfshape{9}{1000}{OT1}
+\setfont\smallsc\scshape{10}{900}{OT1}
+\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
+\font\smalli=cmmi9
+\font\smallsy=cmsy9
+
+% Fonts for small examples (8pt).
+\def\smallernominalsize{8pt}
+\setfont\smallerrm\rmshape{8}{1000}{OT1}
+\setfont\smallertt\ttshape{8}{1000}{OT1TT}
+\setfont\smallerbf\bfshape{10}{800}{OT1}
+\setfont\smallerit\itshape{8}{1000}{OT1IT}
+\setfont\smallersl\slshape{8}{1000}{OT1}
+\setfont\smallersf\sfshape{8}{1000}{OT1}
+\setfont\smallersc\scshape{10}{800}{OT1}
+\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
+\font\smalleri=cmmi8
+\font\smallersy=cmsy8
+
+% Fonts for title page (20.4pt):
+\def\titlenominalsize{20pt}
+\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
+\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
+\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
+\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
+\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
+\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
+\let\titlebf=\titlerm
+\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
+\font\titlei=cmmi12 scaled \magstep3
+\font\titlesy=cmsy10 scaled \magstep4
+\def\authorrm{\secrm}
+\def\authortt{\sectt}
+
+% Chapter fonts (14.4pt).
+\def\chapnominalsize{14pt}
+\setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
+\setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
+\setfont\chapsl\slbshape{10}{\magstep2}{OT1}
+\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
+\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
+\setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
+\let\chapbf\chaprm
+\setfont\chapsc\scbshape{10}{\magstep2}{OT1}
+\font\chapi=cmmi12 scaled \magstep1
+\font\chapsy=cmsy10 scaled \magstep2
+
+% Section fonts (12pt).
+\def\secnominalsize{12pt}
+\setfont\secrm\rmbshape{12}{1000}{OT1}
+\setfont\secit\itbshape{10}{\magstep1}{OT1IT}
+\setfont\secsl\slbshape{10}{\magstep1}{OT1}
+\setfont\sectt\ttbshape{12}{1000}{OT1TT}
+\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
+\setfont\secsf\sfbshape{12}{1000}{OT1}
+\let\secbf\secrm
+\setfont\secsc\scbshape{10}{\magstep1}{OT1}
+\font\seci=cmmi12
+\font\secsy=cmsy10 scaled \magstep1
+
+% Subsection fonts (10pt).
+\def\ssecnominalsize{10pt}
+\setfont\ssecrm\rmbshape{10}{1000}{OT1}
+\setfont\ssecit\itbshape{10}{1000}{OT1IT}
+\setfont\ssecsl\slbshape{10}{1000}{OT1}
+\setfont\ssectt\ttbshape{10}{1000}{OT1TT}
+\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
+\setfont\ssecsf\sfbshape{10}{1000}{OT1}
+\let\ssecbf\ssecrm
+\setfont\ssecsc\scbshape{10}{1000}{OT1}
+\font\sseci=cmmi10
+\font\ssecsy=cmsy10
+
+% Reduced fonts for @acro in text (9pt).
+\def\reducednominalsize{9pt}
+\setfont\reducedrm\rmshape{9}{1000}{OT1}
+\setfont\reducedtt\ttshape{9}{1000}{OT1TT}
+\setfont\reducedbf\bfshape{10}{900}{OT1}
+\setfont\reducedit\itshape{9}{1000}{OT1IT}
+\setfont\reducedsl\slshape{9}{1000}{OT1}
+\setfont\reducedsf\sfshape{9}{1000}{OT1}
+\setfont\reducedsc\scshape{10}{900}{OT1}
+\setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
+\font\reducedi=cmmi9
+\font\reducedsy=cmsy9
+
+% reduce space between paragraphs
+\divide\parskip by 2
+
+% reset the current fonts
+\textfonts
+\rm
+} % end of 10pt text font size definitions
+
+
+% We provide the user-level command
+% @fonttextsize 10
+% (or 11) to redefine the text font size. pt is assumed.
+%
+\def\xword{10}
+\def\xiword{11}
+%
+\parseargdef\fonttextsize{%
+ \def\textsizearg{#1}%
+ \wlog{doing @fonttextsize \textsizearg}%
+ %
+ % Set \globaldefs so that documents can use this inside @tex, since
+ % makeinfo 4.8 does not support it, but we need it nonetheless.
+ %
+ \begingroup \globaldefs=1
+ \ifx\textsizearg\xword \definetextfontsizex
+ \else \ifx\textsizearg\xiword \definetextfontsizexi
+ \else
+ \errhelp=\EMsimple
+ \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
+ \fi\fi
+ \endgroup
+}
+
+
+% In order for the font changes to affect most math symbols and letters,
+% we have to define the \textfont of the standard families. Since
+% texinfo doesn't allow for producing subscripts and superscripts except
+% in the main text, we don't bother to reset \scriptfont and
+% \scriptscriptfont (which would also require loading a lot more fonts).
+%
+\def\resetmathfonts{%
+ \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
+ \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
+ \textfont\ttfam=\tentt \textfont\sffam=\tensf
+}
+
+% The font-changing commands redefine the meanings of \tenSTYLE, instead
+% of just \STYLE. We do this because \STYLE needs to also set the
+% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
+% \tenSTYLE to set the current font.
+%
+% Each font-changing command also sets the names \lsize (one size lower)
+% and \lllsize (three sizes lower). These relative commands are used in
+% the LaTeX logo and acronyms.
+%
+% This all needs generalizing, badly.
+%
+\def\textfonts{%
+ \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
+ \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
+ \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
+ \let\tenttsl=\textttsl
+ \def\curfontsize{text}%
+ \def\lsize{reduced}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{\textleading}}
+\def\titlefonts{%
+ \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
+ \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
+ \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
+ \let\tenttsl=\titlettsl
+ \def\curfontsize{title}%
+ \def\lsize{chap}\def\lllsize{subsec}%
+ \resetmathfonts \setleading{25pt}}
+\def\titlefont#1{{\titlefonts\rm #1}}
+\def\chapfonts{%
+ \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
+ \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
+ \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
+ \let\tenttsl=\chapttsl
+ \def\curfontsize{chap}%
+ \def\lsize{sec}\def\lllsize{text}%
+ \resetmathfonts \setleading{19pt}}
+\def\secfonts{%
+ \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
+ \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
+ \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
+ \let\tenttsl=\secttsl
+ \def\curfontsize{sec}%
+ \def\lsize{subsec}\def\lllsize{reduced}%
+ \resetmathfonts \setleading{16pt}}
+\def\subsecfonts{%
+ \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
+ \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
+ \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
+ \let\tenttsl=\ssecttsl
+ \def\curfontsize{ssec}%
+ \def\lsize{text}\def\lllsize{small}%
+ \resetmathfonts \setleading{15pt}}
+\let\subsubsecfonts = \subsecfonts
+\def\reducedfonts{%
+ \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
+ \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
+ \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
+ \let\tenttsl=\reducedttsl
+ \def\curfontsize{reduced}%
+ \def\lsize{small}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{10.5pt}}
+\def\smallfonts{%
+ \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
+ \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
+ \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
+ \let\tenttsl=\smallttsl
+ \def\curfontsize{small}%
+ \def\lsize{smaller}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{10.5pt}}
+\def\smallerfonts{%
+ \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
+ \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
+ \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
+ \let\tenttsl=\smallerttsl
+ \def\curfontsize{smaller}%
+ \def\lsize{smaller}\def\lllsize{smaller}%
+ \resetmathfonts \setleading{9.5pt}}
+
+% Set the fonts to use with the @small... environments.
+\let\smallexamplefonts = \smallfonts
+
+% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
+% can fit this many characters:
+% 8.5x11=86 smallbook=72 a4=90 a5=69
+% If we use \scriptfonts (8pt), then we can fit this many characters:
+% 8.5x11=90+ smallbook=80 a4=90+ a5=77
+% For me, subjectively, the few extra characters that fit aren't worth
+% the additional smallness of 8pt. So I'm making the default 9pt.
+%
+% By the way, for comparison, here's what fits with @example (10pt):
+% 8.5x11=71 smallbook=60 a4=75 a5=58
+%
+% I wish the USA used A4 paper.
+% --karl, 24jan03.
+
+
+% Set up the default fonts, so we can use them for creating boxes.
+%
+\definetextfontsizexi
+
+% Define these so they can be easily changed for other fonts.
+\def\angleleft{$\langle$}
+\def\angleright{$\rangle$}
+
+% Count depth in font-changes, for error checks
+\newcount\fontdepth \fontdepth=0
+
+% Fonts for short table of contents.
+\setfont\shortcontrm\rmshape{12}{1000}{OT1}
+\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
+\setfont\shortcontsl\slshape{12}{1000}{OT1}
+\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
+
+%% Add scribe-like font environments, plus @l for inline lisp (usually sans
+%% serif) and @ii for TeX italic
+
+% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
+% unless the following character is such as not to need one.
+\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else
+ \ptexslash\fi\fi\fi}
+\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
+\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
+
+% like \smartslanted except unconditionally uses \ttsl.
+% @var is set to this for defun arguments.
+\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx}
+
+% like \smartslanted except unconditionally use \sl. We never want
+% ttsl for book titles, do we?
+\def\cite#1{{\sl #1}\futurelet\next\smartitalicx}
+
+\let\i=\smartitalic
+\let\slanted=\smartslanted
+\let\var=\smartslanted
+\let\dfn=\smartslanted
+\let\emph=\smartitalic
+
+% @b, explicit bold.
+\def\b#1{{\bf #1}}
+\let\strong=\b
+
+% @sansserif, explicit sans.
+\def\sansserif#1{{\sf #1}}
+
+% We can't just use \exhyphenpenalty, because that only has effect at
+% the end of a paragraph. Restore normal hyphenation at the end of the
+% group within which \nohyphenation is presumably called.
+%
+\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
+\def\restorehyphenation{\hyphenchar\font = `- }
+
+% Set sfcode to normal for the chars that usually have another value.
+% Can't use plain's \frenchspacing because it uses the `\x notation, and
+% sometimes \x has an active definition that messes things up.
+%
+\catcode`@=11
+ \def\plainfrenchspacing{%
+ \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
+ \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
+ \def\endofsentencespacefactor{1000}% for @. and friends
+ }
+ \def\plainnonfrenchspacing{%
+ \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
+ \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
+ \def\endofsentencespacefactor{3000}% for @. and friends
+ }
+\catcode`@=\other
+\def\endofsentencespacefactor{3000}% default
+
+\def\t#1{%
+ {\tt \rawbackslash \plainfrenchspacing #1}%
+ \null
+}
+\def\samp#1{`\tclose{#1}'\null}
+\setfont\keyrm\rmshape{8}{1000}{OT1}
+\font\keysy=cmsy9
+\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
+ \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
+ \vbox{\hrule\kern-0.4pt
+ \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
+ \kern-0.4pt\hrule}%
+ \kern-.06em\raise0.4pt\hbox{\angleright}}}}
+\def\key #1{{\nohyphenation \uppercase{#1}}\null}
+% The old definition, with no lozenge:
+%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
+\def\ctrl #1{{\tt \rawbackslash \hat}#1}
+
+% @file, @option are the same as @samp.
+\let\file=\samp
+\let\option=\samp
+
+% @code is a modification of @t,
+% which makes spaces the same size as normal in the surrounding text.
+\def\tclose#1{%
+ {%
+ % Change normal interword space to be same as for the current font.
+ \spaceskip = \fontdimen2\font
+ %
+ % Switch to typewriter.
+ \tt
+ %
+ % But `\ ' produces the large typewriter interword space.
+ \def\ {{\spaceskip = 0pt{} }}%
+ %
+ % Turn off hyphenation.
+ \nohyphenation
+ %
+ \rawbackslash
+ \plainfrenchspacing
+ #1%
+ }%
+ \null
+}
+
+% We *must* turn on hyphenation at `-' and `_' in @code.
+% Otherwise, it is too hard to avoid overfull hboxes
+% in the Emacs manual, the Library manual, etc.
+
+% Unfortunately, TeX uses one parameter (\hyphenchar) to control
+% both hyphenation at - and hyphenation within words.
+% We must therefore turn them both off (\tclose does that)
+% and arrange explicitly to hyphenate at a dash.
+% -- rms.
+{
+ \catcode`\-=\active \catcode`\_=\active
+ \catcode`\'=\active \catcode`\`=\active
+ %
+ \global\def\code{\begingroup
+ \catcode\rquoteChar=\active \catcode\lquoteChar=\active
+ \let'\codequoteright \let`\codequoteleft
+ %
+ \catcode\dashChar=\active \catcode\underChar=\active
+ \ifallowcodebreaks
+ \let-\codedash
+ \let_\codeunder
+ \else
+ \let-\realdash
+ \let_\realunder
+ \fi
+ \codex
+ }
+}
+
+\def\realdash{-}
+\def\codedash{-\discretionary{}{}{}}
+\def\codeunder{%
+ % this is all so @math{@code{var_name}+1} can work. In math mode, _
+ % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
+ % will therefore expand the active definition of _, which is us
+ % (inside @code that is), therefore an endless loop.
+ \ifusingtt{\ifmmode
+ \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
+ \else\normalunderscore \fi
+ \discretionary{}{}{}}%
+ {\_}%
+}
+\def\codex #1{\tclose{#1}\endgroup}
+
+% An additional complication: the above will allow breaks after, e.g.,
+% each of the four underscores in __typeof__. This is undesirable in
+% some manuals, especially if they don't have long identifiers in
+% general. @allowcodebreaks provides a way to control this.
+%
+\newif\ifallowcodebreaks \allowcodebreakstrue
+
+\def\keywordtrue{true}
+\def\keywordfalse{false}
+
+\parseargdef\allowcodebreaks{%
+ \def\txiarg{#1}%
+ \ifx\txiarg\keywordtrue
+ \allowcodebreakstrue
+ \else\ifx\txiarg\keywordfalse
+ \allowcodebreaksfalse
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @allowcodebreaks option `\txiarg'}%
+ \fi\fi
+}
+
+% @kbd is like @code, except that if the argument is just one @key command,
+% then @kbd has no effect.
+
+% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
+% `example' (@kbd uses ttsl only inside of @example and friends),
+% or `code' (@kbd uses normal tty font always).
+\parseargdef\kbdinputstyle{%
+ \def\txiarg{#1}%
+ \ifx\txiarg\worddistinct
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
+ \else\ifx\txiarg\wordexample
+ \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
+ \else\ifx\txiarg\wordcode
+ \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+ \else
+ \errhelp = \EMsimple
+ \errmessage{Unknown @kbdinputstyle option `\txiarg'}%
+ \fi\fi\fi
+}
+\def\worddistinct{distinct}
+\def\wordexample{example}
+\def\wordcode{code}
+
+% Default is `distinct.'
+\kbdinputstyle distinct
+
+\def\xkey{\key}
+\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
+\ifx\one\xkey\ifx\threex\three \key{#2}%
+\else{\tclose{\kbdfont\look}}\fi
+\else{\tclose{\kbdfont\look}}\fi}
+
+% For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
+\let\indicateurl=\code
+\let\env=\code
+\let\command=\code
+
+% @uref (abbreviation for `urlref') takes an optional (comma-separated)
+% second argument specifying the text to display and an optional third
+% arg as text to display instead of (rather than in addition to) the url
+% itself. First (mandatory) arg is the url. Perhaps eventually put in
+% a hypertex \special here.
+%
+\def\uref#1{\douref #1,,,\finish}
+\def\douref#1,#2,#3,#4\finish{\begingroup
+ \unsepspaces
+ \pdfurl{#1}%
+ \setbox0 = \hbox{\ignorespaces #3}%
+ \ifdim\wd0 > 0pt
+ \unhbox0 % third arg given, show only that
+ \else
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0 > 0pt
+ \ifpdf
+ \unhbox0 % PDF: 2nd arg given, show only it
+ \else
+ \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
+ \fi
+ \else
+ \code{#1}% only url given, so show it
+ \fi
+ \fi
+ \endlink
+\endgroup}
+
+% @url synonym for @uref, since that's how everyone uses it.
+%
+\let\url=\uref
+
+% rms does not like angle brackets --karl, 17may97.
+% So now @email is just like @uref, unless we are pdf.
+%
+%\def\email#1{\angleleft{\tt #1}\angleright}
+\ifpdf
+ \def\email#1{\doemail#1,,\finish}
+ \def\doemail#1,#2,#3\finish{\begingroup
+ \unsepspaces
+ \pdfurl{mailto:#1}%
+ \setbox0 = \hbox{\ignorespaces #2}%
+ \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
+ \endlink
+ \endgroup}
+\else
+ \let\email=\uref
+\fi
+
+% Check if we are currently using a typewriter font. Since all the
+% Computer Modern typewriter fonts have zero interword stretch (and
+% shrink), and it is reasonable to expect all typewriter fonts to have
+% this property, we can check that font parameter.
+%
+\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
+
+% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
+% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
+%
+\def\dmn#1{\thinspace #1}
+
+\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
+
+% @l was never documented to mean ``switch to the Lisp font'',
+% and it is not used as such in any manual I can find. We need it for
+% Polish suppressed-l. --karl, 22sep96.
+%\def\l#1{{\li #1}\null}
+
+% Explicit font changes: @r, @sc, undocumented @ii.
+\def\r#1{{\rm #1}} % roman font
+\def\sc#1{{\smallcaps#1}} % smallcaps font
+\def\ii#1{{\it #1}} % italic font
+
+% @acronym for "FBI", "NATO", and the like.
+% We print this one point size smaller, since it's intended for
+% all-uppercase.
+%
+\def\acronym#1{\doacronym #1,,\finish}
+\def\doacronym#1,#2,#3\finish{%
+ {\selectfonts\lsize #1}%
+ \def\temp{#2}%
+ \ifx\temp\empty \else
+ \space ({\unsepspaces \ignorespaces \temp \unskip})%
+ \fi
+}
+
+% @abbr for "Comput. J." and the like.
+% No font change, but don't do end-of-sentence spacing.
+%
+\def\abbr#1{\doabbr #1,,\finish}
+\def\doabbr#1,#2,#3\finish{%
+ {\plainfrenchspacing #1}%
+ \def\temp{#2}%
+ \ifx\temp\empty \else
+ \space ({\unsepspaces \ignorespaces \temp \unskip})%
+ \fi
+}
+
+% @pounds{} is a sterling sign, which Knuth put in the CM italic font.
+%
+\def\pounds{{\it\$}}
+
+% @euro{} comes from a separate font, depending on the current style.
+% We use the free feym* fonts from the eurosym package by Henrik
+% Theiling, which support regular, slanted, bold and bold slanted (and
+% "outlined" (blackboard board, sort of) versions, which we don't need).
+% It is available from https://www.ctan.org/tex-archive/fonts/eurosym.
+%
+% Although only regular is the truly official Euro symbol, we ignore
+% that. The Euro is designed to be slightly taller than the regular
+% font height.
+%
+% feymr - regular
+% feymo - slanted
+% feybr - bold
+% feybo - bold slanted
+%
+% There is no good (free) typewriter version, to my knowledge.
+% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
+% Hmm.
+%
+% Also doesn't work in math. Do we need to do math with euro symbols?
+% Hope not.
+%
+%
+\def\euro{{\eurofont e}}
+\def\eurofont{%
+ % We set the font at each command, rather than predefining it in
+ % \textfonts and the other font-switching commands, so that
+ % installations which never need the symbol don't have to have the
+ % font installed.
+ %
+ % There is only one designed size (nominal 10pt), so we always scale
+ % that to the current nominal size.
+ %
+ % By the way, simply using "at 1em" works for cmr10 and the like, but
+ % does not work for cmbx10 and other extended/shrunken fonts.
+ %
+ \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
+ %
+ \ifx\curfontstyle\bfstylename
+ % bold:
+ \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
+ \else
+ % regular:
+ \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
+ \fi
+ \thiseurofont
+}
+
+% @registeredsymbol - R in a circle. The font for the R should really
+% be smaller yet, but lllsize is the best we can do for now.
+% Adapted from the plain.tex definition of \copyright.
+%
+\def\registeredsymbol{%
+ $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
+ \hfil\crcr\Orb}}%
+ }$%
+}
+
+% @textdegree - the normal degrees sign.
+%
+\def\textdegree{$^\circ$}
+
+% Laurent Siebenmann reports \Orb undefined with:
+% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
+% so we'll define it if necessary.
+%
+\ifx\Orb\undefined
+\def\Orb{\mathhexbox20D}
+\fi
+
+
+\message{page headings,}
+
+\newskip\titlepagetopglue \titlepagetopglue = 1.5in
+\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
+
+% First the title page. Must do @settitle before @titlepage.
+\newif\ifseenauthor
+\newif\iffinishedtitlepage
+
+% Do an implicit @contents or @shortcontents after @end titlepage if the
+% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
+%
+\newif\ifsetcontentsaftertitlepage
+ \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
+\newif\ifsetshortcontentsaftertitlepage
+ \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
+
+\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
+ \endgroup\page\hbox{}\page}
+
+\envdef\titlepage{%
+ % Open one extra group, as we want to close it in the middle of \Etitlepage.
+ \begingroup
+ \parindent=0pt \textfonts
+ % Leave some space at the very top of the page.
+ \vglue\titlepagetopglue
+ % No rule at page bottom unless we print one at the top with @title.
+ \finishedtitlepagetrue
+ %
+ % Most title ``pages'' are actually two pages long, with space
+ % at the top of the second. We don't want the ragged left on the second.
+ \let\oldpage = \page
+ \def\page{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ \let\page = \oldpage
+ \page
+ \null
+ }%
+}
+
+\def\Etitlepage{%
+ \iffinishedtitlepage\else
+ \finishtitlepage
+ \fi
+ % It is important to do the page break before ending the group,
+ % because the headline and footline are only empty inside the group.
+ % If we use the new definition of \page, we always get a blank page
+ % after the title page, which we certainly don't want.
+ \oldpage
+ \endgroup
+ %
+ % Need this before the \...aftertitlepage checks so that if they are
+ % in effect the toc pages will come out with page numbers.
+ \HEADINGSon
+ %
+ % If they want short, they certainly want long too.
+ \ifsetshortcontentsaftertitlepage
+ \shortcontents
+ \contents
+ \global\let\shortcontents = \relax
+ \global\let\contents = \relax
+ \fi
+ %
+ \ifsetcontentsaftertitlepage
+ \contents
+ \global\let\contents = \relax
+ \global\let\shortcontents = \relax
+ \fi
+}
+
+\def\finishtitlepage{%
+ \vskip4pt \hrule height 2pt width \hsize
+ \vskip\titlepagebottomglue
+ \finishedtitlepagetrue
+}
+
+%%% Macros to be used within @titlepage:
+
+\let\subtitlerm=\tenrm
+\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
+
+\def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines
+ \let\tt=\authortt}
+
+\parseargdef\title{%
+ \checkenv\titlepage
+ \leftline{\titlefonts\rm #1}
+ % print a rule at the page bottom also.
+ \finishedtitlepagefalse
+ \vskip4pt \hrule height 4pt width \hsize \vskip4pt
+}
+
+\parseargdef\subtitle{%
+ \checkenv\titlepage
+ {\subtitlefont \rightline{#1}}%
+}
+
+% @author should come last, but may come many times.
+% It can also be used inside @quotation.
+%
+\parseargdef\author{%
+ \def\temp{\quotation}%
+ \ifx\thisenv\temp
+ \def\quotationauthor{#1}% printed in \Equotation.
+ \else
+ \checkenv\titlepage
+ \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
+ {\authorfont \leftline{#1}}%
+ \fi
+}
+
+
+%%% Set up page headings and footings.
+
+\let\thispage=\folio
+
+\newtoks\evenheadline % headline on even pages
+\newtoks\oddheadline % headline on odd pages
+\newtoks\evenfootline % footline on even pages
+\newtoks\oddfootline % footline on odd pages
+
+% Now make TeX use those variables
+\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
+ \else \the\evenheadline \fi}}
+\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
+ \else \the\evenfootline \fi}\HEADINGShook}
+\let\HEADINGShook=\relax
+
+% Commands to set those variables.
+% For example, this is what @headings on does
+% @evenheading @thistitle|@thispage|@thischapter
+% @oddheading @thischapter|@thispage|@thistitle
+% @evenfooting @thisfile||
+% @oddfooting ||@thisfile
+
+
+\def\evenheading{\parsearg\evenheadingxxx}
+\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
+\def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
+\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\def\oddheading{\parsearg\oddheadingxxx}
+\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
+\def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
+\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
+
+\def\evenfooting{\parsearg\evenfootingxxx}
+\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
+\def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
+\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+
+\def\oddfooting{\parsearg\oddfootingxxx}
+\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
+\def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
+ \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
+ %
+ % Leave some space for the footline. Hopefully ok to assume
+ % @evenfooting will not be used by itself.
+ \global\advance\pageheight by -12pt
+ \global\advance\vsize by -12pt
+}
+
+\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
+
+
+% @headings double turns headings on for double-sided printing.
+% @headings single turns headings on for single-sided printing.
+% @headings off turns them off.
+% @headings on same as @headings double, retained for compatibility.
+% @headings after turns on double-sided headings after this page.
+% @headings doubleafter turns on double-sided headings after this page.
+% @headings singleafter turns on single-sided headings after this page.
+% By default, they are off at the start of a document,
+% and turned `on' after @end titlepage.
+
+\def\headings #1 {\csname HEADINGS#1\endcsname}
+
+\def\HEADINGSoff{%
+\global\evenheadline={\hfil} \global\evenfootline={\hfil}
+\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
+\HEADINGSoff
+% When we turn headings on, set the page number to 1.
+% For double-sided printing, put current file name in lower left corner,
+% chapter name on inside top of right hand pages, document
+% title on inside top of left hand pages, and page numbers on outside top
+% edge of all pages.
+\def\HEADINGSdouble{%
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+\let\contentsalignmacro = \chappager
+
+% For single-sided printing, chapter title goes across top left of page,
+% page number on top right.
+\def\HEADINGSsingle{%
+\global\pageno=1
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+\def\HEADINGSon{\HEADINGSdouble}
+
+\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
+\let\HEADINGSdoubleafter=\HEADINGSafter
+\def\HEADINGSdoublex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\folio\hfil\thistitle}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chapoddpage
+}
+
+\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
+\def\HEADINGSsinglex{%
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+
+% Subroutines used in generating headings
+% This produces Day Month Year style of output.
+% Only define if not already defined, in case a txi-??.tex file has set
+% up a different format (e.g., txi-cs.tex does this).
+\ifx\today\undefined
+\def\today{%
+ \number\day\space
+ \ifcase\month
+ \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
+ \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
+ \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
+ \fi
+ \space\number\year}
+\fi
+
+% @settitle line... specifies the title of the document, for headings.
+% It generates no output of its own.
+\def\thistitle{\putwordNoTitle}
+\def\settitle{\parsearg{\gdef\thistitle}}
+
+
+\message{tables,}
+% Tables -- @table, @ftable, @vtable, @item(x).
+
+% default indentation of table text
+\newdimen\tableindent \tableindent=.8in
+% default indentation of @itemize and @enumerate text
+\newdimen\itemindent \itemindent=.3in
+% margin between end of table item and start of table text.
+\newdimen\itemmargin \itemmargin=.1in
+
+% used internally for \itemindent minus \itemmargin
+\newdimen\itemmax
+
+% Note @table, @ftable, and @vtable define @item, @itemx, etc., with
+% these defs.
+% They also define \itemindex
+% to index the item name in whatever manner is desired (perhaps none).
+
+\newif\ifitemxneedsnegativevskip
+
+\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
+
+\def\internalBitem{\smallbreak \parsearg\itemzzz}
+\def\internalBitemx{\itemxpar \parsearg\itemzzz}
+
+\def\itemzzz #1{\begingroup %
+ \advance\hsize by -\rightskip
+ \advance\hsize by -\tableindent
+ \setbox0=\hbox{\itemindicate{#1}}%
+ \itemindex{#1}%
+ \nobreak % This prevents a break before @itemx.
+ %
+ % If the item text does not fit in the space we have, put it on a line
+ % by itself, and do not allow a page break either before or after that
+ % line. We do not start a paragraph here because then if the next
+ % command is, e.g., @kindex, the whatsit would get put into the
+ % horizontal list on a line by itself, resulting in extra blank space.
+ \ifdim \wd0>\itemmax
+ %
+ % Make this a paragraph so we get the \parskip glue and wrapping,
+ % but leave it ragged-right.
+ \begingroup
+ \advance\leftskip by-\tableindent
+ \advance\hsize by\tableindent
+ \advance\rightskip by0pt plus1fil
+ \leavevmode\unhbox0\par
+ \endgroup
+ %
+ % We're going to be starting a paragraph, but we don't want the
+ % \parskip glue -- logically it's part of the @item we just started.
+ \nobreak \vskip-\parskip
+ %
+ % Stop a page break at the \parskip glue coming up. However, if
+ % what follows is an environment such as @example, there will be no
+ % \parskip glue; then the negative vskip we just inserted would
+ % cause the example and the item to crash together. So we use this
+ % bizarre value of 10001 as a signal to \aboveenvbreak to insert
+ % \parskip glue after all. Section titles are handled this way also.
+ %
+ \penalty 10001
+ \endgroup
+ \itemxneedsnegativevskipfalse
+ \else
+ % The item text fits into the space. Start a paragraph, so that the
+ % following text (if any) will end up on the same line.
+ \noindent
+ % Do this with kerns and \unhbox so that if there is a footnote in
+ % the item text, it can migrate to the main vertical list and
+ % eventually be printed.
+ \nobreak\kern-\tableindent
+ \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
+ \unhbox0
+ \nobreak\kern\dimen0
+ \endgroup
+ \itemxneedsnegativevskiptrue
+ \fi
+}
+
+\def\item{\errmessage{@item while not in a list environment}}
+\def\itemx{\errmessage{@itemx while not in a list environment}}
+
+% @table, @ftable, @vtable.
+\envdef\table{%
+ \let\itemindex\gobble
+ \tablecheck{table}%
+}
+\envdef\ftable{%
+ \def\itemindex ##1{\doind {fn}{\code{##1}}}%
+ \tablecheck{ftable}%
+}
+\envdef\vtable{%
+ \def\itemindex ##1{\doind {vr}{\code{##1}}}%
+ \tablecheck{vtable}%
+}
+\def\tablecheck#1{%
+ \ifnum \the\catcode`\^^M=\active
+ \endgroup
+ \errmessage{This command won't work in this context; perhaps the problem is
+ that we are \inenvironment\thisenv}%
+ \def\next{\doignore{#1}}%
+ \else
+ \let\next\tablex
+ \fi
+ \next
+}
+\def\tablex#1{%
+ \def\itemindicate{#1}%
+ \parsearg\tabley
+}
+\def\tabley#1{%
+ {%
+ \makevalueexpandable
+ \edef\temp{\noexpand\tablez #1\space\space\space}%
+ \expandafter
+ }\temp \endtablez
+}
+\def\tablez #1 #2 #3 #4\endtablez{%
+ \aboveenvbreak
+ \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
+ \ifnum 0#2>0 \tableindent=#2\mil \fi
+ \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
+ \itemmax=\tableindent
+ \advance \itemmax by -\itemmargin
+ \advance \leftskip by \tableindent
+ \exdentamount=\tableindent
+ \parindent = 0pt
+ \parskip = \smallskipamount
+ \ifdim \parskip=0pt \parskip=2pt \fi
+ \let\item = \internalBitem
+ \let\itemx = \internalBitemx
+}
+\def\Etable{\endgraf\afterenvbreak}
+\let\Eftable\Etable
+\let\Evtable\Etable
+\let\Eitemize\Etable
+\let\Eenumerate\Etable
+
+% This is the counter used by @enumerate, which is really @itemize
+
+\newcount \itemno
+
+\envdef\itemize{\parsearg\doitemize}
+
+\def\doitemize#1{%
+ \aboveenvbreak
+ \itemmax=\itemindent
+ \advance\itemmax by -\itemmargin
+ \advance\leftskip by \itemindent
+ \exdentamount=\itemindent
+ \parindent=0pt
+ \parskip=\smallskipamount
+ \ifdim\parskip=0pt \parskip=2pt \fi
+ \def\itemcontents{#1}%
+ % @itemize with no arg is equivalent to @itemize @bullet.
+ \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
+ \let\item=\itemizeitem
+}
+
+% Definition of @item while inside @itemize and @enumerate.
+%
+\def\itemizeitem{%
+ \advance\itemno by 1 % for enumerations
+ {\let\par=\endgraf \smallbreak}% reasonable place to break
+ {%
+ % If the document has an @itemize directly after a section title, a
+ % \nobreak will be last on the list, and \sectionheading will have
+ % done a \vskip-\parskip. In that case, we don't want to zero
+ % parskip, or the item text will crash with the heading. On the
+ % other hand, when there is normal text preceding the item (as there
+ % usually is), we do want to zero parskip, or there would be too much
+ % space. In that case, we won't have a \nobreak before. At least
+ % that's the theory.
+ \ifnum\lastpenalty<10000 \parskip=0in \fi
+ \noindent
+ \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
+ \vadjust{\penalty 1200}}% not good to break after first line of item.
+ \flushcr
+}
+
+% \splitoff TOKENS\endmark defines \first to be the first token in
+% TOKENS, and \rest to be the remainder.
+%
+\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
+
+% Allow an optional argument of an uppercase letter, lowercase letter,
+% or number, to specify the first label in the enumerated list. No
+% argument is the same as `1'.
+%
+\envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
+\def\enumeratey #1 #2\endenumeratey{%
+ % If we were given no argument, pretend we were given `1'.
+ \def\thearg{#1}%
+ \ifx\thearg\empty \def\thearg{1}\fi
+ %
+ % Detect if the argument is a single token. If so, it might be a
+ % letter. Otherwise, the only valid thing it can be is a number.
+ % (We will always have one token, because of the test we just made.
+ % This is a good thing, since \splitoff doesn't work given nothing at
+ % all -- the first parameter is undelimited.)
+ \expandafter\splitoff\thearg\endmark
+ \ifx\rest\empty
+ % Only one token in the argument. It could still be anything.
+ % A ``lowercase letter'' is one whose \lccode is nonzero.
+ % An ``uppercase letter'' is one whose \lccode is both nonzero, and
+ % not equal to itself.
+ % Otherwise, we assume it's a number.
+ %
+ % We need the \relax at the end of the \ifnum lines to stop TeX from
+ % continuing to look for a <number>.
+ %
+ \ifnum\lccode\expandafter`\thearg=0\relax
+ \numericenumerate % a number (we hope)
+ \else
+ % It's a letter.
+ \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
+ \lowercaseenumerate % lowercase letter
+ \else
+ \uppercaseenumerate % uppercase letter
+ \fi
+ \fi
+ \else
+ % Multiple tokens in the argument. We hope it's a number.
+ \numericenumerate
+ \fi
+}
+
+% An @enumerate whose labels are integers. The starting integer is
+% given in \thearg.
+%
+\def\numericenumerate{%
+ \itemno = \thearg
+ \startenumeration{\the\itemno}%
+}
+
+% The starting (lowercase) letter is in \thearg.
+\def\lowercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more lowercase letters in @enumerate; get a bigger
+ alphabet}%
+ \fi
+ \char\lccode\itemno
+ }%
+}
+
+% The starting (uppercase) letter is in \thearg.
+\def\uppercaseenumerate{%
+ \itemno = \expandafter`\thearg
+ \startenumeration{%
+ % Be sure we're not beyond the end of the alphabet.
+ \ifnum\itemno=0
+ \errmessage{No more uppercase letters in @enumerate; get a bigger
+ alphabet}
+ \fi
+ \char\uccode\itemno
+ }%
+}
+
+% Call \doitemize, adding a period to the first argument and supplying the
+% common last two arguments. Also subtract one from the initial value in
+% \itemno, since @item increments \itemno.
+%
+\def\startenumeration#1{%
+ \advance\itemno by -1
+ \doitemize{#1.}\flushcr
+}
+
+% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
+% to @enumerate.
+%
+\def\alphaenumerate{\enumerate{a}}
+\def\capsenumerate{\enumerate{A}}
+\def\Ealphaenumerate{\Eenumerate}
+\def\Ecapsenumerate{\Eenumerate}
+
+
+% @multitable macros
+% Amy Hendrickson, 8/18/94, 3/6/96
+%
+% @multitable ... @end multitable will make as many columns as desired.
+% Contents of each column will wrap at width given in preamble. Width
+% can be specified either with sample text given in a template line,
+% or in percent of \hsize, the current width of text on page.
+
+% Table can continue over pages but will only break between lines.
+
+% To make preamble:
+%
+% Either define widths of columns in terms of percent of \hsize:
+% @multitable @columnfractions .25 .3 .45
+% @item ...
+%
+% Numbers following @columnfractions are the percent of the total
+% current hsize to be used for each column. You may use as many
+% columns as desired.
+
+
+% Or use a template:
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item ...
+% using the widest term desired in each column.
+
+% Each new table line starts with @item, each subsequent new column
+% starts with @tab. Empty columns may be produced by supplying @tab's
+% with nothing between them for as many times as empty columns are needed,
+% ie, @tab@tab@tab will produce two empty columns.
+
+% @item, @tab do not need to be on their own lines, but it will not hurt
+% if they are.
+
+% Sample multitable:
+
+% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
+% @item first col stuff @tab second col stuff @tab third col
+% @item
+% first col stuff
+% @tab
+% second col stuff
+% @tab
+% third col
+% @item first col stuff @tab second col stuff
+% @tab Many paragraphs of text may be used in any column.
+%
+% They will wrap at the width determined by the template.
+% @item@tab@tab This will be in third column.
+% @end multitable
+
+% Default dimensions may be reset by user.
+% @multitableparskip is vertical space between paragraphs in table.
+% @multitableparindent is paragraph indent in table.
+% @multitablecolmargin is horizontal space to be left between columns.
+% @multitablelinespace is space to leave between table items, baseline
+% to baseline.
+% 0pt means it depends on current normal line spacing.
+%
+\newskip\multitableparskip
+\newskip\multitableparindent
+\newdimen\multitablecolspace
+\newskip\multitablelinespace
+\multitableparskip=0pt
+\multitableparindent=6pt
+\multitablecolspace=12pt
+\multitablelinespace=0pt
+
+% Macros used to set up halign preamble:
+%
+\let\endsetuptable\relax
+\def\xendsetuptable{\endsetuptable}
+\let\columnfractions\relax
+\def\xcolumnfractions{\columnfractions}
+\newif\ifsetpercent
+
+% #1 is the @columnfraction, usually a decimal number like .5, but might
+% be just 1. We just use it, whatever it is.
+%
+\def\pickupwholefraction#1 {%
+ \global\advance\colcount by 1
+ \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
+ \setuptable
+}
+
+\newcount\colcount
+\def\setuptable#1{%
+ \def\firstarg{#1}%
+ \ifx\firstarg\xendsetuptable
+ \let\go = \relax
+ \else
+ \ifx\firstarg\xcolumnfractions
+ \global\setpercenttrue
+ \else
+ \ifsetpercent
+ \let\go\pickupwholefraction
+ \else
+ \global\advance\colcount by 1
+ \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
+ % separator; typically that is always in the input, anyway.
+ \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
+ \fi
+ \fi
+ \ifx\go\pickupwholefraction
+ % Put the argument back for the \pickupwholefraction call, so
+ % we'll always have a period there to be parsed.
+ \def\go{\pickupwholefraction#1}%
+ \else
+ \let\go = \setuptable
+ \fi%
+ \fi
+ \go
+}
+
+% multitable-only commands.
+%
+% @headitem starts a heading row, which we typeset in bold.
+% Assignments have to be global since we are inside the implicit group
+% of an alignment entry. Note that \everycr resets \everytab.
+\def\headitem{\checkenv\multitable \crcr \global\everytab={\bf}\the\everytab}%
+%
+% A \tab used to include \hskip1sp. But then the space in a template
+% line is not enough. That is bad. So let's go back to just `&' until
+% we encounter the problem it was intended to solve again.
+% --karl, [email protected], 20apr99.
+\def\tab{\checkenv\multitable &\the\everytab}%
+
+% @multitable ... @end multitable definitions:
+%
+\newtoks\everytab % insert after every tab.
+%
+\envdef\multitable{%
+ \vskip\parskip
+ \startsavinginserts
+ %
+ % @item within a multitable starts a normal row.
+ % We use \def instead of \let so that if one of the multitable entries
+ % contains an @itemize, we don't choke on the \item (seen as \crcr aka
+ % \endtemplate) expanding \doitemize.
+ \def\item{\crcr}%
+ %
+ \tolerance=9500
+ \hbadness=9500
+ \setmultitablespacing
+ \parskip=\multitableparskip
+ \parindent=\multitableparindent
+ \overfullrule=0pt
+ \global\colcount=0
+ %
+ \everycr = {%
+ \noalign{%
+ \global\everytab={}%
+ \global\colcount=0 % Reset the column counter.
+ % Check for saved footnotes, etc.
+ \checkinserts
+ % Keeps underfull box messages off when table breaks over pages.
+ %\filbreak
+ % Maybe so, but it also creates really weird page breaks when the
+ % table breaks over pages. Wouldn't \vfil be better? Wait until the
+ % problem manifests itself, so it can be fixed for real --karl.
+ }%
+ }%
+ %
+ \parsearg\domultitable
+}
+\def\domultitable#1{%
+ % To parse everything between @multitable and @item:
+ \setuptable#1 \endsetuptable
+ %
+ % This preamble sets up a generic column definition, which will
+ % be used as many times as user calls for columns.
+ % \vtop will set a single line and will also let text wrap and
+ % continue for many paragraphs if desired.
+ \halign\bgroup &%
+ \global\advance\colcount by 1
+ \multistrut
+ \vtop{%
+ % Use the current \colcount to find the correct column width:
+ \hsize=\expandafter\csname col\the\colcount\endcsname
+ %
+ % In order to keep entries from bumping into each other
+ % we will add a \leftskip of \multitablecolspace to all columns after
+ % the first one.
+ %
+ % If a template has been used, we will add \multitablecolspace
+ % to the width of each template entry.
+ %
+ % If the user has set preamble in terms of percent of \hsize we will
+ % use that dimension as the width of the column, and the \leftskip
+ % will keep entries from bumping into each other. Table will start at
+ % left margin and final column will justify at right margin.
+ %
+ % Make sure we don't inherit \rightskip from the outer environment.
+ \rightskip=0pt
+ \ifnum\colcount=1
+ % The first column will be indented with the surrounding text.
+ \advance\hsize by\leftskip
+ \else
+ \ifsetpercent \else
+ % If user has not set preamble in terms of percent of \hsize
+ % we will advance \hsize by \multitablecolspace.
+ \advance\hsize by \multitablecolspace
+ \fi
+ % In either case we will make \leftskip=\multitablecolspace:
+ \leftskip=\multitablecolspace
+ \fi
+ % Ignoring space at the beginning and end avoids an occasional spurious
+ % blank line, when TeX decides to break the line at the space before the
+ % box from the multistrut, so the strut ends up on a line by itself.
+ % For example:
+ % @multitable @columnfractions .11 .89
+ % @item @code{#}
+ % @tab Legal holiday which is valid in major parts of the whole country.
+ % Is automatically provided with highlighting sequences respectively
+ % marking characters.
+ \noindent\ignorespaces##\unskip\multistrut
+ }\cr
+}
+\def\Emultitable{%
+ \crcr
+ \egroup % end the \halign
+ \global\setpercentfalse
+}
+
+\def\setmultitablespacing{%
+ \def\multistrut{\strut}% just use the standard line spacing
+ %
+ % Compute \multitablelinespace (if not defined by user) for use in
+ % \multitableparskip calculation. We used define \multistrut based on
+ % this, but (ironically) that caused the spacing to be off.
+ % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
+\ifdim\multitablelinespace=0pt
+\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
+\global\advance\multitablelinespace by-\ht0
+\fi
+%% Test to see if parskip is larger than space between lines of
+%% table. If not, do nothing.
+%% If so, set to same dimension as multitablelinespace.
+\ifdim\multitableparskip>\multitablelinespace
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
+ %% than skip between lines in the table.
+\fi%
+\ifdim\multitableparskip=0pt
+\global\multitableparskip=\multitablelinespace
+\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
+ %% than skip between lines in the table.
+\fi}
+
+
+\message{conditionals,}
+
+% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
+% @ifnotxml always succeed. They currently do nothing; we don't
+% attempt to check whether the conditionals are properly nested. But we
+% have to remember that they are conditionals, so that @end doesn't
+% attempt to close an environment group.
+%
+\def\makecond#1{%
+ \expandafter\let\csname #1\endcsname = \relax
+ \expandafter\let\csname iscond.#1\endcsname = 1
+}
+\makecond{iftex}
+\makecond{ifnotdocbook}
+\makecond{ifnothtml}
+\makecond{ifnotinfo}
+\makecond{ifnotplaintext}
+\makecond{ifnotxml}
+
+% Ignore @ignore, @ifhtml, @ifinfo, and the like.
+%
+\def\direntry{\doignore{direntry}}
+\def\documentdescription{\doignore{documentdescription}}
+\def\docbook{\doignore{docbook}}
+\def\html{\doignore{html}}
+\def\ifdocbook{\doignore{ifdocbook}}
+\def\ifhtml{\doignore{ifhtml}}
+\def\ifinfo{\doignore{ifinfo}}
+\def\ifnottex{\doignore{ifnottex}}
+\def\ifplaintext{\doignore{ifplaintext}}
+\def\ifxml{\doignore{ifxml}}
+\def\ignore{\doignore{ignore}}
+\def\menu{\doignore{menu}}
+\def\xml{\doignore{xml}}
+
+% Ignore text until a line `@end #1', keeping track of nested conditionals.
+%
+% A count to remember the depth of nesting.
+\newcount\doignorecount
+
+\def\doignore#1{\begingroup
+ % Scan in ``verbatim'' mode:
+ \obeylines
+ \catcode`\@ = \other
+ \catcode`\{ = \other
+ \catcode`\} = \other
+ %
+ % Make sure that spaces turn into tokens that match what \doignoretext wants.
+ \spaceisspace
+ %
+ % Count number of #1's that we've seen.
+ \doignorecount = 0
+ %
+ % Swallow text until we reach the matching `@end #1'.
+ \dodoignore{#1}%
+}
+
+{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
+ \obeylines %
+ %
+ \gdef\dodoignore#1{%
+ % #1 contains the command name as a string, e.g., `ifinfo'.
+ %
+ % Define a command to find the next `@end #1'.
+ \long\def\doignoretext##1^^M@end #1{%
+ \doignoretextyyy##1^^M@#1\_STOP_}%
+ %
+ % And this command to find another #1 command, at the beginning of a
+ % line. (Otherwise, we would consider a line `@c @ifset', for
+ % example, to count as an @ifset for nesting.)
+ \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
+ %
+ % And now expand that command.
+ \doignoretext ^^M%
+ }%
+}
+
+\def\doignoreyyy#1{%
+ \def\temp{#1}%
+ \ifx\temp\empty % Nothing found.
+ \let\next\doignoretextzzz
+ \else % Found a nested condition, ...
+ \advance\doignorecount by 1
+ \let\next\doignoretextyyy % ..., look for another.
+ % If we're here, #1 ends with ^^M\ifinfo (for example).
+ \fi
+ \next #1% the token \_STOP_ is present just after this macro.
+}
+
+% We have to swallow the remaining "\_STOP_".
+%
+\def\doignoretextzzz#1{%
+ \ifnum\doignorecount = 0 % We have just found the outermost @end.
+ \let\next\enddoignore
+ \else % Still inside a nested condition.
+ \advance\doignorecount by -1
+ \let\next\doignoretext % Look for the next @end.
+ \fi
+ \next
+}
+
+% Finish off ignored text.
+{ \obeylines%
+ % Ignore anything after the last `@end #1'; this matters in verbatim
+ % environments, where otherwise the newline after an ignored conditional
+ % would result in a blank line in the output.
+ \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
+}
+
+
+% @set VAR sets the variable VAR to an empty value.
+% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
+%
+% Since we want to separate VAR from REST-OF-LINE (which might be
+% empty), we can't just use \parsearg; we have to insert a space of our
+% own to delimit the rest of the line, and then take it out again if we
+% didn't need it.
+% We rely on the fact that \parsearg sets \catcode`\ =10.
+%
+\parseargdef\set{\setyyy#1 \endsetyyy}
+\def\setyyy#1 #2\endsetyyy{%
+ {%
+ \makevalueexpandable
+ \def\temp{#2}%
+ \edef\next{\gdef\makecsname{SET#1}}%
+ \ifx\temp\empty
+ \next{}%
+ \else
+ \setzzz#2\endsetzzz
+ \fi
+ }%
+}
+% Remove the trailing space \setxxx inserted.
+\def\setzzz#1 \endsetzzz{\next{#1}}
+
+% @clear VAR clears (i.e., unsets) the variable VAR.
+%
+\parseargdef\clear{%
+ {%
+ \makevalueexpandable
+ \global\expandafter\let\csname SET#1\endcsname=\relax
+ }%
+}
+
+% @value{foo} gets the text saved in variable foo.
+\def\value{\begingroup\makevalueexpandable\valuexxx}
+\def\valuexxx#1{\expandablevalue{#1}\endgroup}
+{
+ \catcode`\- = \active \catcode`\_ = \active
+ %
+ \gdef\makevalueexpandable{%
+ \let\value = \expandablevalue
+ % We don't want these characters active, ...
+ \catcode`\-=\other \catcode`\_=\other
+ % ..., but we might end up with active ones in the argument if
+ % we're called from @code, as @code{@value{foo-bar_}}, though.
+ % So \let them to their normal equivalents.
+ \let-\realdash \let_\normalunderscore
+ }
+}
+
+% We have this subroutine so that we can handle at least some @value's
+% properly in indexes (we call \makevalueexpandable in \indexdummies).
+% The command has to be fully expandable (if the variable is set), since
+% the result winds up in the index file. This means that if the
+% variable's value contains other Texinfo commands, it's almost certain
+% it will fail (although perhaps we could fix that with sufficient work
+% to do a one-level expansion on the result, instead of complete).
+%
+\def\expandablevalue#1{%
+ \expandafter\ifx\csname SET#1\endcsname\relax
+ {[No value for ``#1'']}%
+ \message{Variable `#1', used in @value, is not set.}%
+ \else
+ \csname SET#1\endcsname
+ \fi
+}
+
+% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
+% with @set.
+%
+% To get special treatment of `@end ifset,' call \makeond and the redefine.
+%
+\makecond{ifset}
+\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
+\def\doifset#1#2{%
+ {%
+ \makevalueexpandable
+ \let\next=\empty
+ \expandafter\ifx\csname SET#2\endcsname\relax
+ #1% If not set, redefine \next.
+ \fi
+ \expandafter
+ }\next
+}
+\def\ifsetfail{\doignore{ifset}}
+
+% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
+% defined with @set, or has been undefined with @clear.
+%
+% The `\else' inside the `\doifset' parameter is a trick to reuse the
+% above code: if the variable is not set, do nothing, if it is set,
+% then redefine \next to \ifclearfail.
+%
+\makecond{ifclear}
+\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
+\def\ifclearfail{\doignore{ifclear}}
+
+% @dircategory CATEGORY -- specify a category of the dir file
+% which this file should belong to. Ignore this in TeX.
+\let\dircategory=\comment
+
+% @defininfoenclose.
+\let\definfoenclose=\comment
+
+
+\message{indexing,}
+% Index generation facilities
+
+% Define \newwrite to be identical to plain tex's \newwrite
+% except not \outer, so it can be used within macros and \if's.
+\edef\newwrite{\makecsname{ptexnewwrite}}
+
+% \newindex {foo} defines an index named foo.
+% It automatically defines \fooindex such that
+% \fooindex ...rest of line... puts an entry in the index foo.
+% It also defines \fooindfile to be the number of the output channel for
+% the file that accumulates this index. The file's extension is foo.
+% The name of an index should be no more than 2 characters long
+% for the sake of vms.
+%
+\def\newindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
+ \noexpand\doindex{#1}}
+}
+
+% @defindex foo == \newindex{foo}
+%
+\def\defindex{\parsearg\newindex}
+
+% Define @defcodeindex, like @defindex except put all entries in @code.
+%
+\def\defcodeindex{\parsearg\newcodeindex}
+%
+\def\newcodeindex#1{%
+ \iflinks
+ \expandafter\newwrite \csname#1indfile\endcsname
+ \openout \csname#1indfile\endcsname \jobname.#1
+ \fi
+ \expandafter\xdef\csname#1index\endcsname{%
+ \noexpand\docodeindex{#1}}%
+}
+
+
+% @synindex foo bar makes index foo feed into index bar.
+% Do this instead of @defindex foo if you don't want it as a separate index.
+%
+% @syncodeindex foo bar similar, but put all entries made for index foo
+% inside @code.
+%
+\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
+\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
+
+% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
+% #3 the target index (bar).
+\def\dosynindex#1#2#3{%
+ % Only do \closeout if we haven't already done it, else we'll end up
+ % closing the target index.
+ \expandafter \ifx\csname donesynindex#2\endcsname \undefined
+ % The \closeout helps reduce unnecessary open files; the limit on the
+ % Acorn RISC OS is a mere 16 files.
+ \expandafter\closeout\csname#2indfile\endcsname
+ \expandafter\let\csname\donesynindex#2\endcsname = 1
+ \fi
+ % redefine \fooindfile:
+ \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
+ \expandafter\let\csname#2indfile\endcsname=\temp
+ % redefine \fooindex:
+ \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
+}
+
+% Define \doindex, the driver for all \fooindex macros.
+% Argument #1 is generated by the calling \fooindex macro,
+% and it is "foo", the name of the index.
+
+% \doindex just uses \parsearg; it calls \doind for the actual work.
+% This is because \doind is more useful to call from other macros.
+
+% There is also \dosubind {index}{topic}{subtopic}
+% which makes an entry in a two-level index such as the operation index.
+
+\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
+\def\singleindexer #1{\doind{\indexname}{#1}}
+
+% like the previous two, but they put @code around the argument.
+\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
+\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
+
+% Take care of Texinfo commands that can appear in an index entry.
+% Since there are some commands we want to expand, and others we don't,
+% we have to laboriously prevent expansion for those that we don't.
+%
+\def\indexdummies{%
+ \escapechar = `\\ % use backslash in output files.
+ \def\@{@}% change to @@ when we switch to @ as escape char in index files.
+ \def\ {\realbackslash\space }%
+ %
+ % Need these in case \tex is in effect and \{ is a \delimiter again.
+ % But can't use \lbracecmd and \rbracecmd because texindex assumes
+ % braces and backslashes are used only as delimiters.
+ \let\{ = \mylbrace
+ \let\} = \myrbrace
+ %
+ % I don't entirely understand this, but when an index entry is
+ % generated from a macro call, the \endinput which \scanmacro inserts
+ % causes processing to be prematurely terminated. This is,
+ % apparently, because \indexsorttmp is fully expanded, and \endinput
+ % is an expandable command. The redefinition below makes \endinput
+ % disappear altogether for that purpose -- although logging shows that
+ % processing continues to some further point. On the other hand, it
+ % seems \endinput does not hurt in the printed index arg, since that
+ % is still getting written without apparent harm.
+ %
+ % Sample source (mac-idx3.tex, reported by Graham Percival to
+ % help-texinfo, 22may06):
+ % @macro funindex {WORD}
+ % @findex xyz
+ % @end macro
+ % ...
+ % @funindex commtest
+ %
+ % The above is not enough to reproduce the bug, but it gives the flavor.
+ %
+ % Sample whatsit resulting:
+ % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
+ %
+ % So:
+ \let\endinput = \empty
+ %
+ % Do the redefinitions.
+ \commondummies
+}
+
+% For the aux and toc files, @ is the escape character. So we want to
+% redefine everything using @ as the escape character (instead of
+% \realbackslash, still used for index files). When everything uses @,
+% this will be simpler.
+%
+\def\atdummies{%
+ \def\@{@@}%
+ \def\ {@ }%
+ \let\{ = \lbraceatcmd
+ \let\} = \rbraceatcmd
+ %
+ % Do the redefinitions.
+ \commondummies
+ \otherbackslash
+}
+
+% Called from \indexdummies and \atdummies.
+%
+\def\commondummies{%
+ %
+ % \definedummyword defines \#1 as \string\#1\space, thus effectively
+ % preventing its expansion. This is used only for control% words,
+ % not control letters, because the \space would be incorrect for
+ % control characters, but is needed to separate the control word
+ % from whatever follows.
+ %
+ % For control letters, we have \definedummyletter, which omits the
+ % space.
+ %
+ % These can be used both for control words that take an argument and
+ % those that do not. If it is followed by {arg} in the input, then
+ % that will dutifully get written to the index (or wherever).
+ %
+ \def\definedummyword ##1{\def##1{\string##1\space}}%
+ \def\definedummyletter##1{\def##1{\string##1}}%
+ \let\definedummyaccent\definedummyletter
+ %
+ \commondummiesnofonts
+ %
+ \definedummyletter\_%
+ %
+ % Non-English letters.
+ \definedummyword\AA
+ \definedummyword\AE
+ \definedummyword\L
+ \definedummyword\OE
+ \definedummyword\O
+ \definedummyword\aa
+ \definedummyword\ae
+ \definedummyword\l
+ \definedummyword\oe
+ \definedummyword\o
+ \definedummyword\ss
+ \definedummyword\exclamdown
+ \definedummyword\questiondown
+ \definedummyword\ordf
+ \definedummyword\ordm
+ %
+ % Although these internal commands shouldn't show up, sometimes they do.
+ \definedummyword\bf
+ \definedummyword\gtr
+ \definedummyword\hat
+ \definedummyword\less
+ \definedummyword\sf
+ \definedummyword\sl
+ \definedummyword\tclose
+ \definedummyword\tt
+ %
+ \definedummyword\LaTeX
+ \definedummyword\TeX
+ %
+ % Assorted special characters.
+ \definedummyword\bullet
+ \definedummyword\comma
+ \definedummyword\copyright
+ \definedummyword\registeredsymbol
+ \definedummyword\dots
+ \definedummyword\enddots
+ \definedummyword\equiv
+ \definedummyword\error
+ \definedummyword\euro
+ \definedummyword\expansion
+ \definedummyword\minus
+ \definedummyword\pounds
+ \definedummyword\point
+ \definedummyword\print
+ \definedummyword\result
+ \definedummyword\textdegree
+ %
+ % We want to disable all macros so that they are not expanded by \write.
+ \macrolist
+ %
+ \normalturnoffactive
+ %
+ % Handle some cases of @value -- where it does not contain any
+ % (non-fully-expandable) commands.
+ \makevalueexpandable
+}
+
+% \commondummiesnofonts: common to \commondummies and \indexnofonts.
+%
+\def\commondummiesnofonts{%
+ % Control letters and accents.
+ \definedummyletter\!%
+ \definedummyaccent\"%
+ \definedummyaccent\'%
+ \definedummyletter\*%
+ \definedummyaccent\,%
+ \definedummyletter\.%
+ \definedummyletter\/%
+ \definedummyletter\:%
+ \definedummyaccent\=%
+ \definedummyletter\?%
+ \definedummyaccent\^%
+ \definedummyaccent\`%
+ \definedummyaccent\~%
+ \definedummyword\u
+ \definedummyword\v
+ \definedummyword\H
+ \definedummyword\dotaccent
+ \definedummyword\ringaccent
+ \definedummyword\tieaccent
+ \definedummyword\ubaraccent
+ \definedummyword\udotaccent
+ \definedummyword\dotless
+ %
+ % Texinfo font commands.
+ \definedummyword\b
+ \definedummyword\i
+ \definedummyword\r
+ \definedummyword\sc
+ \definedummyword\t
+ %
+ % Commands that take arguments.
+ \definedummyword\acronym
+ \definedummyword\cite
+ \definedummyword\code
+ \definedummyword\command
+ \definedummyword\dfn
+ \definedummyword\emph
+ \definedummyword\env
+ \definedummyword\file
+ \definedummyword\kbd
+ \definedummyword\key
+ \definedummyword\math
+ \definedummyword\option
+ \definedummyword\pxref
+ \definedummyword\ref
+ \definedummyword\samp
+ \definedummyword\strong
+ \definedummyword\tie
+ \definedummyword\uref
+ \definedummyword\url
+ \definedummyword\var
+ \definedummyword\verb
+ \definedummyword\w
+ \definedummyword\xref
+}
+
+% \indexnofonts is used when outputting the strings to sort the index
+% by, and when constructing control sequence names. It eliminates all
+% control sequences and just writes whatever the best ASCII sort string
+% would be for a given command (usually its argument).
+%
+\def\indexnofonts{%
+ % Accent commands should become @asis.
+ \def\definedummyaccent##1{\let##1\asis}%
+ % We can just ignore other control letters.
+ \def\definedummyletter##1{\let##1\empty}%
+ % Hopefully, all control words can become @asis.
+ \let\definedummyword\definedummyaccent
+ %
+ \commondummiesnofonts
+ %
+ % Don't no-op \tt, since it isn't a user-level command
+ % and is used in the definitions of the active chars like <, >, |, etc.
+ % Likewise with the other plain tex font commands.
+ %\let\tt=\asis
+ %
+ \def\ { }%
+ \def\@{@}%
+ % how to handle braces?
+ \def\_{\normalunderscore}%
+ %
+ % Non-English letters.
+ \def\AA{AA}%
+ \def\AE{AE}%
+ \def\L{L}%
+ \def\OE{OE}%
+ \def\O{O}%
+ \def\aa{aa}%
+ \def\ae{ae}%
+ \def\l{l}%
+ \def\oe{oe}%
+ \def\o{o}%
+ \def\ss{ss}%
+ \def\exclamdown{!}%
+ \def\questiondown{?}%
+ \def\ordf{a}%
+ \def\ordm{o}%
+ %
+ \def\LaTeX{LaTeX}%
+ \def\TeX{TeX}%
+ %
+ % Assorted special characters.
+ % (The following {} will end up in the sort string, but that's ok.)
+ \def\bullet{bullet}%
+ \def\comma{,}%
+ \def\copyright{copyright}%
+ \def\registeredsymbol{R}%
+ \def\dots{...}%
+ \def\enddots{...}%
+ \def\equiv{==}%
+ \def\error{error}%
+ \def\euro{euro}%
+ \def\expansion{==>}%
+ \def\minus{-}%
+ \def\pounds{pounds}%
+ \def\point{.}%
+ \def\print{-|}%
+ \def\result{=>}%
+ \def\textdegree{degrees}%
+ %
+ % We need to get rid of all macros, leaving only the arguments (if present).
+ % Of course this is not nearly correct, but it is the best we can do for now.
+ % makeinfo does not expand macros in the argument to @deffn, which ends up
+ % writing an index entry, and texindex isn't prepared for an index sort entry
+ % that starts with \.
+ %
+ % Since macro invocations are followed by braces, we can just redefine them
+ % to take a single TeX argument. The case of a macro invocation that
+ % goes to end-of-line is not handled.
+ %
+ \macrolist
+}
+
+\let\indexbackslash=0 %overridden during \printindex.
+\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
+
+% Most index entries go through here, but \dosubind is the general case.
+% #1 is the index name, #2 is the entry text.
+\def\doind#1#2{\dosubind{#1}{#2}{}}
+
+% Workhorse for all \fooindexes.
+% #1 is name of index, #2 is stuff to put there, #3 is subentry --
+% empty if called from \doind, as we usually are (the main exception
+% is with most defuns, which call us directly).
+%
+\def\dosubind#1#2#3{%
+ \iflinks
+ {%
+ % Store the main index entry text (including the third arg).
+ \toks0 = {#2}%
+ % If third arg is present, precede it with a space.
+ \def\thirdarg{#3}%
+ \ifx\thirdarg\empty \else
+ \toks0 = \expandafter{\the\toks0 \space #3}%
+ \fi
+ %
+ \edef\writeto{\csname#1indfile\endcsname}%
+ %
+ \safewhatsit\dosubindwrite
+ }%
+ \fi
+}
+
+% Write the entry in \toks0 to the index file:
+%
+\def\dosubindwrite{%
+ % Put the index entry in the margin if desired.
+ \ifx\SETmarginindex\relax\else
+ \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
+ \fi
+ %
+ % Remember, we are within a group.
+ \indexdummies % Must do this here, since \bf, etc expand at this stage
+ \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
+ % so it will be output as is; and it will print as backslash.
+ %
+ % Process the index entry with all font commands turned off, to
+ % get the string to sort by.
+ {\indexnofonts
+ \edef\temp{\the\toks0}% need full expansion
+ \xdef\indexsorttmp{\temp}%
+ }%
+ %
+ % Set up the complete index entry, with both the sort key and
+ % the original text, including any font commands. We write
+ % three arguments to \entry to the .?? file (four in the
+ % subentry case), texindex reduces to two when writing the .??s
+ % sorted result.
+ \edef\temp{%
+ \write\writeto{%
+ \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
+ }%
+ \temp
+}
+
+% Take care of unwanted page breaks/skips around a whatsit:
+%
+% If a skip is the last thing on the list now, preserve it
+% by backing up by \lastskip, doing the \write, then inserting
+% the skip again. Otherwise, the whatsit generated by the
+% \write or \pdfdest will make \lastskip zero. The result is that
+% sequences like this:
+% @end defun
+% @tindex whatever
+% @defun ...
+% will have extra space inserted, because the \medbreak in the
+% start of the @defun won't see the skip inserted by the @end of
+% the previous defun.
+%
+% But don't do any of this if we're not in vertical mode. We
+% don't want to do a \vskip and prematurely end a paragraph.
+%
+% Avoid page breaks due to these extra skips, too.
+%
+% But wait, there is a catch there:
+% We'll have to check whether \lastskip is zero skip. \ifdim is not
+% sufficient for this purpose, as it ignores stretch and shrink parts
+% of the skip. The only way seems to be to check the textual
+% representation of the skip.
+%
+% The following is almost like \def\zeroskipmacro{0.0pt} except that
+% the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
+%
+\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
+%
+\newskip\whatsitskip
+\newcount\whatsitpenalty
+%
+% ..., ready, GO:
+%
+\def\safewhatsit#1{%
+\ifhmode
+ #1%
+\else
+ % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
+ \whatsitskip = \lastskip
+ \edef\lastskipmacro{\the\lastskip}%
+ \whatsitpenalty = \lastpenalty
+ %
+ % If \lastskip is nonzero, that means the last item was a
+ % skip. And since a skip is discardable, that means this
+ % -\skip0 glue we're inserting is preceded by a
+ % non-discardable item, therefore it is not a potential
+ % breakpoint, therefore no \nobreak needed.
+ \ifx\lastskipmacro\zeroskipmacro
+ \else
+ \vskip-\whatsitskip
+ \fi
+ %
+ #1%
+ %
+ \ifx\lastskipmacro\zeroskipmacro
+ % If \lastskip was zero, perhaps the last item was a penalty, and
+ % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
+ % to re-insert the same penalty (values >10000 are used for various
+ % signals); since we just inserted a non-discardable item, any
+ % following glue (such as a \parskip) would be a breakpoint. For example:
+ %
+ % @deffn deffn-whatever
+ % @vindex index-whatever
+ % Description.
+ % would allow a break between the index-whatever whatsit
+ % and the "Description." paragraph.
+ \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
+ \else
+ % On the other hand, if we had a nonzero \lastskip,
+ % this make-up glue would be preceded by a non-discardable item
+ % (the whatsit from the \write), so we must insert a \nobreak.
+ \nobreak\vskip\whatsitskip
+ \fi
+\fi
+}
+
+% The index entry written in the file actually looks like
+% \entry {sortstring}{page}{topic}
+% or
+% \entry {sortstring}{page}{topic}{subtopic}
+% The texindex program reads in these files and writes files
+% containing these kinds of lines:
+% \initial {c}
+% before the first topic whose initial is c
+% \entry {topic}{pagelist}
+% for a topic that is used without subtopics
+% \primary {topic}
+% for the beginning of a topic that is used with subtopics
+% \secondary {subtopic}{pagelist}
+% for each subtopic.
+
+% Define the user-accessible indexing commands
+% @findex, @vindex, @kindex, @cindex.
+
+\def\findex {\fnindex}
+\def\kindex {\kyindex}
+\def\cindex {\cpindex}
+\def\vindex {\vrindex}
+\def\tindex {\tpindex}
+\def\pindex {\pgindex}
+
+\def\cindexsub {\begingroup\obeylines\cindexsub}
+{\obeylines %
+\gdef\cindexsub "#1" #2^^M{\endgroup %
+\dosubind{cp}{#2}{#1}}}
+
+% Define the macros used in formatting output of the sorted index material.
+
+% @printindex causes a particular index (the ??s file) to get printed.
+% It does not print any chapter heading (usually an @unnumbered).
+%
+\parseargdef\printindex{\begingroup
+ \dobreak \chapheadingskip{10000}%
+ %
+ \smallfonts \rm
+ \tolerance = 9500
+ \plainfrenchspacing
+ \everypar = {}% don't want the \kern\-parindent from indentation suppression.
+ %
+ % See if the index file exists and is nonempty.
+ % Change catcode of @ here so that if the index file contains
+ % \initial {@}
+ % as its first line, TeX doesn't complain about mismatched braces
+ % (because it thinks @} is a control sequence).
+ \catcode`\@ = 11
+ \openin 1 \jobname.#1s
+ \ifeof 1
+ % \enddoublecolumns gets confused if there is no text in the index,
+ % and it loses the chapter title and the aux file entries for the
+ % index. The easiest way to prevent this problem is to make sure
+ % there is some text.
+ \putwordIndexNonexistent
+ \else
+ %
+ % If the index file exists but is empty, then \openin leaves \ifeof
+ % false. We have to make TeX try to read something from the file, so
+ % it can discover if there is anything in it.
+ \read 1 to \temp
+ \ifeof 1
+ \putwordIndexIsEmpty
+ \else
+ % Index files are almost Texinfo source, but we use \ as the escape
+ % character. It would be better to use @, but that's too big a change
+ % to make right now.
+ \def\indexbackslash{\backslashcurfont}%
+ \catcode`\\ = 0
+ \escapechar = `\\
+ \begindoublecolumns
+ \input \jobname.#1s
+ \enddoublecolumns
+ \fi
+ \fi
+ \closein 1
+\endgroup}
+
+% These macros are used by the sorted index file itself.
+% Change them to control the appearance of the index.
+
+\def\initial#1{{%
+ % Some minor font changes for the special characters.
+ \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
+ %
+ % Remove any glue we may have, we'll be inserting our own.
+ \removelastskip
+ %
+ % We like breaks before the index initials, so insert a bonus.
+ \nobreak
+ \vskip 0pt plus 3\baselineskip
+ \penalty 0
+ \vskip 0pt plus -3\baselineskip
+ %
+ % Typeset the initial. Making this add up to a whole number of
+ % baselineskips increases the chance of the dots lining up from column
+ % to column. It still won't often be perfect, because of the stretch
+ % we need before each entry, but it's better.
+ %
+ % No shrink because it confuses \balancecolumns.
+ \vskip 1.67\baselineskip plus .5\baselineskip
+ \leftline{\secbf #1}%
+ % Do our best not to break after the initial.
+ \nobreak
+ \vskip .33\baselineskip plus .1\baselineskip
+}}
+
+% \entry typesets a paragraph consisting of the text (#1), dot leaders, and
+% then page number (#2) flushed to the right margin. It is used for index
+% and table of contents entries. The paragraph is indented by \leftskip.
+%
+% A straightforward implementation would start like this:
+% \def\entry#1#2{...
+% But this frozes the catcodes in the argument, and can cause problems to
+% @code, which sets - active. This problem was fixed by a kludge---
+% ``-'' was active throughout whole index, but this isn't really right.
+%
+% The right solution is to prevent \entry from swallowing the whole text.
+% --kasal, 21nov03
+\def\entry{%
+ \begingroup
+ %
+ % Start a new paragraph if necessary, so our assignments below can't
+ % affect previous text.
+ \par
+ %
+ % Do not fill out the last line with white space.
+ \parfillskip = 0in
+ %
+ % No extra space above this paragraph.
+ \parskip = 0in
+ %
+ % Do not prefer a separate line ending with a hyphen to fewer lines.
+ \finalhyphendemerits = 0
+ %
+ % \hangindent is only relevant when the entry text and page number
+ % don't both fit on one line. In that case, bob suggests starting the
+ % dots pretty far over on the line. Unfortunately, a large
+ % indentation looks wrong when the entry text itself is broken across
+ % lines. So we use a small indentation and put up with long leaders.
+ %
+ % \hangafter is reset to 1 (which is the value we want) at the start
+ % of each paragraph, so we need not do anything with that.
+ \hangindent = 2em
+ %
+ % When the entry text needs to be broken, just fill out the first line
+ % with blank space.
+ \rightskip = 0pt plus1fil
+ %
+ % A bit of stretch before each entry for the benefit of balancing
+ % columns.
+ \vskip 0pt plus1pt
+ %
+ % Swallow the left brace of the text (first parameter):
+ \afterassignment\doentry
+ \let\temp =
+}
+\def\doentry{%
+ \bgroup % Instead of the swallowed brace.
+ \noindent
+ \aftergroup\finishentry
+ % And now comes the text of the entry.
+}
+\def\finishentry#1{%
+ % #1 is the page number.
+ %
+ % The following is kludged to not output a line of dots in the index if
+ % there are no page numbers. The next person who breaks this will be
+ % cursed by a Unix daemon.
+ \def\tempa{{\rm }}%
+ \def\tempb{#1}%
+ \edef\tempc{\tempa}%
+ \edef\tempd{\tempb}%
+ \ifx\tempc\tempd
+ \ %
+ \else
+ %
+ % If we must, put the page number on a line of its own, and fill out
+ % this line with blank space. (The \hfil is overwhelmed with the
+ % fill leaders glue in \indexdotfill if the page number does fit.)
+ \hfil\penalty50
+ \null\nobreak\indexdotfill % Have leaders before the page number.
+ %
+ % The `\ ' here is removed by the implicit \unskip that TeX does as
+ % part of (the primitive) \par. Without it, a spurious underfull
+ % \hbox ensues.
+ \ifpdf
+ \pdfgettoks#1.%
+ \ \the\toksA
+ \else
+ \ #1%
+ \fi
+ \fi
+ \par
+ \endgroup
+}
+
+% Like plain.tex's \dotfill, except uses up at least 1 em.
+\def\indexdotfill{\cleaders
+ \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
+
+\def\primary #1{\line{#1\hfil}}
+
+\newskip\secondaryindent \secondaryindent=0.5cm
+\def\secondary#1#2{{%
+ \parfillskip=0in
+ \parskip=0in
+ \hangindent=1in
+ \hangafter=1
+ \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
+ \ifpdf
+ \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
+ \else
+ #2
+ \fi
+ \par
+}}
+
+% Define two-column mode, which we use to typeset indexes.
+% Adapted from the TeXbook, page 416, which is to say,
+% the manmac.tex format used to print the TeXbook itself.
+\catcode`\@=11
+
+\newbox\partialpage
+\newdimen\doublecolumnhsize
+
+\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
+ % Grab any single-column material above us.
+ \output = {%
+ %
+ % Here is a possibility not foreseen in manmac: if we accumulate a
+ % whole lot of material, we might end up calling this \output
+ % routine twice in a row (see the doublecol-lose test, which is
+ % essentially a couple of indexes with @setchapternewpage off). In
+ % that case we just ship out what is in \partialpage with the normal
+ % output routine. Generally, \partialpage will be empty when this
+ % runs and this will be a no-op. See the indexspread.tex test case.
+ \ifvoid\partialpage \else
+ \onepageout{\pagecontents\partialpage}%
+ \fi
+ %
+ \global\setbox\partialpage = \vbox{%
+ % Unvbox the main output page.
+ \unvbox\PAGE
+ \kern-\topskip \kern\baselineskip
+ }%
+ }%
+ \eject % run that output routine to set \partialpage
+ %
+ % Use the double-column output routine for subsequent pages.
+ \output = {\doublecolumnout}%
+ %
+ % Change the page size parameters. We could do this once outside this
+ % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
+ % format, but then we repeat the same computation. Repeating a couple
+ % of assignments once per index is clearly meaningless for the
+ % execution time, so we may as well do it in one place.
+ %
+ % First we halve the line length, less a little for the gutter between
+ % the columns. We compute the gutter based on the line length, so it
+ % changes automatically with the paper format. The magic constant
+ % below is chosen so that the gutter has the same value (well, +-<1pt)
+ % as it did when we hard-coded it.
+ %
+ % We put the result in a separate register, \doublecolumhsize, so we
+ % can restore it in \pagesofar, after \hsize itself has (potentially)
+ % been clobbered.
+ %
+ \doublecolumnhsize = \hsize
+ \advance\doublecolumnhsize by -.04154\hsize
+ \divide\doublecolumnhsize by 2
+ \hsize = \doublecolumnhsize
+ %
+ % Double the \vsize as well. (We don't need a separate register here,
+ % since nobody clobbers \vsize.)
+ \vsize = 2\vsize
+}
+
+% The double-column output routine for all double-column pages except
+% the last.
+%
+\def\doublecolumnout{%
+ \splittopskip=\topskip \splitmaxdepth=\maxdepth
+ % Get the available space for the double columns -- the normal
+ % (undoubled) page height minus any material left over from the
+ % previous page.
+ \dimen@ = \vsize
+ \divide\dimen@ by 2
+ \advance\dimen@ by -\ht\partialpage
+ %
+ % box0 will be the left-hand column, box2 the right.
+ \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
+ \onepageout\pagesofar
+ \unvbox255
+ \penalty\outputpenalty
+}
+%
+% Re-output the contents of the output page -- any previous material,
+% followed by the two boxes we just split, in box0 and box2.
+\def\pagesofar{%
+ \unvbox\partialpage
+ %
+ \hsize = \doublecolumnhsize
+ \wd0=\hsize \wd2=\hsize
+ \hbox to\pagewidth{\box0\hfil\box2}%
+}
+%
+% All done with double columns.
+\def\enddoublecolumns{%
+ % The following penalty ensures that the page builder is exercised
+ % _before_ we change the output routine. This is necessary in the
+ % following situation:
+ %
+ % The last section of the index consists only of a single entry.
+ % Before this section, \pagetotal is less than \pagegoal, so no
+ % break occurs before the last section starts. However, the last
+ % section, consisting of \initial and the single \entry, does not
+ % fit on the page and has to be broken off. Without the following
+ % penalty the page builder will not be exercised until \eject
+ % below, and by that time we'll already have changed the output
+ % routine to the \balancecolumns version, so the next-to-last
+ % double-column page will be processed with \balancecolumns, which
+ % is wrong: The two columns will go to the main vertical list, with
+ % the broken-off section in the recent contributions. As soon as
+ % the output routine finishes, TeX starts reconsidering the page
+ % break. The two columns and the broken-off section both fit on the
+ % page, because the two columns now take up only half of the page
+ % goal. When TeX sees \eject from below which follows the final
+ % section, it invokes the new output routine that we've set after
+ % \balancecolumns below; \onepageout will try to fit the two columns
+ % and the final section into the vbox of \pageheight (see
+ % \pagebody), causing an overfull box.
+ %
+ % Note that glue won't work here, because glue does not exercise the
+ % page builder, unlike penalties (see The TeXbook, pp. 280-281).
+ \penalty0
+ %
+ \output = {%
+ % Split the last of the double-column material. Leave it on the
+ % current page, no automatic page break.
+ \balancecolumns
+ %
+ % If we end up splitting too much material for the current page,
+ % though, there will be another page break right after this \output
+ % invocation ends. Having called \balancecolumns once, we do not
+ % want to call it again. Therefore, reset \output to its normal
+ % definition right away. (We hope \balancecolumns will never be
+ % called on to balance too much material, but if it is, this makes
+ % the output somewhat more palatable.)
+ \global\output = {\onepageout{\pagecontents\PAGE}}%
+ }%
+ \eject
+ \endgroup % started in \begindoublecolumns
+ %
+ % \pagegoal was set to the doubled \vsize above, since we restarted
+ % the current page. We're now back to normal single-column
+ % typesetting, so reset \pagegoal to the normal \vsize (after the
+ % \endgroup where \vsize got restored).
+ \pagegoal = \vsize
+}
+%
+% Called at the end of the double column material.
+\def\balancecolumns{%
+ \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
+ \dimen@ = \ht0
+ \advance\dimen@ by \topskip
+ \advance\dimen@ by-\baselineskip
+ \divide\dimen@ by 2 % target to split to
+ %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
+ \splittopskip = \topskip
+ % Loop until we get a decent breakpoint.
+ {%
+ \vbadness = 10000
+ \loop
+ \global\setbox3 = \copy0
+ \global\setbox1 = \vsplit3 to \dimen@
+ \ifdim\ht3>\dimen@
+ \global\advance\dimen@ by 1pt
+ \repeat
+ }%
+ %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
+ \setbox0=\vbox to\dimen@{\unvbox1}%
+ \setbox2=\vbox to\dimen@{\unvbox3}%
+ %
+ \pagesofar
+}
+\catcode`\@ = \other
+
+
+\message{sectioning,}
+% Chapters, sections, etc.
+
+% \unnumberedno is an oxymoron, of course. But we count the unnumbered
+% sections so that we can refer to them unambiguously in the pdf
+% outlines by their "section number". We avoid collisions with chapter
+% numbers by starting them at 10000. (If a document ever has 10000
+% chapters, we're in trouble anyway, I'm sure.)
+\newcount\unnumberedno \unnumberedno = 10000
+\newcount\chapno
+\newcount\secno \secno=0
+\newcount\subsecno \subsecno=0
+\newcount\subsubsecno \subsubsecno=0
+
+% This counter is funny since it counts through charcodes of letters A, B, ...
+\newcount\appendixno \appendixno = `\@
+%
+% \def\appendixletter{\char\the\appendixno}
+% We do the following ugly conditional instead of the above simple
+% construct for the sake of pdftex, which needs the actual
+% letter in the expansion, not just typeset.
+%
+\def\appendixletter{%
+ \ifnum\appendixno=`A A%
+ \else\ifnum\appendixno=`B B%
+ \else\ifnum\appendixno=`C C%
+ \else\ifnum\appendixno=`D D%
+ \else\ifnum\appendixno=`E E%
+ \else\ifnum\appendixno=`F F%
+ \else\ifnum\appendixno=`G G%
+ \else\ifnum\appendixno=`H H%
+ \else\ifnum\appendixno=`I I%
+ \else\ifnum\appendixno=`J J%
+ \else\ifnum\appendixno=`K K%
+ \else\ifnum\appendixno=`L L%
+ \else\ifnum\appendixno=`M M%
+ \else\ifnum\appendixno=`N N%
+ \else\ifnum\appendixno=`O O%
+ \else\ifnum\appendixno=`P P%
+ \else\ifnum\appendixno=`Q Q%
+ \else\ifnum\appendixno=`R R%
+ \else\ifnum\appendixno=`S S%
+ \else\ifnum\appendixno=`T T%
+ \else\ifnum\appendixno=`U U%
+ \else\ifnum\appendixno=`V V%
+ \else\ifnum\appendixno=`W W%
+ \else\ifnum\appendixno=`X X%
+ \else\ifnum\appendixno=`Y Y%
+ \else\ifnum\appendixno=`Z Z%
+ % The \the is necessary, despite appearances, because \appendixletter is
+ % expanded while writing the .toc file. \char\appendixno is not
+ % expandable, thus it is written literally, thus all appendixes come out
+ % with the same letter (or @) in the toc without it.
+ \else\char\the\appendixno
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+
+% Each @chapter defines this as the name of the chapter.
+% page headings and footings can use it. @section does likewise.
+% However, they are not reliable, because we don't use marks.
+\def\thischapter{}
+\def\thissection{}
+
+\newcount\absseclevel % used to calculate proper heading level
+\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
+
+% @raisesections: treat @section as chapter, @subsection as section, etc.
+\def\raisesections{\global\advance\secbase by -1}
+\let\up=\raisesections % original BFox name
+
+% @lowersections: treat @chapter as section, @section as subsection, etc.
+\def\lowersections{\global\advance\secbase by 1}
+\let\down=\lowersections % original BFox name
+
+% we only have subsub.
+\chardef\maxseclevel = 3
+%
+% A numbered section within an unnumbered changes to unnumbered too.
+% To achive this, remember the "biggest" unnum. sec. we are currently in:
+\chardef\unmlevel = \maxseclevel
+%
+% Trace whether the current chapter is an appendix or not:
+% \chapheadtype is "N" or "A", unnumbered chapters are ignored.
+\def\chapheadtype{N}
+
+% Choose a heading macro
+% #1 is heading type
+% #2 is heading level
+% #3 is text for heading
+\def\genhead#1#2#3{%
+ % Compute the abs. sec. level:
+ \absseclevel=#2
+ \advance\absseclevel by \secbase
+ % Make sure \absseclevel doesn't fall outside the range:
+ \ifnum \absseclevel < 0
+ \absseclevel = 0
+ \else
+ \ifnum \absseclevel > 3
+ \absseclevel = 3
+ \fi
+ \fi
+ % The heading type:
+ \def\headtype{#1}%
+ \if \headtype U%
+ \ifnum \absseclevel < \unmlevel
+ \chardef\unmlevel = \absseclevel
+ \fi
+ \else
+ % Check for appendix sections:
+ \ifnum \absseclevel = 0
+ \edef\chapheadtype{\headtype}%
+ \else
+ \if \headtype A\if \chapheadtype N%
+ \errmessage{@appendix... within a non-appendix chapter}%
+ \fi\fi
+ \fi
+ % Check for numbered within unnumbered:
+ \ifnum \absseclevel > \unmlevel
+ \def\headtype{U}%
+ \else
+ \chardef\unmlevel = 3
+ \fi
+ \fi
+ % Now print the heading:
+ \if \headtype U%
+ \ifcase\absseclevel
+ \unnumberedzzz{#3}%
+ \or \unnumberedseczzz{#3}%
+ \or \unnumberedsubseczzz{#3}%
+ \or \unnumberedsubsubseczzz{#3}%
+ \fi
+ \else
+ \if \headtype A%
+ \ifcase\absseclevel
+ \appendixzzz{#3}%
+ \or \appendixsectionzzz{#3}%
+ \or \appendixsubseczzz{#3}%
+ \or \appendixsubsubseczzz{#3}%
+ \fi
+ \else
+ \ifcase\absseclevel
+ \chapterzzz{#3}%
+ \or \seczzz{#3}%
+ \or \numberedsubseczzz{#3}%
+ \or \numberedsubsubseczzz{#3}%
+ \fi
+ \fi
+ \fi
+ \suppressfirstparagraphindent
+}
+
+% an interface:
+\def\numhead{\genhead N}
+\def\apphead{\genhead A}
+\def\unnmhead{\genhead U}
+
+% @chapter, @appendix, @unnumbered. Increment top-level counter, reset
+% all lower-level sectioning counters to zero.
+%
+% Also set \chaplevelprefix, which we prepend to @float sequence numbers
+% (e.g., figures), q.v. By default (before any chapter), that is empty.
+\let\chaplevelprefix = \empty
+%
+\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
+\def\chapterzzz#1{%
+ % section resetting is \global in case the chapter is in a group, such
+ % as an @include file.
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\chapno by 1
+ %
+ % Used for \float.
+ \gdef\chaplevelprefix{\the\chapno.}%
+ \resetallfloatnos
+ %
+ \message{\putwordChapter\space \the\chapno}%
+ %
+ % Write the actual heading.
+ \chapmacro{#1}{Ynumbered}{\the\chapno}%
+ %
+ % So @section and the like are numbered underneath this chapter.
+ \global\let\section = \numberedsec
+ \global\let\subsection = \numberedsubsec
+ \global\let\subsubsection = \numberedsubsubsec
+}
+
+\outer\parseargdef\appendix{\apphead0{#1}} % normally apphead0 calls appendixzzz
+\def\appendixzzz#1{%
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\appendixno by 1
+ \gdef\chaplevelprefix{\appendixletter.}%
+ \resetallfloatnos
+ %
+ \def\appendixnum{\putwordAppendix\space \appendixletter}%
+ \message{\appendixnum}%
+ %
+ \chapmacro{#1}{Yappendix}{\appendixletter}%
+ %
+ \global\let\section = \appendixsec
+ \global\let\subsection = \appendixsubsec
+ \global\let\subsubsection = \appendixsubsubsec
+}
+
+\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
+\def\unnumberedzzz#1{%
+ \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
+ \global\advance\unnumberedno by 1
+ %
+ % Since an unnumbered has no number, no prefix for figures.
+ \global\let\chaplevelprefix = \empty
+ \resetallfloatnos
+ %
+ % This used to be simply \message{#1}, but TeX fully expands the
+ % argument to \message. Therefore, if #1 contained @-commands, TeX
+ % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
+ % expanded @cite (which turns out to cause errors because \cite is meant
+ % to be executed, not expanded).
+ %
+ % Anyway, we don't want the fully-expanded definition of @cite to appear
+ % as a result of the \message, we just want `@cite' itself. We use
+ % \the<toks register> to achieve this: TeX expands \the<toks> only once,
+ % simply yielding the contents of <toks register>. (We also do this for
+ % the toc entries.)
+ \toks0 = {#1}%
+ \message{(\the\toks0)}%
+ %
+ \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
+ %
+ \global\let\section = \unnumberedsec
+ \global\let\subsection = \unnumberedsubsec
+ \global\let\subsubsection = \unnumberedsubsubsec
+}
+
+% @centerchap is like @unnumbered, but the heading is centered.
+\outer\parseargdef\centerchap{%
+ % Well, we could do the following in a group, but that would break
+ % an assumption that \chapmacro is called at the outermost level.
+ % Thus we are safer this way: --kasal, 24feb04
+ \let\centerparametersmaybe = \centerparameters
+ \unnmhead0{#1}%
+ \let\centerparametersmaybe = \relax
+}
+
+% @top is like @unnumbered.
+\let\top\unnumbered
+
+% Sections.
+\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
+\def\seczzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
+}
+
+\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz
+\def\appendixsectionzzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
+}
+\let\appendixsec\appendixsection
+
+\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz
+\def\unnumberedseczzz#1{%
+ \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
+ \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
+}
+
+% Subsections.
+\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz
+\def\numberedsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
+}
+
+\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz
+\def\appendixsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Yappendix}%
+ {\appendixletter.\the\secno.\the\subsecno}%
+}
+
+\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
+\def\unnumberedsubseczzz#1{%
+ \global\subsubsecno=0 \global\advance\subsecno by 1
+ \sectionheading{#1}{subsec}{Ynothing}%
+ {\the\unnumberedno.\the\secno.\the\subsecno}%
+}
+
+% Subsubsections.
+\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz
+\def\numberedsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Ynumbered}%
+ {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz
+\def\appendixsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Yappendix}%
+ {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
+\def\unnumberedsubsubseczzz#1{%
+ \global\advance\subsubsecno by 1
+ \sectionheading{#1}{subsubsec}{Ynothing}%
+ {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
+}
+
+% These macros control what the section commands do, according
+% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
+% Define them by default for a numbered chapter.
+\let\section = \numberedsec
+\let\subsection = \numberedsubsec
+\let\subsubsection = \numberedsubsubsec
+
+% Define @majorheading, @heading and @subheading
+
+% NOTE on use of \vbox for chapter headings, section headings, and such:
+% 1) We use \vbox rather than the earlier \line to permit
+% overlong headings to fold.
+% 2) \hyphenpenalty is set to 10000 because hyphenation in a
+% heading is obnoxious; this forbids it.
+% 3) Likewise, headings look best if no \parindent is used, and
+% if justification is not attempted. Hence \raggedright.
+
+
+\def\majorheading{%
+ {\advance\chapheadingskip by 10pt \chapbreak }%
+ \parsearg\chapheadingzzz
+}
+
+\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
+\def\chapheadingzzz#1{%
+ {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}%
+ \bigskip \par\penalty 200\relax
+ \suppressfirstparagraphindent
+}
+
+% @heading, @subheading, @subsubheading.
+\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
+\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
+\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
+ \suppressfirstparagraphindent}
+
+% These macros generate a chapter, section, etc. heading only
+% (including whitespace, linebreaking, etc. around it),
+% given all the information in convenient, parsed form.
+
+%%% Args are the skip and penalty (usually negative)
+\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
+
+%%% Define plain chapter starts, and page on/off switching for it
+% Parameter controlling skip before chapter headings (if needed)
+
+\newskip\chapheadingskip
+
+\def\chapbreak{\dobreak \chapheadingskip {-4000}}
+\def\chappager{\par\vfill\supereject}
+\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
+
+\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
+
+\def\CHAPPAGoff{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chapbreak
+\global\let\pagealignmacro=\chappager}
+
+\def\CHAPPAGon{%
+\global\let\contentsalignmacro = \chappager
+\global\let\pchapsepmacro=\chappager
+\global\let\pagealignmacro=\chappager
+\global\def\HEADINGSon{\HEADINGSsingle}}
+
+\def\CHAPPAGodd{%
+\global\let\contentsalignmacro = \chapoddpage
+\global\let\pchapsepmacro=\chapoddpage
+\global\let\pagealignmacro=\chapoddpage
+\global\def\HEADINGSon{\HEADINGSdouble}}
+
+\CHAPPAGon
+
+% Chapter opening.
+%
+% #1 is the text, #2 is the section type (Ynumbered, Ynothing,
+% Yappendix, Yomitfromtoc), #3 the chapter number.
+%
+% To test against our argument.
+\def\Ynothingkeyword{Ynothing}
+\def\Yomitfromtockeyword{Yomitfromtoc}
+\def\Yappendixkeyword{Yappendix}
+%
+\def\chapmacro#1#2#3{%
+ \pchapsepmacro
+ {%
+ \chapfonts \rm
+ %
+ % Have to define \thissection before calling \donoderef, because the
+ % xref code eventually uses it. On the other hand, it has to be called
+ % after \pchapsepmacro, or the headline will change too soon.
+ \gdef\thissection{#1}%
+ \gdef\thischaptername{#1}%
+ %
+ % Only insert the separating space if we have a chapter/appendix
+ % number, and don't print the unnumbered ``number''.
+ \def\temptype{#2}%
+ \ifx\temptype\Ynothingkeyword
+ \setbox0 = \hbox{}%
+ \def\toctype{unnchap}%
+ \gdef\thischapternum{}%
+ \gdef\thischapter{#1}%
+ \else\ifx\temptype\Yomitfromtockeyword
+ \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
+ \def\toctype{omit}%
+ \gdef\thischapternum{}%
+ \gdef\thischapter{}%
+ \else\ifx\temptype\Yappendixkeyword
+ \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
+ \def\toctype{app}%
+ \xdef\thischapternum{\appendixletter}%
+ % We don't substitute the actual chapter name into \thischapter
+ % because we don't want its macros evaluated now. And we don't
+ % use \thissection because that changes with each section.
+ %
+ \xdef\thischapter{\putwordAppendix{} \appendixletter:
+ \noexpand\thischaptername}%
+ \else
+ \setbox0 = \hbox{#3\enspace}%
+ \def\toctype{numchap}%
+ \xdef\thischapternum{\the\chapno}%
+ \xdef\thischapter{\putwordChapter{} \the\chapno:
+ \noexpand\thischaptername}%
+ \fi\fi\fi
+ %
+ % Write the toc entry for this chapter. Must come before the
+ % \donoderef, because we include the current node name in the toc
+ % entry, and \donoderef resets it to empty.
+ \writetocentry{\toctype}{#1}{#3}%
+ %
+ % For pdftex, we have to write out the node definition (aka, make
+ % the pdfdest) after any page break, but before the actual text has
+ % been typeset. If the destination for the pdf outline is after the
+ % text, then jumping from the outline may wind up with the text not
+ % being visible, for instance under high magnification.
+ \donoderef{#2}%
+ %
+ % Typeset the actual heading.
+ \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
+ \hangindent=\wd0 \centerparametersmaybe
+ \unhbox0 #1\par}%
+ }%
+ \nobreak\bigskip % no page break after a chapter title
+ \nobreak
+}
+
+% @centerchap -- centered and unnumbered.
+\let\centerparametersmaybe = \relax
+\def\centerparameters{%
+ \advance\rightskip by 3\rightskip
+ \leftskip = \rightskip
+ \parfillskip = 0pt
+}
+
+
+% I don't think this chapter style is supported any more, so I'm not
+% updating it with the new noderef stuff. We'll see. --karl, 11aug03.
+%
+\def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
+%
+\def\unnchfopen #1{%
+\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt\raggedright
+ \rm #1\hfill}}\bigskip \par\nobreak
+}
+\def\chfopen #1#2{\chapoddpage {\chapfonts
+\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
+\par\penalty 5000 %
+}
+\def\centerchfopen #1{%
+\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
+ \parindent=0pt
+ \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
+}
+\def\CHAPFopen{%
+ \global\let\chapmacro=\chfopen
+ \global\let\centerchapmacro=\centerchfopen}
+
+
+% Section titles. These macros combine the section number parts and
+% call the generic \sectionheading to do the printing.
+%
+\newskip\secheadingskip
+\def\secheadingbreak{\dobreak \secheadingskip{-1000}}
+
+% Subsection titles.
+\newskip\subsecheadingskip
+\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
+
+% Subsubsection titles.
+\def\subsubsecheadingskip{\subsecheadingskip}
+\def\subsubsecheadingbreak{\subsecheadingbreak}
+
+
+% Print any size, any type, section title.
+%
+% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
+% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
+% section number.
+%
+\def\sectionheading#1#2#3#4{%
+ {%
+ % Switch to the right set of fonts.
+ \csname #2fonts\endcsname \rm
+ %
+ % Insert space above the heading.
+ \csname #2headingbreak\endcsname
+ %
+ % Only insert the space after the number if we have a section number.
+ \def\sectionlevel{#2}%
+ \def\temptype{#3}%
+ %
+ \ifx\temptype\Ynothingkeyword
+ \setbox0 = \hbox{}%
+ \def\toctype{unn}%
+ \gdef\thissection{#1}%
+ \else\ifx\temptype\Yomitfromtockeyword
+ % for @headings -- no section number, don't include in toc,
+ % and don't redefine \thissection.
+ \setbox0 = \hbox{}%
+ \def\toctype{omit}%
+ \let\sectionlevel=\empty
+ \else\ifx\temptype\Yappendixkeyword
+ \setbox0 = \hbox{#4\enspace}%
+ \def\toctype{app}%
+ \gdef\thissection{#1}%
+ \else
+ \setbox0 = \hbox{#4\enspace}%
+ \def\toctype{num}%
+ \gdef\thissection{#1}%
+ \fi\fi\fi
+ %
+ % Write the toc entry (before \donoderef). See comments in \chapmacro.
+ \writetocentry{\toctype\sectionlevel}{#1}{#4}%
+ %
+ % Write the node reference (= pdf destination for pdftex).
+ % Again, see comments in \chapmacro.
+ \donoderef{#3}%
+ %
+ % Interline glue will be inserted when the vbox is completed.
+ % That glue will be a valid breakpoint for the page, since it'll be
+ % preceded by a whatsit (usually from the \donoderef, or from the
+ % \writetocentry if there was no node). We don't want to allow that
+ % break, since then the whatsits could end up on page n while the
+ % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
+ \nobreak
+ %
+ % Output the actual section heading.
+ \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
+ \hangindent=\wd0 % zero if no section number
+ \unhbox0 #1}%
+ }%
+ % Add extra space after the heading -- half of whatever came above it.
+ % Don't allow stretch, though.
+ \kern .5 \csname #2headingskip\endcsname
+ %
+ % Do not let the kern be a potential breakpoint, as it would be if it
+ % was followed by glue.
+ \nobreak
+ %
+ % We'll almost certainly start a paragraph next, so don't let that
+ % glue accumulate. (Not a breakpoint because it's preceded by a
+ % discardable item.)
+ \vskip-\parskip
+ %
+ % This is purely so the last item on the list is a known \penalty >
+ % 10000. This is so \startdefun can avoid allowing breakpoints after
+ % section headings. Otherwise, it would insert a valid breakpoint between:
+ %
+ % @section sec-whatever
+ % @deffn def-whatever
+ \penalty 10001
+}
+
+
+\message{toc,}
+% Table of contents.
+\newwrite\tocfile
+
+% Write an entry to the toc file, opening it if necessary.
+% Called from @chapter, etc.
+%
+% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
+% We append the current node name (if any) and page number as additional
+% arguments for the \{chap,sec,...}entry macros which will eventually
+% read this. The node name is used in the pdf outlines as the
+% destination to jump to.
+%
+% We open the .toc file for writing here instead of at @setfilename (or
+% any other fixed time) so that @contents can be anywhere in the document.
+% But if #1 is `omit', then we don't do anything. This is used for the
+% table of contents chapter openings themselves.
+%
+\newif\iftocfileopened
+\def\omitkeyword{omit}%
+%
+\def\writetocentry#1#2#3{%
+ \edef\writetoctype{#1}%
+ \ifx\writetoctype\omitkeyword \else
+ \iftocfileopened\else
+ \immediate\openout\tocfile = \jobname.toc
+ \global\tocfileopenedtrue
+ \fi
+ %
+ \iflinks
+ {\atdummies
+ \edef\temp{%
+ \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
+ \temp
+ }%
+ \fi
+ \fi
+ %
+ % Tell \shipout to create a pdf destination on each page, if we're
+ % writing pdf. These are used in the table of contents. We can't
+ % just write one on every page because the title pages are numbered
+ % 1 and 2 (the page numbers aren't printed), and so are the first
+ % two pages of the document. Thus, we'd have two destinations named
+ % `1', and two named `2'.
+ \ifpdf \global\pdfmakepagedesttrue \fi
+}
+
+
+% These characters do not print properly in the Computer Modern roman
+% fonts, so we must take special care. This is more or less redundant
+% with the Texinfo input format setup at the end of this file.
+%
+\def\activecatcodes{%
+ \catcode`\"=\active
+ \catcode`\$=\active
+ \catcode`\<=\active
+ \catcode`\>=\active
+ \catcode`\\=\active
+ \catcode`\^=\active
+ \catcode`\_=\active
+ \catcode`\|=\active
+ \catcode`\~=\active
+}
+
+
+% Read the toc file, which is essentially Texinfo input.
+\def\readtocfile{%
+ \setupdatafile
+ \activecatcodes
+ \input \jobname.toc
+}
+
+\newskip\contentsrightmargin \contentsrightmargin=1in
+\newcount\savepageno
+\newcount\lastnegativepageno \lastnegativepageno = -1
+
+% Prepare to read what we've written to \tocfile.
+%
+\def\startcontents#1{%
+ % If @setchapternewpage on, and @headings double, the contents should
+ % start on an odd page, unlike chapters. Thus, we maintain
+ % \contentsalignmacro in parallel with \pagealignmacro.
+ % From: Torbjorn Granlund <[email protected]>
+ \contentsalignmacro
+ \immediate\closeout\tocfile
+ %
+ % Don't need to put `Contents' or `Short Contents' in the headline.
+ % It is abundantly clear what they are.
+ \def\thischapter{}%
+ \chapmacro{#1}{Yomitfromtoc}{}%
+ %
+ \savepageno = \pageno
+ \begingroup % Set up to handle contents files properly.
+ \raggedbottom % Worry more about breakpoints than the bottom.
+ \advance\hsize by -\contentsrightmargin % Don't use the full line length.
+ %
+ % Roman numerals for page numbers.
+ \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
+}
+
+
+% Normal (long) toc.
+\def\contents{%
+ \startcontents{\putwordTOC}%
+ \openin 1 \jobname.toc
+ \ifeof 1 \else
+ \readtocfile
+ \fi
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \ifeof 1 \else
+ \pdfmakeoutlines
+ \fi
+ \closein 1
+ \endgroup
+ \lastnegativepageno = \pageno
+ \global\pageno = \savepageno
+}
+
+% And just the chapters.
+\def\summarycontents{%
+ \startcontents{\putwordShortTOC}%
+ %
+ \let\numchapentry = \shortchapentry
+ \let\appentry = \shortchapentry
+ \let\unnchapentry = \shortunnchapentry
+ % We want a true roman here for the page numbers.
+ \secfonts
+ \let\rm=\shortcontrm \let\bf=\shortcontbf
+ \let\sl=\shortcontsl \let\tt=\shortconttt
+ \rm
+ \hyphenpenalty = 10000
+ \advance\baselineskip by 1pt % Open it up a little.
+ \def\numsecentry##1##2##3##4{}
+ \let\appsecentry = \numsecentry
+ \let\unnsecentry = \numsecentry
+ \let\numsubsecentry = \numsecentry
+ \let\appsubsecentry = \numsecentry
+ \let\unnsubsecentry = \numsecentry
+ \let\numsubsubsecentry = \numsecentry
+ \let\appsubsubsecentry = \numsecentry
+ \let\unnsubsubsecentry = \numsecentry
+ \openin 1 \jobname.toc
+ \ifeof 1 \else
+ \readtocfile
+ \fi
+ \closein 1
+ \vfill \eject
+ \contentsalignmacro % in case @setchapternewpage odd is in effect
+ \endgroup
+ \lastnegativepageno = \pageno
+ \global\pageno = \savepageno
+}
+\let\shortcontents = \summarycontents
+
+% Typeset the label for a chapter or appendix for the short contents.
+% The arg is, e.g., `A' for an appendix, or `3' for a chapter.
+%
+\def\shortchaplabel#1{%
+ % This space should be enough, since a single number is .5em, and the
+ % widest letter (M) is 1em, at least in the Computer Modern fonts.
+ % But use \hss just in case.
+ % (This space doesn't include the extra space that gets added after
+ % the label; that gets put in by \shortchapentry above.)
+ %
+ % We'd like to right-justify chapter numbers, but that looks strange
+ % with appendix letters. And right-justifying numbers and
+ % left-justifying letters looks strange when there is less than 10
+ % chapters. Have to read the whole toc once to know how many chapters
+ % there are before deciding ...
+ \hbox to 1em{#1\hss}%
+}
+
+% These macros generate individual entries in the table of contents.
+% The first argument is the chapter or section name.
+% The last argument is the page number.
+% The arguments in between are the chapter number, section number, ...
+
+% Chapters, in the main contents.
+\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
+%
+% Chapters, in the short toc.
+% See comments in \dochapentry re vbox and related settings.
+\def\shortchapentry#1#2#3#4{%
+ \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
+}
+
+% Appendices, in the main contents.
+% Need the word Appendix, and a fixed-size box.
+%
+\def\appendixbox#1{%
+ % We use M since it's probably the widest letter.
+ \setbox0 = \hbox{\putwordAppendix{} M}%
+ \hbox to \wd0{\putwordAppendix{} #1\hss}}
+%
+\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
+
+% Unnumbered chapters.
+\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
+\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
+
+% Sections.
+\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
+\let\appsecentry=\numsecentry
+\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
+
+% Subsections.
+\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
+\let\appsubsecentry=\numsubsecentry
+\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
+
+% And subsubsections.
+\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
+\let\appsubsubsecentry=\numsubsubsecentry
+\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
+
+% This parameter controls the indentation of the various levels.
+% Same as \defaultparindent.
+\newdimen\tocindent \tocindent = 15pt
+
+% Now for the actual typesetting. In all these, #1 is the text and #2 is the
+% page number.
+%
+% If the toc has to be broken over pages, we want it to be at chapters
+% if at all possible; hence the \penalty.
+\def\dochapentry#1#2{%
+ \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
+ \begingroup
+ \chapentryfonts
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+ \endgroup
+ \nobreak\vskip .25\baselineskip plus.1\baselineskip
+}
+
+\def\dosecentry#1#2{\begingroup
+ \secentryfonts \leftskip=\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsecentry#1#2{\begingroup
+ \subsecentryfonts \leftskip=2\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+\def\dosubsubsecentry#1#2{\begingroup
+ \subsubsecentryfonts \leftskip=3\tocindent
+ \tocentry{#1}{\dopageno\bgroup#2\egroup}%
+\endgroup}
+
+% We use the same \entry macro as for the index entries.
+\let\tocentry = \entry
+
+% Space between chapter (or whatever) number and the title.
+\def\labelspace{\hskip1em \relax}
+
+\def\dopageno#1{{\rm #1}}
+\def\doshortpageno#1{{\rm #1}}
+
+\def\chapentryfonts{\secfonts \rm}
+\def\secentryfonts{\textfonts}
+\def\subsecentryfonts{\textfonts}
+\def\subsubsecentryfonts{\textfonts}
+
+
+\message{environments,}
+% @foo ... @end foo.
+
+% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
+%
+% Since these characters are used in examples, it should be an even number of
+% \tt widths. Each \tt character is 1en, so two makes it 1em.
+%
+\def\point{$\star$}
+\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
+\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
+\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
+\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
+
+% The @error{} command.
+% Adapted from the TeXbook's \boxit.
+%
+\newbox\errorbox
+%
+{\tentt \global\dimen0 = 3em}% Width of the box.
+\dimen2 = .55pt % Thickness of rules
+% The text. (`r' is open on the right, `e' somewhat less so on the left.)
+\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt}
+%
+\setbox\errorbox=\hbox to \dimen0{\hfil
+ \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
+ \advance\hsize by -2\dimen2 % Rules.
+ \vbox{%
+ \hrule height\dimen2
+ \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
+ \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
+ \kern3pt\vrule width\dimen2}% Space to right.
+ \hrule height\dimen2}
+ \hfil}
+%
+\def\error{\leavevmode\lower.7ex\copy\errorbox}
+
+% @tex ... @end tex escapes into raw Tex temporarily.
+% One exception: @ is still an escape character, so that @end tex works.
+% But \@ or @@ will get a plain tex @ character.
+
+\envdef\tex{%
+ \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
+ \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
+ \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
+ \catcode `\%=14
+ \catcode `\+=\other
+ \catcode `\"=\other
+ \catcode `\|=\other
+ \catcode `\<=\other
+ \catcode `\>=\other
+ \escapechar=`\\
+ %
+ \let\b=\ptexb
+ \let\bullet=\ptexbullet
+ \let\c=\ptexc
+ \let\,=\ptexcomma
+ \let\.=\ptexdot
+ \let\dots=\ptexdots
+ \let\equiv=\ptexequiv
+ \let\!=\ptexexclam
+ \let\i=\ptexi
+ \let\indent=\ptexindent
+ \let\noindent=\ptexnoindent
+ \let\{=\ptexlbrace
+ \let\+=\tabalign
+ \let\}=\ptexrbrace
+ \let\/=\ptexslash
+ \let\*=\ptexstar
+ \let\t=\ptext
+ \let\frenchspacing=\plainfrenchspacing
+ %
+ \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
+ \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
+ \def\@{@}%
+}
+% There is no need to define \Etex.
+
+% Define @lisp ... @end lisp.
+% @lisp environment forms a group so it can rebind things,
+% including the definition of @end lisp (which normally is erroneous).
+
+% Amount to narrow the margins by for @lisp.
+\newskip\lispnarrowing \lispnarrowing=0.4in
+
+% This is the definition that ^^M gets inside @lisp, @example, and other
+% such environments. \null is better than a space, since it doesn't
+% have any width.
+\def\lisppar{\null\endgraf}
+
+% This space is always present above and below environments.
+\newskip\envskipamount \envskipamount = 0pt
+
+% Make spacing and below environment symmetrical. We use \parskip here
+% to help in doing that, since in @example-like environments \parskip
+% is reset to zero; thus the \afterenvbreak inserts no space -- but the
+% start of the next paragraph will insert \parskip.
+%
+\def\aboveenvbreak{{%
+ % =10000 instead of <10000 because of a special case in \itemzzz and
+ % \sectionheading, q.v.
+ \ifnum \lastpenalty=10000 \else
+ \advance\envskipamount by \parskip
+ \endgraf
+ \ifdim\lastskip<\envskipamount
+ \removelastskip
+ % it's not a good place to break if the last penalty was \nobreak
+ % or better ...
+ \ifnum\lastpenalty<10000 \penalty-50 \fi
+ \vskip\envskipamount
+ \fi
+ \fi
+}}
+
+\let\afterenvbreak = \aboveenvbreak
+
+% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
+% also clear it, so that its embedded environments do the narrowing again.
+\let\nonarrowing=\relax
+
+% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
+% environment contents.
+\font\circle=lcircle10
+\newdimen\circthick
+\newdimen\cartouter\newdimen\cartinner
+\newskip\normbskip\newskip\normpskip\newskip\normlskip
+\circthick=\fontdimen8\circle
+%
+\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
+\def\ctr{{\hskip 6pt\circle\char'010}}
+\def\cbl{{\circle\char'012\hskip -6pt}}
+\def\cbr{{\hskip 6pt\circle\char'011}}
+\def\carttop{\hbox to \cartouter{\hskip\lskip
+ \ctl\leaders\hrule height\circthick\hfil\ctr
+ \hskip\rskip}}
+\def\cartbot{\hbox to \cartouter{\hskip\lskip
+ \cbl\leaders\hrule height\circthick\hfil\cbr
+ \hskip\rskip}}
+%
+\newskip\lskip\newskip\rskip
+
+\envdef\cartouche{%
+ \ifhmode\par\fi % can't be in the midst of a paragraph.
+ \startsavinginserts
+ \lskip=\leftskip \rskip=\rightskip
+ \leftskip=0pt\rightskip=0pt % we want these *outside*.
+ \cartinner=\hsize \advance\cartinner by-\lskip
+ \advance\cartinner by-\rskip
+ \cartouter=\hsize
+ \advance\cartouter by 18.4pt % allow for 3pt kerns on either
+ % side, and for 6pt waste from
+ % each corner char, and rule thickness
+ \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
+ % Flag to tell @lisp, etc., not to narrow margin.
+ \let\nonarrowing = t%
+ \vbox\bgroup
+ \baselineskip=0pt\parskip=0pt\lineskip=0pt
+ \carttop
+ \hbox\bgroup
+ \hskip\lskip
+ \vrule\kern3pt
+ \vbox\bgroup
+ \kern3pt
+ \hsize=\cartinner
+ \baselineskip=\normbskip
+ \lineskip=\normlskip
+ \parskip=\normpskip
+ \vskip -\parskip
+ \comment % For explanation, see the end of \def\group.
+}
+\def\Ecartouche{%
+ \ifhmode\par\fi
+ \kern3pt
+ \egroup
+ \kern3pt\vrule
+ \hskip\rskip
+ \egroup
+ \cartbot
+ \egroup
+ \checkinserts
+}
+
+
+% This macro is called at the beginning of all the @example variants,
+% inside a group.
+\def\nonfillstart{%
+ \aboveenvbreak
+ \hfuzz = 12pt % Don't be fussy
+ \sepspaces % Make spaces be word-separators rather than space tokens.
+ \let\par = \lisppar % don't ignore blank lines
+ \obeylines % each line of input is a line of output
+ \parskip = 0pt
+ \parindent = 0pt
+ \emergencystretch = 0pt % don't try to avoid overfull boxes
+ \ifx\nonarrowing\relax
+ \advance \leftskip by \lispnarrowing
+ \exdentamount=\lispnarrowing
+ \else
+ \let\nonarrowing = \relax
+ \fi
+ \let\exdent=\nofillexdent
+}
+
+% If you want all examples etc. small: @set dispenvsize small.
+% If you want even small examples the full size: @set dispenvsize nosmall.
+% This affects the following displayed environments:
+% @example, @display, @format, @lisp
+%
+\def\smallword{small}
+\def\nosmallword{nosmall}
+\let\SETdispenvsize\relax
+\def\setnormaldispenv{%
+ \ifx\SETdispenvsize\smallword
+ % end paragraph for sake of leading, in case document has no blank
+ % line. This is redundant with what happens in \aboveenvbreak, but
+ % we need to do it before changing the fonts, and it's inconvenient
+ % to change the fonts afterward.
+ \ifnum \lastpenalty=10000 \else \endgraf \fi
+ \smallexamplefonts \rm
+ \fi
+}
+\def\setsmalldispenv{%
+ \ifx\SETdispenvsize\nosmallword
+ \else
+ \ifnum \lastpenalty=10000 \else \endgraf \fi
+ \smallexamplefonts \rm
+ \fi
+}
+
+% We often define two environments, @foo and @smallfoo.
+% Let's do it by one command:
+\def\makedispenv #1#2{
+ \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}
+ \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}
+ \expandafter\let\csname E#1\endcsname \afterenvbreak
+ \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
+}
+
+% Define two synonyms:
+\def\maketwodispenvs #1#2#3{
+ \makedispenv{#1}{#3}
+ \makedispenv{#2}{#3}
+}
+
+% @lisp: indented, narrowed, typewriter font; @example: same as @lisp.
+%
+% @smallexample and @smalllisp: use smaller fonts.
+% Originally contributed by Pavel@xerox.
+%
+\maketwodispenvs {lisp}{example}{%
+ \nonfillstart
+ \tt\quoteexpand
+ \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
+ \gobble % eat return
+}
+% @display/@smalldisplay: same as @lisp except keep current font.
+%
+\makedispenv {display}{%
+ \nonfillstart
+ \gobble
+}
+
+% @format/@smallformat: same as @display except don't narrow margins.
+%
+\makedispenv{format}{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \gobble
+}
+
+% @flushleft: same as @format, but doesn't obey \SETdispenvsize.
+\envdef\flushleft{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \gobble
+}
+\let\Eflushleft = \afterenvbreak
+
+% @flushright.
+%
+\envdef\flushright{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ \advance\leftskip by 0pt plus 1fill
+ \gobble
+}
+\let\Eflushright = \afterenvbreak
+
+
+% @quotation does normal linebreaking (hence we can't use \nonfillstart)
+% and narrows the margins. We keep \parskip nonzero in general, since
+% we're doing normal filling. So, when using \aboveenvbreak and
+% \afterenvbreak, temporarily make \parskip 0.
+%
+\envdef\quotation{%
+ {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
+ \parindent=0pt
+ %
+ % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
+ \ifx\nonarrowing\relax
+ \advance\leftskip by \lispnarrowing
+ \advance\rightskip by \lispnarrowing
+ \exdentamount = \lispnarrowing
+ \else
+ \let\nonarrowing = \relax
+ \fi
+ \parsearg\quotationlabel
+}
+
+% We have retained a nonzero parskip for the environment, since we're
+% doing normal filling.
+%
+\def\Equotation{%
+ \par
+ \ifx\quotationauthor\undefined\else
+ % indent a bit.
+ \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
+ \fi
+ {\parskip=0pt \afterenvbreak}%
+}
+
+% If we're given an argument, typeset it in bold with a colon after.
+\def\quotationlabel#1{%
+ \def\temp{#1}%
+ \ifx\temp\empty \else
+ {\bf #1: }%
+ \fi
+}
+
+
+% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
+% If we want to allow any <char> as delimiter,
+% we need the curly braces so that makeinfo sees the @verb command, eg:
+% `@verbx...x' would look like the '@verbx' command. [email protected]
+%
+% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
+%
+% [Knuth] p.344; only we need to do the other characters Texinfo sets
+% active too. Otherwise, they get lost as the first character on a
+% verbatim line.
+\def\dospecials{%
+ \do\ \do\\\do\{\do\}\do\$\do\&%
+ \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
+ \do\<\do\>\do\|\do\@\do+\do\"%
+}
+%
+% [Knuth] p. 380
+\def\uncatcodespecials{%
+ \def\do##1{\catcode`##1=\other}\dospecials}
+%
+% [Knuth] pp. 380,381,391
+% Disable Spanish ligatures ?` and !` of \tt font
+\begingroup
+ \catcode`\`=\active\gdef`{\relax\lq}
+\endgroup
+%
+% Setup for the @verb command.
+%
+% Eight spaces for a tab
+\begingroup
+ \catcode`\^^I=\active
+ \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
+\endgroup
+%
+\def\setupverb{%
+ \tt % easiest (and conventionally used) font for verbatim
+ \def\par{\leavevmode\endgraf}%
+ \catcode`\`=\active
+ \tabeightspaces
+ % Respect line breaks,
+ % print special symbols as themselves, and
+ % make each space count
+ % must do in this order:
+ \obeylines \uncatcodespecials \sepspaces
+}
+
+% Setup for the @verbatim environment
+%
+% Real tab expansion
+\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
+%
+\def\starttabbox{\setbox0=\hbox\bgroup}
+
+% Allow an option to not replace quotes with a regular directed right
+% quote/apostrophe (char 0x27), but instead use the undirected quote
+% from cmtt (char 0x0d). The undirected quote is ugly, so don't make it
+% the default, but it works for pasting with more pdf viewers (at least
+% evince), the lilypond developers report. xpdf does work with the
+% regular 0x27.
+%
+\def\codequoteright{%
+ \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
+ '%
+ \else
+ \char'15
+ \fi
+}
+%
+% and a similar option for the left quote char vs. a grave accent.
+% Modern fonts display ASCII 0x60 as a grave accent, so some people like
+% the code environments to do likewise.
+%
+\def\codequoteleft{%
+ \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
+ `%
+ \else
+ \char'22
+ \fi
+}
+%
+\begingroup
+ \catcode`\^^I=\active
+ \gdef\tabexpand{%
+ \catcode`\^^I=\active
+ \def^^I{\leavevmode\egroup
+ \dimen0=\wd0 % the width so far, or since the previous tab
+ \divide\dimen0 by\tabw
+ \multiply\dimen0 by\tabw % compute previous multiple of \tabw
+ \advance\dimen0 by\tabw % advance to next multiple of \tabw
+ \wd0=\dimen0 \box0 \starttabbox
+ }%
+ }
+ \catcode`\'=\active
+ \gdef\rquoteexpand{\catcode\rquoteChar=\active \def'{\codequoteright}}%
+ %
+ \catcode`\`=\active
+ \gdef\lquoteexpand{\catcode\lquoteChar=\active \def`{\codequoteleft}}%
+ %
+ \gdef\quoteexpand{\rquoteexpand \lquoteexpand}%
+\endgroup
+
+% start the verbatim environment.
+\def\setupverbatim{%
+ \let\nonarrowing = t%
+ \nonfillstart
+ % Easiest (and conventionally used) font for verbatim
+ \tt
+ \def\par{\leavevmode\egroup\box0\endgraf}%
+ \catcode`\`=\active
+ \tabexpand
+ \quoteexpand
+ % Respect line breaks,
+ % print special symbols as themselves, and
+ % make each space count
+ % must do in this order:
+ \obeylines \uncatcodespecials \sepspaces
+ \everypar{\starttabbox}%
+}
+
+% Do the @verb magic: verbatim text is quoted by unique
+% delimiter characters. Before first delimiter expect a
+% right brace, after last delimiter expect closing brace:
+%
+% \def\doverb'{'<char>#1<char>'}'{#1}
+%
+% [Knuth] p. 382; only eat outer {}
+\begingroup
+ \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
+ \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
+\endgroup
+%
+\def\verb{\begingroup\setupverb\doverb}
+%
+%
+% Do the @verbatim magic: define the macro \doverbatim so that
+% the (first) argument ends when '@end verbatim' is reached, ie:
+%
+% \def\doverbatim#1@end verbatim{#1}
+%
+% For Texinfo it's a lot easier than for LaTeX,
+% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
+% we need not redefine '\', '{' and '}'.
+%
+% Inspired by LaTeX's verbatim command set [latex.ltx]
+%
+\begingroup
+ \catcode`\ =\active
+ \obeylines %
+ % ignore everything up to the first ^^M, that's the newline at the end
+ % of the @verbatim input line itself. Otherwise we get an extra blank
+ % line in the output.
+ \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
+ % We really want {...\end verbatim} in the body of the macro, but
+ % without the active space; thus we have to use \xdef and \gobble.
+\endgroup
+%
+\envdef\verbatim{%
+ \setupverbatim\doverbatim
+}
+\let\Everbatim = \afterenvbreak
+
+
+% @verbatiminclude FILE - insert text of file in verbatim environment.
+%
+\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
+%
+\def\doverbatiminclude#1{%
+ {%
+ \makevalueexpandable
+ \setupverbatim
+ \input #1
+ \afterenvbreak
+ }%
+}
+
+% @copying ... @end copying.
+% Save the text away for @insertcopying later.
+%
+% We save the uninterpreted tokens, rather than creating a box.
+% Saving the text in a box would be much easier, but then all the
+% typesetting commands (@smallbook, font changes, etc.) have to be done
+% beforehand -- and a) we want @copying to be done first in the source
+% file; b) letting users define the frontmatter in as flexible order as
+% possible is very desirable.
+%
+\def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
+\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
+%
+\def\insertcopying{%
+ \begingroup
+ \parindent = 0pt % paragraph indentation looks wrong on title page
+ \scanexp\copyingtext
+ \endgroup
+}
+
+
+\message{defuns,}
+% @defun etc.
+
+\newskip\defbodyindent \defbodyindent=.4in
+\newskip\defargsindent \defargsindent=50pt
+\newskip\deflastargmargin \deflastargmargin=18pt
+\newcount\defunpenalty
+
+% Start the processing of @deffn:
+\def\startdefun{%
+ \ifnum\lastpenalty<10000
+ \medbreak
+ \defunpenalty=10003 % Will keep this @deffn together with the
+ % following @def command, see below.
+ \else
+ % If there are two @def commands in a row, we'll have a \nobreak,
+ % which is there to keep the function description together with its
+ % header. But if there's nothing but headers, we need to allow a
+ % break somewhere. Check specifically for penalty 10002, inserted
+ % by \printdefunline, instead of 10000, since the sectioning
+ % commands also insert a nobreak penalty, and we don't want to allow
+ % a break between a section heading and a defun.
+ %
+ % As a minor refinement, we avoid "club" headers by signalling
+ % with penalty of 10003 after the very first @deffn in the
+ % sequence (see above), and penalty of 10002 after any following
+ % @def command.
+ \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
+ %
+ % Similarly, after a section heading, do not allow a break.
+ % But do insert the glue.
+ \medskip % preceded by discardable penalty, so not a breakpoint
+ \fi
+ %
+ \parindent=0in
+ \advance\leftskip by \defbodyindent
+ \exdentamount=\defbodyindent
+}
+
+\def\dodefunx#1{%
+ % First, check whether we are in the right environment:
+ \checkenv#1%
+ %
+ % As above, allow line break if we have multiple x headers in a row.
+ % It's not a great place, though.
+ \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
+ %
+ % And now, it's time to reuse the body of the original defun:
+ \expandafter\gobbledefun#1%
+}
+\def\gobbledefun#1\startdefun{}
+
+% \printdefunline \deffnheader{text}
+%
+\def\printdefunline#1#2{%
+ \begingroup
+ % call \deffnheader:
+ #1#2 \endheader
+ % common ending:
+ \interlinepenalty = 10000
+ \advance\rightskip by 0pt plus 1fil
+ \endgraf
+ \nobreak\vskip -\parskip
+ \penalty\defunpenalty % signal to \startdefun and \dodefunx
+ % Some of the @defun-type tags do not enable magic parentheses,
+ % rendering the following check redundant. But we don't optimize.
+ \checkparencounts
+ \endgroup
+}
+
+\def\Edefun{\endgraf\medbreak}
+
+% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
+% the only thing remainnig is to define \deffnheader.
+%
+\def\makedefun#1{%
+ \expandafter\let\csname E#1\endcsname = \Edefun
+ \edef\temp{\noexpand\domakedefun
+ \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
+ \temp
+}
+
+% \domakedefun \deffn \deffnx \deffnheader
+%
+% Define \deffn and \deffnx, without parameters.
+% \deffnheader has to be defined explicitly.
+%
+\def\domakedefun#1#2#3{%
+ \envdef#1{%
+ \startdefun
+ \parseargusing\activeparens{\printdefunline#3}%
+ }%
+ \def#2{\dodefunx#1}%
+ \def#3%
+}
+
+%%% Untyped functions:
+
+% @deffn category name args
+\makedefun{deffn}{\deffngeneral{}}
+
+% @deffn category class name args
+\makedefun{defop}#1 {\defopon{#1\ \putwordon}}
+
+% \defopon {category on}class name args
+\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
+
+% \deffngeneral {subind}category name args
+%
+\def\deffngeneral#1#2 #3 #4\endheader{%
+ % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
+ \dosubind{fn}{\code{#3}}{#1}%
+ \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
+}
+
+%%% Typed functions:
+
+% @deftypefn category type name args
+\makedefun{deftypefn}{\deftypefngeneral{}}
+
+% @deftypeop category class type name args
+\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
+
+% \deftypeopon {category on}class type name args
+\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
+
+% \deftypefngeneral {subind}category type name args
+%
+\def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
+ \dosubind{fn}{\code{#4}}{#1}%
+ \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
+}
+
+%%% Typed variables:
+
+% @deftypevr category type var args
+\makedefun{deftypevr}{\deftypecvgeneral{}}
+
+% @deftypecv category class type var args
+\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
+
+% \deftypecvof {category of}class type var args
+\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
+
+% \deftypecvgeneral {subind}category type var args
+%
+\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
+ \dosubind{vr}{\code{#4}}{#1}%
+ \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
+}
+
+%%% Untyped variables:
+
+% @defvr category var args
+\makedefun{defvr}#1 {\deftypevrheader{#1} {} }
+
+% @defcv category class var args
+\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
+
+% \defcvof {category of}class var args
+\def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
+
+%%% Type:
+% @deftp category name args
+\makedefun{deftp}#1 #2 #3\endheader{%
+ \doind{tp}{\code{#2}}%
+ \defname{#1}{}{#2}\defunargs{#3\unskip}%
+}
+
+% Remaining @defun-like shortcuts:
+\makedefun{defun}{\deffnheader{\putwordDeffunc} }
+\makedefun{defmac}{\deffnheader{\putwordDefmac} }
+\makedefun{defspec}{\deffnheader{\putwordDefspec} }
+\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
+\makedefun{defvar}{\defvrheader{\putwordDefvar} }
+\makedefun{defopt}{\defvrheader{\putwordDefopt} }
+\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
+\makedefun{defmethod}{\defopon\putwordMethodon}
+\makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
+\makedefun{defivar}{\defcvof\putwordInstanceVariableof}
+\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
+
+% \defname, which formats the name of the @def (not the args).
+% #1 is the category, such as "Function".
+% #2 is the return type, if any.
+% #3 is the function name.
+%
+% We are followed by (but not passed) the arguments, if any.
+%
+\def\defname#1#2#3{%
+ % Get the values of \leftskip and \rightskip as they were outside the @def...
+ \advance\leftskip by -\defbodyindent
+ %
+ % How we'll format the type name. Putting it in brackets helps
+ % distinguish it from the body text that may end up on the next line
+ % just below it.
+ \def\temp{#1}%
+ \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
+ %
+ % Figure out line sizes for the paragraph shape.
+ % The first line needs space for \box0; but if \rightskip is nonzero,
+ % we need only space for the part of \box0 which exceeds it:
+ \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
+ % The continuations:
+ \dimen2=\hsize \advance\dimen2 by -\defargsindent
+ % (plain.tex says that \dimen1 should be used only as global.)
+ \parshape 2 0in \dimen0 \defargsindent \dimen2
+ %
+ % Put the type name to the right margin.
+ \noindent
+ \hbox to 0pt{%
+ \hfil\box0 \kern-\hsize
+ % \hsize has to be shortened this way:
+ \kern\leftskip
+ % Intentionally do not respect \rightskip, since we need the space.
+ }%
+ %
+ % Allow all lines to be underfull without complaint:
+ \tolerance=10000 \hbadness=10000
+ \exdentamount=\defbodyindent
+ {%
+ % defun fonts. We use typewriter by default (used to be bold) because:
+ % . we're printing identifiers, they should be in tt in principle.
+ % . in languages with many accents, such as Czech or French, it's
+ % common to leave accents off identifiers. The result looks ok in
+ % tt, but exceedingly strange in rm.
+ % . we don't want -- and --- to be treated as ligatures.
+ % . this still does not fix the ?` and !` ligatures, but so far no
+ % one has made identifiers using them :).
+ \df \tt
+ \def\temp{#2}% return value type
+ \ifx\temp\empty\else \tclose{\temp} \fi
+ #3% output function name
+ }%
+ {\rm\enskip}% hskip 0.5 em of \tenrm
+ %
+ \boldbrax
+ % arguments will be output next, if any.
+}
+
+% Print arguments in slanted roman (not ttsl), inconsistently with using
+% tt for the name. This is because literal text is sometimes needed in
+% the argument list (groff manual), and ttsl and tt are not very
+% distinguishable. Prevent hyphenation at `-' chars.
+%
+\def\defunargs#1{%
+ % use sl by default (not ttsl),
+ % tt for the names.
+ \df \sl \hyphenchar\font=0
+ %
+ % On the other hand, if an argument has two dashes (for instance), we
+ % want a way to get ttsl. Let's try @var for that.
+ \let\var=\ttslanted
+ #1%
+ \sl\hyphenchar\font=45
+}
+
+% We want ()&[] to print specially on the defun line.
+%
+\def\activeparens{%
+ \catcode`\(=\active \catcode`\)=\active
+ \catcode`\[=\active \catcode`\]=\active
+ \catcode`\&=\active
+}
+
+% Make control sequences which act like normal parenthesis chars.
+\let\lparen = ( \let\rparen = )
+
+% Be sure that we always have a definition for `(', etc. For example,
+% if the fn name has parens in it, \boldbrax will not be in effect yet,
+% so TeX would otherwise complain about undefined control sequence.
+{
+ \activeparens
+ \global\let(=\lparen \global\let)=\rparen
+ \global\let[=\lbrack \global\let]=\rbrack
+ \global\let& = \&
+
+ \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
+ \gdef\magicamp{\let&=\amprm}
+}
+
+\newcount\parencount
+
+% If we encounter &foo, then turn on ()-hacking afterwards
+\newif\ifampseen
+\def\amprm#1 {\ampseentrue{\bf\&#1 }}
+
+\def\parenfont{%
+ \ifampseen
+ % At the first level, print parens in roman,
+ % otherwise use the default font.
+ \ifnum \parencount=1 \rm \fi
+ \else
+ % The \sf parens (in \boldbrax) actually are a little bolder than
+ % the contained text. This is especially needed for [ and ] .
+ \sf
+ \fi
+}
+\def\infirstlevel#1{%
+ \ifampseen
+ \ifnum\parencount=1
+ #1%
+ \fi
+ \fi
+}
+\def\bfafterword#1 {#1 \bf}
+
+\def\opnr{%
+ \global\advance\parencount by 1
+ {\parenfont(}%
+ \infirstlevel \bfafterword
+}
+\def\clnr{%
+ {\parenfont)}%
+ \infirstlevel \sl
+ \global\advance\parencount by -1
+}
+
+\newcount\brackcount
+\def\lbrb{%
+ \global\advance\brackcount by 1
+ {\bf[}%
+}
+\def\rbrb{%
+ {\bf]}%
+ \global\advance\brackcount by -1
+}
+
+\def\checkparencounts{%
+ \ifnum\parencount=0 \else \badparencount \fi
+ \ifnum\brackcount=0 \else \badbrackcount \fi
+}
+\def\badparencount{%
+ \errmessage{Unbalanced parentheses in @def}%
+ \global\parencount=0
+}
+\def\badbrackcount{%
+ \errmessage{Unbalanced square braces in @def}%
+ \global\brackcount=0
+}
+
+
+\message{macros,}
+% @macro.
+
+% To do this right we need a feature of e-TeX, \scantokens,
+% which we arrange to emulate with a temporary file in ordinary TeX.
+\ifx\eTeXversion\undefined
+ \newwrite\macscribble
+ \def\scantokens#1{%
+ \toks0={#1}%
+ \immediate\openout\macscribble=\jobname.tmp
+ \immediate\write\macscribble{\the\toks0}%
+ \immediate\closeout\macscribble
+ \input \jobname.tmp
+ }
+\fi
+
+\def\scanmacro#1{%
+ \begingroup
+ \newlinechar`\^^M
+ \let\xeatspaces\eatspaces
+ % Undo catcode changes of \startcontents and \doprintindex
+ % When called from @insertcopying or (short)caption, we need active
+ % backslash to get it printed correctly. Previously, we had
+ % \catcode`\\=\other instead. We'll see whether a problem appears
+ % with macro expansion. --kasal, 19aug04
+ \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
+ % ... and \example
+ \spaceisspace
+ %
+ % Append \endinput to make sure that TeX does not see the ending newline.
+ % I've verified that it is necessary both for e-TeX and for ordinary TeX
+ % --kasal, 29nov03
+ \scantokens{#1\endinput}%
+ \endgroup
+}
+
+\def\scanexp#1{%
+ \edef\temp{\noexpand\scanmacro{#1}}%
+ \temp
+}
+
+\newcount\paramno % Count of parameters
+\newtoks\macname % Macro name
+\newif\ifrecursive % Is it recursive?
+
+% List of all defined macros in the form
+% \definedummyword\macro1\definedummyword\macro2...
+% Currently is also contains all @aliases; the list can be split
+% if there is a need.
+\def\macrolist{}
+
+% Add the macro to \macrolist
+\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
+\def\addtomacrolistxxx#1{%
+ \toks0 = \expandafter{\macrolist\definedummyword#1}%
+ \xdef\macrolist{\the\toks0}%
+}
+
+% Utility routines.
+% This does \let #1 = #2, with \csnames; that is,
+% \let \csname#1\endcsname = \csname#2\endcsname
+% (except of course we have to play expansion games).
+%
+\def\cslet#1#2{%
+ \expandafter\let
+ \csname#1\expandafter\endcsname
+ \csname#2\endcsname
+}
+
+% Trim leading and trailing spaces off a string.
+% Concepts from aro-bend problem 15 (see CTAN).
+{\catcode`\@=11
+\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
+\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
+\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
+\def\unbrace#1{#1}
+\unbrace{\gdef\trim@@@ #1 } #2@{#1}
+}
+
+% Trim a single trailing ^^M off a string.
+{\catcode`\^^M=\other \catcode`\Q=3%
+\gdef\eatcr #1{\eatcra #1Q^^MQ}%
+\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
+\gdef\eatcrb#1Q#2Q{#1}%
+}
+
+% Macro bodies are absorbed as an argument in a context where
+% all characters are catcode 10, 11 or 12, except \ which is active
+% (as in normal texinfo). It is necessary to change the definition of \.
+
+% It's necessary to have hard CRs when the macro is executed. This is
+% done by making ^^M (\endlinechar) catcode 12 when reading the macro
+% body, and then making it the \newlinechar in \scanmacro.
+
+\def\scanctxt{%
+ \catcode`\"=\other
+ \catcode`\+=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\@=\other
+ \catcode`\^=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\~=\other
+}
+
+\def\scanargctxt{%
+ \scanctxt
+ \catcode`\\=\other
+ \catcode`\^^M=\other
+}
+
+\def\macrobodyctxt{%
+ \scanctxt
+ \catcode`\{=\other
+ \catcode`\}=\other
+ \catcode`\^^M=\other
+ \usembodybackslash
+}
+
+\def\macroargctxt{%
+ \scanctxt
+ \catcode`\\=\other
+}
+
+% \mbodybackslash is the definition of \ in @macro bodies.
+% It maps \foo\ => \csname macarg.foo\endcsname => #N
+% where N is the macro parameter number.
+% We define \csname macarg.\endcsname to be \realbackslash, so
+% \\ in macro replacement text gets you a backslash.
+
+{\catcode`@=0 @catcode`@\=@active
+ @gdef@usembodybackslash{@let\=@mbodybackslash}
+ @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
+}
+\expandafter\def\csname macarg.\endcsname{\realbackslash}
+
+\def\macro{\recursivefalse\parsearg\macroxxx}
+\def\rmacro{\recursivetrue\parsearg\macroxxx}
+
+\def\macroxxx#1{%
+ \getargs{#1}% now \macname is the macname and \argl the arglist
+ \ifx\argl\empty % no arguments
+ \paramno=0%
+ \else
+ \expandafter\parsemargdef \argl;%
+ \fi
+ \if1\csname ismacro.\the\macname\endcsname
+ \message{Warning: redefining \the\macname}%
+ \else
+ \expandafter\ifx\csname \the\macname\endcsname \relax
+ \else \errmessage{Macro name \the\macname\space already defined}\fi
+ \global\cslet{macsave.\the\macname}{\the\macname}%
+ \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
+ \addtomacrolist{\the\macname}%
+ \fi
+ \begingroup \macrobodyctxt
+ \ifrecursive \expandafter\parsermacbody
+ \else \expandafter\parsemacbody
+ \fi}
+
+\parseargdef\unmacro{%
+ \if1\csname ismacro.#1\endcsname
+ \global\cslet{#1}{macsave.#1}%
+ \global\expandafter\let \csname ismacro.#1\endcsname=0%
+ % Remove the macro name from \macrolist:
+ \begingroup
+ \expandafter\let\csname#1\endcsname \relax
+ \let\definedummyword\unmacrodo
+ \xdef\macrolist{\macrolist}%
+ \endgroup
+ \else
+ \errmessage{Macro #1 not defined}%
+ \fi
+}
+
+% Called by \do from \dounmacro on each macro. The idea is to omit any
+% macro definitions that have been changed to \relax.
+%
+\def\unmacrodo#1{%
+ \ifx #1\relax
+ % remove this
+ \else
+ \noexpand\definedummyword \noexpand#1%
+ \fi
+}
+
+% This makes use of the obscure feature that if the last token of a
+% <parameter list> is #, then the preceding argument is delimited by
+% an opening brace, and that opening brace is not consumed.
+\def\getargs#1{\getargsxxx#1{}}
+\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
+\def\getmacname #1 #2\relax{\macname={#1}}
+\def\getmacargs#1{\def\argl{#1}}
+
+% Parse the optional {params} list. Set up \paramno and \paramlist
+% so \defmacro knows what to do. Define \macarg.blah for each blah
+% in the params list, to be ##N where N is the position in that list.
+% That gets used by \mbodybackslash (above).
+
+% We need to get `macro parameter char #' into several definitions.
+% The technique used is stolen from LaTeX: let \hash be something
+% unexpandable, insert that wherever you need a #, and then redefine
+% it to # just before using the token list produced.
+%
+% The same technique is used to protect \eatspaces till just before
+% the macro is used.
+
+\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
+ \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
+\def\parsemargdefxxx#1,{%
+ \if#1;\let\next=\relax
+ \else \let\next=\parsemargdefxxx
+ \advance\paramno by 1%
+ \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
+ {\xeatspaces{\hash\the\paramno}}%
+ \edef\paramlist{\paramlist\hash\the\paramno,}%
+ \fi\next}
+
+% These two commands read recursive and nonrecursive macro bodies.
+% (They're different since rec and nonrec macros end differently.)
+
+\long\def\parsemacbody#1@end macro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+\long\def\parsermacbody#1@end rmacro%
+{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+
+% This defines the macro itself. There are six cases: recursive and
+% nonrecursive macros of zero, one, and many arguments.
+% Much magic with \expandafter here.
+% \xdef is used so that macro definitions will survive the file
+% they're defined in; @include reads the file inside a group.
+\def\defmacro{%
+ \let\hash=##% convert placeholders to macro parameter chars
+ \ifrecursive
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\scanmacro{\temp}}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup\noexpand\scanmacro{\temp}}%
+ \else % many
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{\egroup\noexpand\scanmacro{\temp}}%
+ \fi
+ \else
+ \ifcase\paramno
+ % 0
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \or % 1
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \noexpand\braceorline
+ \expandafter\noexpand\csname\the\macname xxx\endcsname}%
+ \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \else % many
+ \expandafter\xdef\csname\the\macname\endcsname{%
+ \bgroup\noexpand\macroargctxt
+ \expandafter\noexpand\csname\the\macname xx\endcsname}%
+ \expandafter\xdef\csname\the\macname xx\endcsname##1{%
+ \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
+ \expandafter\expandafter
+ \expandafter\xdef
+ \expandafter\expandafter
+ \csname\the\macname xxx\endcsname
+ \paramlist{%
+ \egroup
+ \noexpand\norecurse{\the\macname}%
+ \noexpand\scanmacro{\temp}\egroup}%
+ \fi
+ \fi}
+
+\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
+
+% \braceorline decides whether the next nonwhitespace character is a
+% {. If so it reads up to the closing }, if not, it reads the whole
+% line. Whatever was read is then fed to the next control sequence
+% as an argument (by \parsebrace or \parsearg)
+\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
+\def\braceorlinexxx{%
+ \ifx\nchar\bgroup\else
+ \expandafter\parsearg
+ \fi \macnamexxx}
+
+
+% @alias.
+% We need some trickery to remove the optional spaces around the equal
+% sign. Just make them active and then expand them all to nothing.
+\def\alias{\parseargusing\obeyspaces\aliasxxx}
+\def\aliasxxx #1{\aliasyyy#1\relax}
+\def\aliasyyy #1=#2\relax{%
+ {%
+ \expandafter\let\obeyedspace=\empty
+ \addtomacrolist{#1}%
+ \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
+ }%
+ \next
+}
+
+
+\message{cross references,}
+
+\newwrite\auxfile
+\newif\ifhavexrefs % True if xref values are known.
+\newif\ifwarnedxrefs % True if we warned once that they aren't known.
+
+% @inforef is relatively simple.
+\def\inforef #1{\inforefzzz #1,,,,**}
+\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
+ node \samp{\ignorespaces#1{}}}
+
+% @node's only job in TeX is to define \lastnode, which is used in
+% cross-references. The @node line might or might not have commas, and
+% might or might not have spaces before the first comma, like:
+% @node foo , bar , ...
+% We don't want such trailing spaces in the node name.
+%
+\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
+%
+% also remove a trailing comma, in case of something like this:
+% @node Help-Cross, , , Cross-refs
+\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
+\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
+
+\let\nwnode=\node
+\let\lastnode=\empty
+
+% Write a cross-reference definition for the current node. #1 is the
+% type (Ynumbered, Yappendix, Ynothing).
+%
+\def\donoderef#1{%
+ \ifx\lastnode\empty\else
+ \setref{\lastnode}{#1}%
+ \global\let\lastnode=\empty
+ \fi
+}
+
+% @anchor{NAME} -- define xref target at arbitrary point.
+%
+\newcount\savesfregister
+%
+\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
+\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
+\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
+
+% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
+% anchor), which consists of three parts:
+% 1) NAME-title - the current sectioning name taken from \thissection,
+% or the anchor name.
+% 2) NAME-snt - section number and type, passed as the SNT arg, or
+% empty for anchors.
+% 3) NAME-pg - the page number.
+%
+% This is called from \donoderef, \anchor, and \dofloat. In the case of
+% floats, there is an additional part, which is not written here:
+% 4) NAME-lof - the text as it should appear in a @listoffloats.
+%
+\def\setref#1#2{%
+ \pdfmkdest{#1}%
+ \iflinks
+ {%
+ \atdummies % preserve commands, but don't expand them
+ \edef\writexrdef##1##2{%
+ \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
+ ##1}{##2}}% these are parameters of \writexrdef
+ }%
+ \toks0 = \expandafter{\thissection}%
+ \immediate \writexrdef{title}{\the\toks0 }%
+ \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
+ \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during \shipout
+ }%
+ \fi
+}
+
+% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
+% the node name, #2 the name of the Info cross-reference, #3 the printed
+% node name, #4 the name of the Info file, #5 the name of the printed
+% manual. All but the node name can be omitted.
+%
+\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
+\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
+\def\ref#1{\xrefX[#1,,,,,,,]}
+\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
+ \unsepspaces
+ \def\printedmanual{\ignorespaces #5}%
+ \def\printedrefname{\ignorespaces #3}%
+ \setbox1=\hbox{\printedmanual\unskip}%
+ \setbox0=\hbox{\printedrefname\unskip}%
+ \ifdim \wd0 = 0pt
+ % No printed node name was explicitly given.
+ \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
+ % Use the node name inside the square brackets.
+ \def\printedrefname{\ignorespaces #1}%
+ \else
+ % Use the actual chapter/section title appear inside
+ % the square brackets. Use the real section title if we have it.
+ \ifdim \wd1 > 0pt
+ % It is in another manual, so we don't have it.
+ \def\printedrefname{\ignorespaces #1}%
+ \else
+ \ifhavexrefs
+ % We know the real title if we have the xref values.
+ \def\printedrefname{\refx{#1-title}{}}%
+ \else
+ % Otherwise just copy the Info node name.
+ \def\printedrefname{\ignorespaces #1}%
+ \fi%
+ \fi
+ \fi
+ \fi
+ %
+ % Make link in pdf output.
+ \ifpdf
+ \leavevmode
+ \getfilename{#4}%
+ {\indexnofonts
+ \turnoffactive
+ % See comments at \activebackslashdouble.
+ {\activebackslashdouble \xdef\pdfxrefdest{#1}%
+ \backslashparens\pdfxrefdest}%
+ %
+ \ifnum\filenamelength>0
+ \startlink attr{/Border [0 0 0]}%
+ goto file{\the\filename.pdf} name{\pdfxrefdest}%
+ \else
+ \startlink attr{/Border [0 0 0]}%
+ goto name{\pdfmkpgn{\pdfxrefdest}}%
+ \fi
+ }%
+ \linkcolor
+ \fi
+ %
+ % Float references are printed completely differently: "Figure 1.2"
+ % instead of "[somenode], p.3". We distinguish them by the
+ % LABEL-title being set to a magic string.
+ {%
+ % Have to otherify everything special to allow the \csname to
+ % include an _ in the xref name, etc.
+ \indexnofonts
+ \turnoffactive
+ \expandafter\global\expandafter\let\expandafter\Xthisreftitle
+ \csname XR#1-title\endcsname
+ }%
+ \iffloat\Xthisreftitle
+ % If the user specified the print name (third arg) to the ref,
+ % print it instead of our usual "Figure 1.2".
+ \ifdim\wd0 = 0pt
+ \refx{#1-snt}{}%
+ \else
+ \printedrefname
+ \fi
+ %
+ % if the user also gave the printed manual name (fifth arg), append
+ % "in MANUALNAME".
+ \ifdim \wd1 > 0pt
+ \space \putwordin{} \cite{\printedmanual}%
+ \fi
+ \else
+ % node/anchor (non-float) references.
+ %
+ % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
+ % insert empty discretionaries after hyphens, which means that it will
+ % not find a line break at a hyphen in a node names. Since some manuals
+ % are best written with fairly long node names, containing hyphens, this
+ % is a loss. Therefore, we give the text of the node name again, so it
+ % is as if TeX is seeing it for the first time.
+ \ifdim \wd1 > 0pt
+ \putwordsection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}%
+ \else
+ % _ (for example) has to be the character _ for the purposes of the
+ % control sequence corresponding to the node, but it has to expand
+ % into the usual \leavevmode...\vrule stuff for purposes of
+ % printing. So we \turnoffactive for the \refx-snt, back on for the
+ % printing, back off for the \refx-pg.
+ {\turnoffactive
+ % Only output a following space if the -snt ref is nonempty; for
+ % @unnumbered and @anchor, it won't be.
+ \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
+ \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+ }%
+ % output the `[mynode]' via a macro so it can be overridden.
+ \xrefprintnodename\printedrefname
+ %
+ % But we always want a comma and a space:
+ ,\space
+ %
+ % output the `page 3'.
+ \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
+ \fi
+ \fi
+ \endlink
+\endgroup}
+
+% This macro is called from \xrefX for the `[nodename]' part of xref
+% output. It's a separate macro only so it can be changed more easily,
+% since square brackets don't work well in some documents. Particularly
+% one that Bob is working on :).
+%
+\def\xrefprintnodename#1{[#1]}
+
+% Things referred to by \setref.
+%
+\def\Ynothing{}
+\def\Yomitfromtoc{}
+\def\Ynumbered{%
+ \ifnum\secno=0
+ \putwordChapter@tie \the\chapno
+ \else \ifnum\subsecno=0
+ \putwordSection@tie \the\chapno.\the\secno
+ \else \ifnum\subsubsecno=0
+ \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
+ \else
+ \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
+ \fi\fi\fi
+}
+\def\Yappendix{%
+ \ifnum\secno=0
+ \putwordAppendix@tie @char\the\appendixno{}%
+ \else \ifnum\subsecno=0
+ \putwordSection@tie @char\the\appendixno.\the\secno
+ \else \ifnum\subsubsecno=0
+ \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
+ \else
+ \putwordSection@tie
+ @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
+ \fi\fi\fi
+}
+
+% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
+% If its value is nonempty, SUFFIX is output afterward.
+%
+\def\refx#1#2{%
+ {%
+ \indexnofonts
+ \otherbackslash
+ \expandafter\global\expandafter\let\expandafter\thisrefX
+ \csname XR#1\endcsname
+ }%
+ \ifx\thisrefX\relax
+ % If not defined, say something at least.
+ \angleleft un\-de\-fined\angleright
+ \iflinks
+ \ifhavexrefs
+ \message{\linenumber Undefined cross reference `#1'.}%
+ \else
+ \ifwarnedxrefs\else
+ \global\warnedxrefstrue
+ \message{Cross reference values unknown; you must run TeX again.}%
+ \fi
+ \fi
+ \fi
+ \else
+ % It's defined, so just use it.
+ \thisrefX
+ \fi
+ #2% Output the suffix in any case.
+}
+
+% This is the macro invoked by entries in the aux file. Usually it's
+% just a \def (we prepend XR to the control sequence name to avoid
+% collisions). But if this is a float type, we have more work to do.
+%
+\def\xrdef#1#2{%
+ {% The node name might contain 8-bit characters, which in our current
+ % implementation are changed to commands like @'e. Don't let these
+ % mess up the control sequence name.
+ \indexnofonts
+ \turnoffactive
+ \xdef\safexrefname{#1}%
+ }%
+ %
+ \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
+ %
+ % Was that xref control sequence that we just defined for a float?
+ \expandafter\iffloat\csname XR\safexrefname\endcsname
+ % it was a float, and we have the (safe) float type in \iffloattype.
+ \expandafter\let\expandafter\floatlist
+ \csname floatlist\iffloattype\endcsname
+ %
+ % Is this the first time we've seen this float type?
+ \expandafter\ifx\floatlist\relax
+ \toks0 = {\do}% yes, so just \do
+ \else
+ % had it before, so preserve previous elements in list.
+ \toks0 = \expandafter{\floatlist\do}%
+ \fi
+ %
+ % Remember this xref in the control sequence \floatlistFLOATTYPE,
+ % for later use in \listoffloats.
+ \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
+ {\safexrefname}}%
+ \fi
+}
+
+% Read the last existing aux file, if any. No error if none exists.
+%
+\def\tryauxfile{%
+ \openin 1 \jobname.aux
+ \ifeof 1 \else
+ \readdatafile{aux}%
+ \global\havexrefstrue
+ \fi
+ \closein 1
+}
+
+\def\setupdatafile{%
+ \catcode`\^^@=\other
+ \catcode`\^^A=\other
+ \catcode`\^^B=\other
+ \catcode`\^^C=\other
+ \catcode`\^^D=\other
+ \catcode`\^^E=\other
+ \catcode`\^^F=\other
+ \catcode`\^^G=\other
+ \catcode`\^^H=\other
+ \catcode`\^^K=\other
+ \catcode`\^^L=\other
+ \catcode`\^^N=\other
+ \catcode`\^^P=\other
+ \catcode`\^^Q=\other
+ \catcode`\^^R=\other
+ \catcode`\^^S=\other
+ \catcode`\^^T=\other
+ \catcode`\^^U=\other
+ \catcode`\^^V=\other
+ \catcode`\^^W=\other
+ \catcode`\^^X=\other
+ \catcode`\^^Z=\other
+ \catcode`\^^[=\other
+ \catcode`\^^\=\other
+ \catcode`\^^]=\other
+ \catcode`\^^^=\other
+ \catcode`\^^_=\other
+ % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
+ % in xref tags, i.e., node names. But since ^^e4 notation isn't
+ % supported in the main text, it doesn't seem desirable. Furthermore,
+ % that is not enough: for node names that actually contain a ^
+ % character, we would end up writing a line like this: 'xrdef {'hat
+ % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
+ % argument, and \hat is not an expandable control sequence. It could
+ % all be worked out, but why? Either we support ^^ or we don't.
+ %
+ % The other change necessary for this was to define \auxhat:
+ % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
+ % and then to call \auxhat in \setq.
+ %
+ \catcode`\^=\other
+ %
+ % Special characters. Should be turned off anyway, but...
+ \catcode`\~=\other
+ \catcode`\[=\other
+ \catcode`\]=\other
+ \catcode`\"=\other
+ \catcode`\_=\other
+ \catcode`\|=\other
+ \catcode`\<=\other
+ \catcode`\>=\other
+ \catcode`\$=\other
+ \catcode`\#=\other
+ \catcode`\&=\other
+ \catcode`\%=\other
+ \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
+ %
+ % This is to support \ in node names and titles, since the \
+ % characters end up in a \csname. It's easier than
+ % leaving it active and making its active definition an actual \
+ % character. What I don't understand is why it works in the *value*
+ % of the xrdef. Seems like it should be a catcode12 \, and that
+ % should not typeset properly. But it works, so I'm moving on for
+ % now. --karl, 15jan04.
+ \catcode`\\=\other
+ %
+ % Make the characters 128-255 be printing characters.
+ {%
+ \count1=128
+ \def\loop{%
+ \catcode\count1=\other
+ \advance\count1 by 1
+ \ifnum \count1<256 \loop \fi
+ }%
+ }%
+ %
+ % @ is our escape character in .aux files, and we need braces.
+ \catcode`\{=1
+ \catcode`\}=2
+ \catcode`\@=0
+}
+
+\def\readdatafile#1{%
+\begingroup
+ \setupdatafile
+ \input\jobname.#1
+\endgroup}
+
+
+\message{insertions,}
+% including footnotes.
+
+\newcount \footnoteno
+
+% The trailing space in the following definition for supereject is
+% vital for proper filling; pages come out unaligned when you do a
+% pagealignmacro call if that space before the closing brace is
+% removed. (Generally, numeric constants should always be followed by a
+% space to prevent strange expansion errors.)
+\def\supereject{\par\penalty -20000\footnoteno =0 }
+
+% @footnotestyle is meaningful for info output only.
+\let\footnotestyle=\comment
+
+{\catcode `\@=11
+%
+% Auto-number footnotes. Otherwise like plain.
+\gdef\footnote{%
+ \let\indent=\ptexindent
+ \let\noindent=\ptexnoindent
+ \global\advance\footnoteno by \@ne
+ \edef\thisfootno{$^{\the\footnoteno}$}%
+ %
+ % In case the footnote comes at the end of a sentence, preserve the
+ % extra spacing after we do the footnote number.
+ \let\@sf\empty
+ \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
+ %
+ % Remove inadvertent blank space before typesetting the footnote number.
+ \unskip
+ \thisfootno\@sf
+ \dofootnote
+}%
+
+% Don't bother with the trickery in plain.tex to not require the
+% footnote text as a parameter. Our footnotes don't need to be so general.
+%
+% Oh yes, they do; otherwise, @ifset (and anything else that uses
+% \parseargline) fails inside footnotes because the tokens are fixed when
+% the footnote is read. --karl, 16nov96.
+%
+\gdef\dofootnote{%
+ \insert\footins\bgroup
+ % We want to typeset this text as a normal paragraph, even if the
+ % footnote reference occurs in (for example) a display environment.
+ % So reset some parameters.
+ \hsize=\pagewidth
+ \interlinepenalty\interfootnotelinepenalty
+ \splittopskip\ht\strutbox % top baseline for broken footnotes
+ \splitmaxdepth\dp\strutbox
+ \floatingpenalty\@MM
+ \leftskip\z@skip
+ \rightskip\z@skip
+ \spaceskip\z@skip
+ \xspaceskip\z@skip
+ \parindent\defaultparindent
+ %
+ \smallfonts \rm
+ %
+ % Because we use hanging indentation in footnotes, a @noindent appears
+ % to exdent this text, so make it be a no-op. makeinfo does not use
+ % hanging indentation so @noindent can still be needed within footnote
+ % text after an @example or the like (not that this is good style).
+ \let\noindent = \relax
+ %
+ % Hang the footnote text off the number. Use \everypar in case the
+ % footnote extends for more than one paragraph.
+ \everypar = {\hang}%
+ \textindent{\thisfootno}%
+ %
+ % Don't crash into the line above the footnote text. Since this
+ % expands into a box, it must come within the paragraph, lest it
+ % provide a place where TeX can split the footnote.
+ \footstrut
+ \futurelet\next\fo@t
+}
+}%end \catcode `\@=11
+
+% In case a @footnote appears in a vbox, save the footnote text and create
+% the real \insert just after the vbox finished. Otherwise, the insertion
+% would be lost.
+% Similarily, if a @footnote appears inside an alignment, save the footnote
+% text to a box and make the \insert when a row of the table is finished.
+% And the same can be done for other insert classes. --kasal, 16nov03.
+
+% Replace the \insert primitive by a cheating macro.
+% Deeper inside, just make sure that the saved insertions are not spilled
+% out prematurely.
+%
+\def\startsavinginserts{%
+ \ifx \insert\ptexinsert
+ \let\insert\saveinsert
+ \else
+ \let\checkinserts\relax
+ \fi
+}
+
+% This \insert replacement works for both \insert\footins{foo} and
+% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
+%
+\def\saveinsert#1{%
+ \edef\next{\noexpand\savetobox \makeSAVEname#1}%
+ \afterassignment\next
+ % swallow the left brace
+ \let\temp =
+}
+\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
+\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
+
+\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
+
+\def\placesaveins#1{%
+ \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
+ {\box#1}%
+}
+
+% eat @SAVE -- beware, all of them have catcode \other:
+{
+ \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
+ \gdef\gobblesave @SAVE{}
+}
+
+% initialization:
+\def\newsaveins #1{%
+ \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
+ \next
+}
+\def\newsaveinsX #1{%
+ \csname newbox\endcsname #1%
+ \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
+ \checksaveins #1}%
+}
+
+% initialize:
+\let\checkinserts\empty
+\newsaveins\footins
+\newsaveins\margin
+
+
+% @image. We use the macros from epsf.tex to support this.
+% If epsf.tex is not installed and @image is used, we complain.
+%
+% Check for and read epsf.tex up front. If we read it only at @image
+% time, we might be inside a group, and then its definitions would get
+% undone and the next image would fail.
+\openin 1 = epsf.tex
+\ifeof 1 \else
+ % Do not bother showing banner with epsf.tex v2.7k (available in
+ % doc/epsf.tex and on ctan).
+ \def\epsfannounce{\toks0 = }%
+ \input epsf.tex
+\fi
+\closein 1
+%
+% We will only complain once about lack of epsf.tex.
+\newif\ifwarnednoepsf
+\newhelp\noepsfhelp{epsf.tex must be installed for images to
+ work. It is also included in the Texinfo distribution, or you can get
+ it from ftp://tug.org/tex/epsf.tex.}
+%
+\def\image#1{%
+ \ifx\epsfbox\undefined
+ \ifwarnednoepsf \else
+ \errhelp = \noepsfhelp
+ \errmessage{epsf.tex not found, images will be ignored}%
+ \global\warnednoepsftrue
+ \fi
+ \else
+ \imagexxx #1,,,,,\finish
+ \fi
+}
+%
+% Arguments to @image:
+% #1 is (mandatory) image filename; we tack on .eps extension.
+% #2 is (optional) width, #3 is (optional) height.
+% #4 is (ignored optional) html alt text.
+% #5 is (ignored optional) extension.
+% #6 is just the usual extra ignored arg for parsing this stuff.
+\newif\ifimagevmode
+\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
+ \catcode`\^^M = 5 % in case we're inside an example
+ \normalturnoffactive % allow _ et al. in names
+ % If the image is by itself, center it.
+ \ifvmode
+ \imagevmodetrue
+ \nobreak\bigskip
+ % Usually we'll have text after the image which will insert
+ % \parskip glue, so insert it here too to equalize the space
+ % above and below.
+ \nobreak\vskip\parskip
+ \nobreak
+ \line\bgroup
+ \fi
+ %
+ % Output the image.
+ \ifpdf
+ \dopdfimage{#1}{#2}{#3}%
+ \else
+ % \epsfbox itself resets \epsf?size at each figure.
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
+ \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
+ \epsfbox{#1.eps}%
+ \fi
+ %
+ \ifimagevmode \egroup \bigbreak \fi % space after the image
+\endgroup}
+
+
+% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
+% etc. We don't actually implement floating yet, we always include the
+% float "here". But it seemed the best name for the future.
+%
+\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
+
+% There may be a space before second and/or third parameter; delete it.
+\def\eatcommaspace#1, {#1,}
+
+% #1 is the optional FLOATTYPE, the text label for this float, typically
+% "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
+% this float will not be numbered and cannot be referred to.
+%
+% #2 is the optional xref label. Also must be present for the float to
+% be referable.
+%
+% #3 is the optional positioning argument; for now, it is ignored. It
+% will somehow specify the positions allowed to float to (here, top, bottom).
+%
+% We keep a separate counter for each FLOATTYPE, which we reset at each
+% chapter-level command.
+\let\resetallfloatnos=\empty
+%
+\def\dofloat#1,#2,#3,#4\finish{%
+ \let\thiscaption=\empty
+ \let\thisshortcaption=\empty
+ %
+ % don't lose footnotes inside @float.
+ %
+ % BEWARE: when the floats start float, we have to issue warning whenever an
+ % insert appears inside a float which could possibly float. --kasal, 26may04
+ %
+ \startsavinginserts
+ %
+ % We can't be used inside a paragraph.
+ \par
+ %
+ \vtop\bgroup
+ \def\floattype{#1}%
+ \def\floatlabel{#2}%
+ \def\floatloc{#3}% we do nothing with this yet.
+ %
+ \ifx\floattype\empty
+ \let\safefloattype=\empty
+ \else
+ {%
+ % the floattype might have accents or other special characters,
+ % but we need to use it in a control sequence name.
+ \indexnofonts
+ \turnoffactive
+ \xdef\safefloattype{\floattype}%
+ }%
+ \fi
+ %
+ % If label is given but no type, we handle that as the empty type.
+ \ifx\floatlabel\empty \else
+ % We want each FLOATTYPE to be numbered separately (Figure 1,
+ % Table 1, Figure 2, ...). (And if no label, no number.)
+ %
+ \expandafter\getfloatno\csname\safefloattype floatno\endcsname
+ \global\advance\floatno by 1
+ %
+ {%
+ % This magic value for \thissection is output by \setref as the
+ % XREFLABEL-title value. \xrefX uses it to distinguish float
+ % labels (which have a completely different output format) from
+ % node and anchor labels. And \xrdef uses it to construct the
+ % lists of floats.
+ %
+ \edef\thissection{\floatmagic=\safefloattype}%
+ \setref{\floatlabel}{Yfloat}%
+ }%
+ \fi
+ %
+ % start with \parskip glue, I guess.
+ \vskip\parskip
+ %
+ % Don't suppress indentation if a float happens to start a section.
+ \restorefirstparagraphindent
+}
+
+% we have these possibilities:
+% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
+% @float Foo,lbl & no caption: Foo 1.1
+% @float Foo & @caption{Cap}: Foo: Cap
+% @float Foo & no caption: Foo
+% @float ,lbl & Caption{Cap}: 1.1: Cap
+% @float ,lbl & no caption: 1.1
+% @float & @caption{Cap}: Cap
+% @float & no caption:
+%
+\def\Efloat{%
+ \let\floatident = \empty
+ %
+ % In all cases, if we have a float type, it comes first.
+ \ifx\floattype\empty \else \def\floatident{\floattype}\fi
+ %
+ % If we have an xref label, the number comes next.
+ \ifx\floatlabel\empty \else
+ \ifx\floattype\empty \else % if also had float type, need tie first.
+ \appendtomacro\floatident{\tie}%
+ \fi
+ % the number.
+ \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
+ \fi
+ %
+ % Start the printed caption with what we've constructed in
+ % \floatident, but keep it separate; we need \floatident again.
+ \let\captionline = \floatident
+ %
+ \ifx\thiscaption\empty \else
+ \ifx\floatident\empty \else
+ \appendtomacro\captionline{: }% had ident, so need a colon between
+ \fi
+ %
+ % caption text.
+ \appendtomacro\captionline{\scanexp\thiscaption}%
+ \fi
+ %
+ % If we have anything to print, print it, with space before.
+ % Eventually this needs to become an \insert.
+ \ifx\captionline\empty \else
+ \vskip.5\parskip
+ \captionline
+ %
+ % Space below caption.
+ \vskip\parskip
+ \fi
+ %
+ % If have an xref label, write the list of floats info. Do this
+ % after the caption, to avoid chance of it being a breakpoint.
+ \ifx\floatlabel\empty \else
+ % Write the text that goes in the lof to the aux file as
+ % \floatlabel-lof. Besides \floatident, we include the short
+ % caption if specified, else the full caption if specified, else nothing.
+ {%
+ \atdummies
+ %
+ % since we read the caption text in the macro world, where ^^M
+ % is turned into a normal character, we have to scan it back, so
+ % we don't write the literal three characters "^^M" into the aux file.
+ \scanexp{%
+ \xdef\noexpand\gtemp{%
+ \ifx\thisshortcaption\empty
+ \thiscaption
+ \else
+ \thisshortcaption
+ \fi
+ }%
+ }%
+ \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
+ \ifx\gtemp\empty \else : \gtemp \fi}}%
+ }%
+ \fi
+ \egroup % end of \vtop
+ %
+ % place the captured inserts
+ %
+ % BEWARE: when the floats start floating, we have to issue warning
+ % whenever an insert appears inside a float which could possibly
+ % float. --kasal, 26may04
+ %
+ \checkinserts
+}
+
+% Append the tokens #2 to the definition of macro #1, not expanding either.
+%
+\def\appendtomacro#1#2{%
+ \expandafter\def\expandafter#1\expandafter{#1#2}%
+}
+
+% @caption, @shortcaption
+%
+\def\caption{\docaption\thiscaption}
+\def\shortcaption{\docaption\thisshortcaption}
+\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
+\def\defcaption#1#2{\egroup \def#1{#2}}
+
+% The parameter is the control sequence identifying the counter we are
+% going to use. Create it if it doesn't exist and assign it to \floatno.
+\def\getfloatno#1{%
+ \ifx#1\relax
+ % Haven't seen this figure type before.
+ \csname newcount\endcsname #1%
+ %
+ % Remember to reset this floatno at the next chap.
+ \expandafter\gdef\expandafter\resetallfloatnos
+ \expandafter{\resetallfloatnos #1=0 }%
+ \fi
+ \let\floatno#1%
+}
+
+% \setref calls this to get the XREFLABEL-snt value. We want an @xref
+% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
+% first read the @float command.
+%
+\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
+
+% Magic string used for the XREFLABEL-title value, so \xrefX can
+% distinguish floats from other xref types.
+\def\floatmagic{!!float!!}
+
+% #1 is the control sequence we are passed; we expand into a conditional
+% which is true if #1 represents a float ref. That is, the magic
+% \thissection value which we \setref above.
+%
+\def\iffloat#1{\expandafter\doiffloat#1==\finish}
+%
+% #1 is (maybe) the \floatmagic string. If so, #2 will be the
+% (safe) float type for this float. We set \iffloattype to #2.
+%
+\def\doiffloat#1=#2=#3\finish{%
+ \def\temp{#1}%
+ \def\iffloattype{#2}%
+ \ifx\temp\floatmagic
+}
+
+% @listoffloats FLOATTYPE - print a list of floats like a table of contents.
+%
+\parseargdef\listoffloats{%
+ \def\floattype{#1}% floattype
+ {%
+ % the floattype might have accents or other special characters,
+ % but we need to use it in a control sequence name.
+ \indexnofonts
+ \turnoffactive
+ \xdef\safefloattype{\floattype}%
+ }%
+ %
+ % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
+ \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
+ \ifhavexrefs
+ % if the user said @listoffloats foo but never @float foo.
+ \message{\linenumber No `\safefloattype' floats to list.}%
+ \fi
+ \else
+ \begingroup
+ \leftskip=\tocindent % indent these entries like a toc
+ \let\do=\listoffloatsdo
+ \csname floatlist\safefloattype\endcsname
+ \endgroup
+ \fi
+}
+
+% This is called on each entry in a list of floats. We're passed the
+% xref label, in the form LABEL-title, which is how we save it in the
+% aux file. We strip off the -title and look up \XRLABEL-lof, which
+% has the text we're supposed to typeset here.
+%
+% Figures without xref labels will not be included in the list (since
+% they won't appear in the aux file).
+%
+\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
+\def\listoffloatsdoentry#1-title\finish{{%
+ % Can't fully expand XR#1-lof because it can contain anything. Just
+ % pass the control sequence. On the other hand, XR#1-pg is just the
+ % page number, and we want to fully expand that so we can get a link
+ % in pdf output.
+ \toksA = \expandafter{\csname XR#1-lof\endcsname}%
+ %
+ % use the same \entry macro we use to generate the TOC and index.
+ \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
+ \writeentry
+}}
+
+
+\message{localization,}
+
+% @documentlanguage is usually given very early, just after
+% @setfilename. If done too late, it may not override everything
+% properly. Single argument is the language abbreviation.
+% It would be nice if we could set up a hyphenation file here.
+%
+\parseargdef\documentlanguage{%
+ \tex % read txi-??.tex file in plain TeX.
+ % Read the file if it exists.
+ \openin 1 txi-#1.tex
+ \ifeof 1
+ \errhelp = \nolanghelp
+ \errmessage{Cannot read language file txi-#1.tex}%
+ \else
+ \input txi-#1.tex
+ \fi
+ \closein 1
+ \endgroup
+}
+\newhelp\nolanghelp{The given language definition file cannot be found or
+is empty. Maybe you need to install it? In the current directory
+should work if nowhere else does.}
+
+% Set the catcode of characters 128 through 255 to the specified number.
+%
+\def\setnonasciicharscatcode#1{%
+ \count255=128
+ \loop\ifnum\count255<256
+ \global\catcode\count255=#1
+ \advance\count255 by 1
+ \repeat
+}
+
+% @documentencoding sets the definition of non-ASCII characters
+% according to the specified encoding.
+%
+\parseargdef\documentencoding{%
+ % Encoding being declared for the document.
+ \def\declaredencoding{\csname #1.enc\endcsname}%
+ %
+ % Supported encodings: names converted to tokens in order to be able
+ % to compare them with \ifx.
+ \def\ascii{\csname US-ASCII.enc\endcsname}%
+ \def\latnine{\csname ISO-8859-15.enc\endcsname}%
+ \def\latone{\csname ISO-8859-1.enc\endcsname}%
+ \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
+ \def\utfeight{\csname UTF-8.enc\endcsname}%
+ %
+ \ifx \declaredencoding \ascii
+ \asciichardefs
+ %
+ \else \ifx \declaredencoding \lattwo
+ \setnonasciicharscatcode\active
+ \lattwochardefs
+ %
+ \else \ifx \declaredencoding \latone
+ \setnonasciicharscatcode\active
+ \latonechardefs
+ %
+ \else \ifx \declaredencoding \latnine
+ \setnonasciicharscatcode\active
+ \latninechardefs
+ %
+ \else \ifx \declaredencoding \utfeight
+ \setnonasciicharscatcode\active
+ \utfeightchardefs
+ %
+ \else
+ \message{Unknown document encoding #1, ignoring.}%
+ %
+ \fi % utfeight
+ \fi % latnine
+ \fi % latone
+ \fi % lattwo
+ \fi % ascii
+}
+
+% A message to be logged when using a character that isn't available
+% the default font encoding (OT1).
+%
+\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
+
+% Take account of \c (plain) vs. \, (Texinfo) difference.
+\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
+
+% First, make active non-ASCII characters in order for them to be
+% correctly categorized when TeX reads the replacement text of
+% macros containing the character definitions.
+\setnonasciicharscatcode\active
+%
+% Latin1 (ISO-8859-1) character definitions.
+\def\latonechardefs{%
+ \gdef^^a0{~}
+ \gdef^^a1{\exclamdown}
+ \gdef^^a2{\missingcharmsg{CENT SIGN}}
+ \gdef^^a3{{\pounds}}
+ \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
+ \gdef^^a5{\missingcharmsg{YEN SIGN}}
+ \gdef^^a6{\missingcharmsg{BROKEN BAR}}
+ \gdef^^a7{\S}
+ \gdef^^a8{\"{}}
+ \gdef^^a9{\copyright}
+ \gdef^^aa{\ordf}
+ \gdef^^ab{\missingcharmsg{LEFT-POINTING DOUBLE ANGLE QUOTATION MARK}}
+ \gdef^^ac{$\lnot$}
+ \gdef^^ad{\-}
+ \gdef^^ae{\registeredsymbol}
+ \gdef^^af{\={}}
+ %
+ \gdef^^b0{\textdegree}
+ \gdef^^b1{$\pm$}
+ \gdef^^b2{$^2$}
+ \gdef^^b3{$^3$}
+ \gdef^^b4{\'{}}
+ \gdef^^b5{$\mu$}
+ \gdef^^b6{\P}
+ %
+ \gdef^^b7{$^.$}
+ \gdef^^b8{\cedilla\ }
+ \gdef^^b9{$^1$}
+ \gdef^^ba{\ordm}
+ %
+ \gdef^^bb{\missingcharmsg{RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK}}
+ \gdef^^bc{$1\over4$}
+ \gdef^^bd{$1\over2$}
+ \gdef^^be{$3\over4$}
+ \gdef^^bf{\questiondown}
+ %
+ \gdef^^c0{\`A}
+ \gdef^^c1{\'A}
+ \gdef^^c2{\^A}
+ \gdef^^c3{\~A}
+ \gdef^^c4{\"A}
+ \gdef^^c5{\ringaccent A}
+ \gdef^^c6{\AE}
+ \gdef^^c7{\cedilla C}
+ \gdef^^c8{\`E}
+ \gdef^^c9{\'E}
+ \gdef^^ca{\^E}
+ \gdef^^cb{\"E}
+ \gdef^^cc{\`I}
+ \gdef^^cd{\'I}
+ \gdef^^ce{\^I}
+ \gdef^^cf{\"I}
+ %
+ \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER ETH}}
+ \gdef^^d1{\~N}
+ \gdef^^d2{\`O}
+ \gdef^^d3{\'O}
+ \gdef^^d4{\^O}
+ \gdef^^d5{\~O}
+ \gdef^^d6{\"O}
+ \gdef^^d7{$\times$}
+ \gdef^^d8{\O}
+ \gdef^^d9{\`U}
+ \gdef^^da{\'U}
+ \gdef^^db{\^U}
+ \gdef^^dc{\"U}
+ \gdef^^dd{\'Y}
+ \gdef^^de{\missingcharmsg{LATIN CAPITAL LETTER THORN}}
+ \gdef^^df{\ss}
+ %
+ \gdef^^e0{\`a}
+ \gdef^^e1{\'a}
+ \gdef^^e2{\^a}
+ \gdef^^e3{\~a}
+ \gdef^^e4{\"a}
+ \gdef^^e5{\ringaccent a}
+ \gdef^^e6{\ae}
+ \gdef^^e7{\cedilla c}
+ \gdef^^e8{\`e}
+ \gdef^^e9{\'e}
+ \gdef^^ea{\^e}
+ \gdef^^eb{\"e}
+ \gdef^^ec{\`{\dotless i}}
+ \gdef^^ed{\'{\dotless i}}
+ \gdef^^ee{\^{\dotless i}}
+ \gdef^^ef{\"{\dotless i}}
+ %
+ \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER ETH}}
+ \gdef^^f1{\~n}
+ \gdef^^f2{\`o}
+ \gdef^^f3{\'o}
+ \gdef^^f4{\^o}
+ \gdef^^f5{\~o}
+ \gdef^^f6{\"o}
+ \gdef^^f7{$\div$}
+ \gdef^^f8{\o}
+ \gdef^^f9{\`u}
+ \gdef^^fa{\'u}
+ \gdef^^fb{\^u}
+ \gdef^^fc{\"u}
+ \gdef^^fd{\'y}
+ \gdef^^fe{\missingcharmsg{LATIN SMALL LETTER THORN}}
+ \gdef^^ff{\"y}
+}
+
+% Latin9 (ISO-8859-15) encoding character definitions.
+\def\latninechardefs{%
+ % Encoding is almost identical to Latin1.
+ \latonechardefs
+ %
+ \gdef^^a4{\euro}
+ \gdef^^a6{\v S}
+ \gdef^^a8{\v s}
+ \gdef^^b4{\v Z}
+ \gdef^^b8{\v z}
+ \gdef^^bc{\OE}
+ \gdef^^bd{\oe}
+ \gdef^^be{\"Y}
+}
+
+% Latin2 (ISO-8859-2) character definitions.
+\def\lattwochardefs{%
+ \gdef^^a0{~}
+ \gdef^^a1{\missingcharmsg{LATIN CAPITAL LETTER A WITH OGONEK}}
+ \gdef^^a2{\u{}}
+ \gdef^^a3{\L}
+ \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
+ \gdef^^a5{\v L}
+ \gdef^^a6{\'S}
+ \gdef^^a7{\S}
+ \gdef^^a8{\"{}}
+ \gdef^^a9{\v S}
+ \gdef^^aa{\cedilla S}
+ \gdef^^ab{\v T}
+ \gdef^^ac{\'Z}
+ \gdef^^ad{\-}
+ \gdef^^ae{\v Z}
+ \gdef^^af{\dotaccent Z}
+ %
+ \gdef^^b0{\textdegree}
+ \gdef^^b1{\missingcharmsg{LATIN SMALL LETTER A WITH OGONEK}}
+ \gdef^^b2{\missingcharmsg{OGONEK}}
+ \gdef^^b3{\l}
+ \gdef^^b4{\'{}}
+ \gdef^^b5{\v l}
+ \gdef^^b6{\'s}
+ \gdef^^b7{\v{}}
+ \gdef^^b8{\cedilla\ }
+ \gdef^^b9{\v s}
+ \gdef^^ba{\cedilla s}
+ \gdef^^bb{\v t}
+ \gdef^^bc{\'z}
+ \gdef^^bd{\H{}}
+ \gdef^^be{\v z}
+ \gdef^^bf{\dotaccent z}
+ %
+ \gdef^^c0{\'R}
+ \gdef^^c1{\'A}
+ \gdef^^c2{\^A}
+ \gdef^^c3{\u A}
+ \gdef^^c4{\"A}
+ \gdef^^c5{\'L}
+ \gdef^^c6{\'C}
+ \gdef^^c7{\cedilla C}
+ \gdef^^c8{\v C}
+ \gdef^^c9{\'E}
+ \gdef^^ca{\missingcharmsg{LATIN CAPITAL LETTER E WITH OGONEK}}
+ \gdef^^cb{\"E}
+ \gdef^^cc{\v E}
+ \gdef^^cd{\'I}
+ \gdef^^ce{\^I}
+ \gdef^^cf{\v D}
+ %
+ \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER D WITH STROKE}}
+ \gdef^^d1{\'N}
+ \gdef^^d2{\v N}
+ \gdef^^d3{\'O}
+ \gdef^^d4{\^O}
+ \gdef^^d5{\H O}
+ \gdef^^d6{\"O}
+ \gdef^^d7{$\times$}
+ \gdef^^d8{\v R}
+ \gdef^^d9{\ringaccent U}
+ \gdef^^da{\'U}
+ \gdef^^db{\H U}
+ \gdef^^dc{\"U}
+ \gdef^^dd{\'Y}
+ \gdef^^de{\cedilla T}
+ \gdef^^df{\ss}
+ %
+ \gdef^^e0{\'r}
+ \gdef^^e1{\'a}
+ \gdef^^e2{\^a}
+ \gdef^^e3{\u a}
+ \gdef^^e4{\"a}
+ \gdef^^e5{\'l}
+ \gdef^^e6{\'c}
+ \gdef^^e7{\cedilla c}
+ \gdef^^e8{\v c}
+ \gdef^^e9{\'e}
+ \gdef^^ea{\missingcharmsg{LATIN SMALL LETTER E WITH OGONEK}}
+ \gdef^^eb{\"e}
+ \gdef^^ec{\v e}
+ \gdef^^ed{\'\i}
+ \gdef^^ee{\^\i}
+ \gdef^^ef{\v d}
+ %
+ \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER D WITH STROKE}}
+ \gdef^^f1{\'n}
+ \gdef^^f2{\v n}
+ \gdef^^f3{\'o}
+ \gdef^^f4{\^o}
+ \gdef^^f5{\H o}
+ \gdef^^f6{\"o}
+ \gdef^^f7{$\div$}
+ \gdef^^f8{\v r}
+ \gdef^^f9{\ringaccent u}
+ \gdef^^fa{\'u}
+ \gdef^^fb{\H u}
+ \gdef^^fc{\"u}
+ \gdef^^fd{\'y}
+ \gdef^^fe{\cedilla t}
+ \gdef^^ff{\dotaccent{}}
+}
+
+% UTF-8 character definitions.
+%
+% This code to support UTF-8 is based on LaTeX's utf8.def, with some
+% changes for Texinfo conventions. It is included here under the GPL by
+% permission from Frank Mittelbach and the LaTeX team.
+%
+\newcount\countUTFx
+\newcount\countUTFy
+\newcount\countUTFz
+
+\gdef\UTFviiiTwoOctets#1#2{\expandafter
+ \UTFviiiDefined\csname u8:#1\string #2\endcsname}
+%
+\gdef\UTFviiiThreeOctets#1#2#3{\expandafter
+ \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
+%
+\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
+ \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
+
+\gdef\UTFviiiDefined#1{%
+ \ifx #1\relax
+ \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
+ \else
+ \expandafter #1%
+ \fi
+}
+
+\begingroup
+ \catcode`\~13
+ \catcode`\"12
+
+ \def\UTFviiiLoop{%
+ \global\catcode\countUTFx\active
+ \uccode`\~\countUTFx
+ \uppercase\expandafter{\UTFviiiTmp}%
+ \advance\countUTFx by 1
+ \ifnum\countUTFx < \countUTFy
+ \expandafter\UTFviiiLoop
+ \fi}
+
+ \countUTFx = "C2
+ \countUTFy = "E0
+ \def\UTFviiiTmp{%
+ \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
+ \UTFviiiLoop
+
+ \countUTFx = "E0
+ \countUTFy = "F0
+ \def\UTFviiiTmp{%
+ \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
+ \UTFviiiLoop
+
+ \countUTFx = "F0
+ \countUTFy = "F4
+ \def\UTFviiiTmp{%
+ \xdef~{\noexpand\UTFviiiFourOctets\string~}}
+ \UTFviiiLoop
+\endgroup
+
+\begingroup
+ \catcode`\"=12
+ \catcode`\<=12
+ \catcode`\.=12
+ \catcode`\,=12
+ \catcode`\;=12
+ \catcode`\!=12
+ \catcode`\~=13
+
+ \gdef\DeclareUnicodeCharacter#1#2{%
+ \countUTFz = "#1\relax
+ \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
+ \begingroup
+ \parseXMLCharref
+ \def\UTFviiiTwoOctets##1##2{%
+ \csname u8:##1\string ##2\endcsname}%
+ \def\UTFviiiThreeOctets##1##2##3{%
+ \csname u8:##1\string ##2\string ##3\endcsname}%
+ \def\UTFviiiFourOctets##1##2##3##4{%
+ \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
+ \expandafter\expandafter\expandafter\expandafter
+ \expandafter\expandafter\expandafter
+ \gdef\UTFviiiTmp{#2}%
+ \endgroup}
+
+ \gdef\parseXMLCharref{%
+ \ifnum\countUTFz < "A0\relax
+ \errhelp = \EMsimple
+ \errmessage{Cannot define Unicode char value < 00A0}%
+ \else\ifnum\countUTFz < "800\relax
+ \parseUTFviiiA,%
+ \parseUTFviiiB C\UTFviiiTwoOctets.,%
+ \else\ifnum\countUTFz < "10000\relax
+ \parseUTFviiiA;%
+ \parseUTFviiiA,%
+ \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
+ \else
+ \parseUTFviiiA;%
+ \parseUTFviiiA,%
+ \parseUTFviiiA!%
+ \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
+ \fi\fi\fi
+ }
+
+ \gdef\parseUTFviiiA#1{%
+ \countUTFx = \countUTFz
+ \divide\countUTFz by 64
+ \countUTFy = \countUTFz
+ \multiply\countUTFz by 64
+ \advance\countUTFx by -\countUTFz
+ \advance\countUTFx by 128
+ \uccode `#1\countUTFx
+ \countUTFz = \countUTFy}
+
+ \gdef\parseUTFviiiB#1#2#3#4{%
+ \advance\countUTFz by "#10\relax
+ \uccode `#3\countUTFz
+ \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
+\endgroup
+
+\def\utfeightchardefs{%
+ \DeclareUnicodeCharacter{00A0}{\tie}
+ \DeclareUnicodeCharacter{00A1}{\exclamdown}
+ \DeclareUnicodeCharacter{00A3}{\pounds}
+ \DeclareUnicodeCharacter{00A8}{\"{ }}
+ \DeclareUnicodeCharacter{00A9}{\copyright}
+ \DeclareUnicodeCharacter{00AA}{\ordf}
+ \DeclareUnicodeCharacter{00AD}{\-}
+ \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
+ \DeclareUnicodeCharacter{00AF}{\={ }}
+
+ \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
+ \DeclareUnicodeCharacter{00B4}{\'{ }}
+ \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
+ \DeclareUnicodeCharacter{00BA}{\ordm}
+ \DeclareUnicodeCharacter{00BF}{\questiondown}
+
+ \DeclareUnicodeCharacter{00C0}{\`A}
+ \DeclareUnicodeCharacter{00C1}{\'A}
+ \DeclareUnicodeCharacter{00C2}{\^A}
+ \DeclareUnicodeCharacter{00C3}{\~A}
+ \DeclareUnicodeCharacter{00C4}{\"A}
+ \DeclareUnicodeCharacter{00C5}{\AA}
+ \DeclareUnicodeCharacter{00C6}{\AE}
+ \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
+ \DeclareUnicodeCharacter{00C8}{\`E}
+ \DeclareUnicodeCharacter{00C9}{\'E}
+ \DeclareUnicodeCharacter{00CA}{\^E}
+ \DeclareUnicodeCharacter{00CB}{\"E}
+ \DeclareUnicodeCharacter{00CC}{\`I}
+ \DeclareUnicodeCharacter{00CD}{\'I}
+ \DeclareUnicodeCharacter{00CE}{\^I}
+ \DeclareUnicodeCharacter{00CF}{\"I}
+
+ \DeclareUnicodeCharacter{00D1}{\~N}
+ \DeclareUnicodeCharacter{00D2}{\`O}
+ \DeclareUnicodeCharacter{00D3}{\'O}
+ \DeclareUnicodeCharacter{00D4}{\^O}
+ \DeclareUnicodeCharacter{00D5}{\~O}
+ \DeclareUnicodeCharacter{00D6}{\"O}
+ \DeclareUnicodeCharacter{00D8}{\O}
+ \DeclareUnicodeCharacter{00D9}{\`U}
+ \DeclareUnicodeCharacter{00DA}{\'U}
+ \DeclareUnicodeCharacter{00DB}{\^U}
+ \DeclareUnicodeCharacter{00DC}{\"U}
+ \DeclareUnicodeCharacter{00DD}{\'Y}
+ \DeclareUnicodeCharacter{00DF}{\ss}
+
+ \DeclareUnicodeCharacter{00E0}{\`a}
+ \DeclareUnicodeCharacter{00E1}{\'a}
+ \DeclareUnicodeCharacter{00E2}{\^a}
+ \DeclareUnicodeCharacter{00E3}{\~a}
+ \DeclareUnicodeCharacter{00E4}{\"a}
+ \DeclareUnicodeCharacter{00E5}{\aa}
+ \DeclareUnicodeCharacter{00E6}{\ae}
+ \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
+ \DeclareUnicodeCharacter{00E8}{\`e}
+ \DeclareUnicodeCharacter{00E9}{\'e}
+ \DeclareUnicodeCharacter{00EA}{\^e}
+ \DeclareUnicodeCharacter{00EB}{\"e}
+ \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
+ \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
+ \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
+ \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
+
+ \DeclareUnicodeCharacter{00F1}{\~n}
+ \DeclareUnicodeCharacter{00F2}{\`o}
+ \DeclareUnicodeCharacter{00F3}{\'o}
+ \DeclareUnicodeCharacter{00F4}{\^o}
+ \DeclareUnicodeCharacter{00F5}{\~o}
+ \DeclareUnicodeCharacter{00F6}{\"o}
+ \DeclareUnicodeCharacter{00F8}{\o}
+ \DeclareUnicodeCharacter{00F9}{\`u}
+ \DeclareUnicodeCharacter{00FA}{\'u}
+ \DeclareUnicodeCharacter{00FB}{\^u}
+ \DeclareUnicodeCharacter{00FC}{\"u}
+ \DeclareUnicodeCharacter{00FD}{\'y}
+ \DeclareUnicodeCharacter{00FF}{\"y}
+
+ \DeclareUnicodeCharacter{0100}{\=A}
+ \DeclareUnicodeCharacter{0101}{\=a}
+ \DeclareUnicodeCharacter{0102}{\u{A}}
+ \DeclareUnicodeCharacter{0103}{\u{a}}
+ \DeclareUnicodeCharacter{0106}{\'C}
+ \DeclareUnicodeCharacter{0107}{\'c}
+ \DeclareUnicodeCharacter{0108}{\^C}
+ \DeclareUnicodeCharacter{0109}{\^c}
+ \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
+ \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
+ \DeclareUnicodeCharacter{010C}{\v{C}}
+ \DeclareUnicodeCharacter{010D}{\v{c}}
+ \DeclareUnicodeCharacter{010E}{\v{D}}
+
+ \DeclareUnicodeCharacter{0112}{\=E}
+ \DeclareUnicodeCharacter{0113}{\=e}
+ \DeclareUnicodeCharacter{0114}{\u{E}}
+ \DeclareUnicodeCharacter{0115}{\u{e}}
+ \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
+ \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
+ \DeclareUnicodeCharacter{011A}{\v{E}}
+ \DeclareUnicodeCharacter{011B}{\v{e}}
+ \DeclareUnicodeCharacter{011C}{\^G}
+ \DeclareUnicodeCharacter{011D}{\^g}
+ \DeclareUnicodeCharacter{011E}{\u{G}}
+ \DeclareUnicodeCharacter{011F}{\u{g}}
+
+ \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
+ \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
+ \DeclareUnicodeCharacter{0124}{\^H}
+ \DeclareUnicodeCharacter{0125}{\^h}
+ \DeclareUnicodeCharacter{0128}{\~I}
+ \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
+ \DeclareUnicodeCharacter{012A}{\=I}
+ \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
+ \DeclareUnicodeCharacter{012C}{\u{I}}
+ \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
+
+ \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
+ \DeclareUnicodeCharacter{0131}{\dotless{i}}
+ \DeclareUnicodeCharacter{0132}{IJ}
+ \DeclareUnicodeCharacter{0133}{ij}
+ \DeclareUnicodeCharacter{0134}{\^J}
+ \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
+ \DeclareUnicodeCharacter{0139}{\'L}
+ \DeclareUnicodeCharacter{013A}{\'l}
+
+ \DeclareUnicodeCharacter{0141}{\L}
+ \DeclareUnicodeCharacter{0142}{\l}
+ \DeclareUnicodeCharacter{0143}{\'N}
+ \DeclareUnicodeCharacter{0144}{\'n}
+ \DeclareUnicodeCharacter{0147}{\v{N}}
+ \DeclareUnicodeCharacter{0148}{\v{n}}
+ \DeclareUnicodeCharacter{014C}{\=O}
+ \DeclareUnicodeCharacter{014D}{\=o}
+ \DeclareUnicodeCharacter{014E}{\u{O}}
+ \DeclareUnicodeCharacter{014F}{\u{o}}
+
+ \DeclareUnicodeCharacter{0150}{\H{O}}
+ \DeclareUnicodeCharacter{0151}{\H{o}}
+ \DeclareUnicodeCharacter{0152}{\OE}
+ \DeclareUnicodeCharacter{0153}{\oe}
+ \DeclareUnicodeCharacter{0154}{\'R}
+ \DeclareUnicodeCharacter{0155}{\'r}
+ \DeclareUnicodeCharacter{0158}{\v{R}}
+ \DeclareUnicodeCharacter{0159}{\v{r}}
+ \DeclareUnicodeCharacter{015A}{\'S}
+ \DeclareUnicodeCharacter{015B}{\'s}
+ \DeclareUnicodeCharacter{015C}{\^S}
+ \DeclareUnicodeCharacter{015D}{\^s}
+ \DeclareUnicodeCharacter{015E}{\cedilla{S}}
+ \DeclareUnicodeCharacter{015F}{\cedilla{s}}
+
+ \DeclareUnicodeCharacter{0160}{\v{S}}
+ \DeclareUnicodeCharacter{0161}{\v{s}}
+ \DeclareUnicodeCharacter{0162}{\cedilla{t}}
+ \DeclareUnicodeCharacter{0163}{\cedilla{T}}
+ \DeclareUnicodeCharacter{0164}{\v{T}}
+
+ \DeclareUnicodeCharacter{0168}{\~U}
+ \DeclareUnicodeCharacter{0169}{\~u}
+ \DeclareUnicodeCharacter{016A}{\=U}
+ \DeclareUnicodeCharacter{016B}{\=u}
+ \DeclareUnicodeCharacter{016C}{\u{U}}
+ \DeclareUnicodeCharacter{016D}{\u{u}}
+ \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
+ \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
+
+ \DeclareUnicodeCharacter{0170}{\H{U}}
+ \DeclareUnicodeCharacter{0171}{\H{u}}
+ \DeclareUnicodeCharacter{0174}{\^W}
+ \DeclareUnicodeCharacter{0175}{\^w}
+ \DeclareUnicodeCharacter{0176}{\^Y}
+ \DeclareUnicodeCharacter{0177}{\^y}
+ \DeclareUnicodeCharacter{0178}{\"Y}
+ \DeclareUnicodeCharacter{0179}{\'Z}
+ \DeclareUnicodeCharacter{017A}{\'z}
+ \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
+ \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
+ \DeclareUnicodeCharacter{017D}{\v{Z}}
+ \DeclareUnicodeCharacter{017E}{\v{z}}
+
+ \DeclareUnicodeCharacter{01C4}{D\v{Z}}
+ \DeclareUnicodeCharacter{01C5}{D\v{z}}
+ \DeclareUnicodeCharacter{01C6}{d\v{z}}
+ \DeclareUnicodeCharacter{01C7}{LJ}
+ \DeclareUnicodeCharacter{01C8}{Lj}
+ \DeclareUnicodeCharacter{01C9}{lj}
+ \DeclareUnicodeCharacter{01CA}{NJ}
+ \DeclareUnicodeCharacter{01CB}{Nj}
+ \DeclareUnicodeCharacter{01CC}{nj}
+ \DeclareUnicodeCharacter{01CD}{\v{A}}
+ \DeclareUnicodeCharacter{01CE}{\v{a}}
+ \DeclareUnicodeCharacter{01CF}{\v{I}}
+
+ \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
+ \DeclareUnicodeCharacter{01D1}{\v{O}}
+ \DeclareUnicodeCharacter{01D2}{\v{o}}
+ \DeclareUnicodeCharacter{01D3}{\v{U}}
+ \DeclareUnicodeCharacter{01D4}{\v{u}}
+
+ \DeclareUnicodeCharacter{01E2}{\={\AE}}
+ \DeclareUnicodeCharacter{01E3}{\={\ae}}
+ \DeclareUnicodeCharacter{01E6}{\v{G}}
+ \DeclareUnicodeCharacter{01E7}{\v{g}}
+ \DeclareUnicodeCharacter{01E8}{\v{K}}
+ \DeclareUnicodeCharacter{01E9}{\v{k}}
+
+ \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
+ \DeclareUnicodeCharacter{01F1}{DZ}
+ \DeclareUnicodeCharacter{01F2}{Dz}
+ \DeclareUnicodeCharacter{01F3}{dz}
+ \DeclareUnicodeCharacter{01F4}{\'G}
+ \DeclareUnicodeCharacter{01F5}{\'g}
+ \DeclareUnicodeCharacter{01F8}{\`N}
+ \DeclareUnicodeCharacter{01F9}{\`n}
+ \DeclareUnicodeCharacter{01FC}{\'{\AE}}
+ \DeclareUnicodeCharacter{01FD}{\'{\ae}}
+ \DeclareUnicodeCharacter{01FE}{\'{\O}}
+ \DeclareUnicodeCharacter{01FF}{\'{\o}}
+
+ \DeclareUnicodeCharacter{021E}{\v{H}}
+ \DeclareUnicodeCharacter{021F}{\v{h}}
+
+ \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
+ \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
+ \DeclareUnicodeCharacter{0228}{\cedilla{E}}
+ \DeclareUnicodeCharacter{0229}{\cedilla{e}}
+ \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
+ \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
+
+ \DeclareUnicodeCharacter{0232}{\=Y}
+ \DeclareUnicodeCharacter{0233}{\=y}
+ \DeclareUnicodeCharacter{0237}{\dotless{j}}
+
+ \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
+ \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
+ \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
+ \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
+ \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
+ \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
+ \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
+ \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
+ \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
+ \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
+ \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
+ \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
+
+ \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
+ \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
+
+ \DeclareUnicodeCharacter{1E20}{\=G}
+ \DeclareUnicodeCharacter{1E21}{\=g}
+ \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
+ \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
+ \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
+ \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
+ \DeclareUnicodeCharacter{1E26}{\"H}
+ \DeclareUnicodeCharacter{1E27}{\"h}
+
+ \DeclareUnicodeCharacter{1E30}{\'K}
+ \DeclareUnicodeCharacter{1E31}{\'k}
+ \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
+ \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
+ \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
+ \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
+ \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
+ \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
+ \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
+ \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
+ \DeclareUnicodeCharacter{1E3E}{\'M}
+ \DeclareUnicodeCharacter{1E3F}{\'m}
+
+ \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
+ \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
+ \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
+ \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
+ \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
+ \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
+ \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
+ \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
+ \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
+ \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
+
+ \DeclareUnicodeCharacter{1E54}{\'P}
+ \DeclareUnicodeCharacter{1E55}{\'p}
+ \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
+ \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
+ \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
+ \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
+ \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
+ \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
+ \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
+ \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
+
+ \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
+ \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
+ \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
+ \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
+ \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
+ \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
+ \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
+ \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
+ \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
+ \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
+
+ \DeclareUnicodeCharacter{1E7C}{\~V}
+ \DeclareUnicodeCharacter{1E7D}{\~v}
+ \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
+ \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
+
+ \DeclareUnicodeCharacter{1E80}{\`W}
+ \DeclareUnicodeCharacter{1E81}{\`w}
+ \DeclareUnicodeCharacter{1E82}{\'W}
+ \DeclareUnicodeCharacter{1E83}{\'w}
+ \DeclareUnicodeCharacter{1E84}{\"W}
+ \DeclareUnicodeCharacter{1E85}{\"w}
+ \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
+ \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
+ \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
+ \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
+ \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
+ \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
+ \DeclareUnicodeCharacter{1E8C}{\"X}
+ \DeclareUnicodeCharacter{1E8D}{\"x}
+ \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
+ \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
+
+ \DeclareUnicodeCharacter{1E90}{\^Z}
+ \DeclareUnicodeCharacter{1E91}{\^z}
+ \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
+ \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
+ \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
+ \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
+ \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
+ \DeclareUnicodeCharacter{1E97}{\"t}
+ \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
+ \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
+
+ \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
+ \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
+
+ \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
+ \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
+ \DeclareUnicodeCharacter{1EBC}{\~E}
+ \DeclareUnicodeCharacter{1EBD}{\~e}
+
+ \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
+ \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
+ \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
+ \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
+
+ \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
+ \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
+
+ \DeclareUnicodeCharacter{1EF2}{\`Y}
+ \DeclareUnicodeCharacter{1EF3}{\`y}
+ \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
+
+ \DeclareUnicodeCharacter{1EF8}{\~Y}
+ \DeclareUnicodeCharacter{1EF9}{\~y}
+
+ \DeclareUnicodeCharacter{2013}{--}
+ \DeclareUnicodeCharacter{2014}{---}
+ \DeclareUnicodeCharacter{2022}{\bullet}
+ \DeclareUnicodeCharacter{2026}{\dots}
+ \DeclareUnicodeCharacter{20AC}{\euro}
+
+ \DeclareUnicodeCharacter{2192}{\expansion}
+ \DeclareUnicodeCharacter{21D2}{\result}
+
+ \DeclareUnicodeCharacter{2212}{\minus}
+ \DeclareUnicodeCharacter{2217}{\point}
+ \DeclareUnicodeCharacter{2261}{\equiv}
+}% end of \utfeightchardefs
+
+
+% US-ASCII character definitions.
+\def\asciichardefs{% nothing need be done
+ \relax
+}
+
+% Make non-ASCII characters printable again for compatibility with
+% existing Texinfo documents that may use them, even without declaring a
+% document encoding.
+%
+\setnonasciicharscatcode \other
+
+
+\message{formatting,}
+
+\newdimen\defaultparindent \defaultparindent = 15pt
+
+\chapheadingskip = 15pt plus 4pt minus 2pt
+\secheadingskip = 12pt plus 3pt minus 2pt
+\subsecheadingskip = 9pt plus 2pt minus 2pt
+
+% Prevent underfull vbox error messages.
+\vbadness = 10000
+
+% Don't be so finicky about underfull hboxes, either.
+\hbadness = 2000
+
+% Following George Bush, just get rid of widows and orphans.
+\widowpenalty=10000
+\clubpenalty=10000
+
+% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
+% using an old version of TeX, don't do anything. We want the amount of
+% stretch added to depend on the line length, hence the dependence on
+% \hsize. We call this whenever the paper size is set.
+%
+\def\setemergencystretch{%
+ \ifx\emergencystretch\thisisundefined
+ % Allow us to assign to \emergencystretch anyway.
+ \def\emergencystretch{\dimen0}%
+ \else
+ \emergencystretch = .15\hsize
+ \fi
+}
+
+% Parameters in order: 1) textheight; 2) textwidth;
+% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
+% 7) physical page height; 8) physical page width.
+%
+% We also call \setleading{\textleading}, so the caller should define
+% \textleading. The caller should also set \parskip.
+%
+\def\internalpagesizes#1#2#3#4#5#6#7#8{%
+ \voffset = #3\relax
+ \topskip = #6\relax
+ \splittopskip = \topskip
+ %
+ \vsize = #1\relax
+ \advance\vsize by \topskip
+ \outervsize = \vsize
+ \advance\outervsize by 2\topandbottommargin
+ \pageheight = \vsize
+ %
+ \hsize = #2\relax
+ \outerhsize = \hsize
+ \advance\outerhsize by 0.5in
+ \pagewidth = \hsize
+ %
+ \normaloffset = #4\relax
+ \bindingoffset = #5\relax
+ %
+ \ifpdf
+ \pdfpageheight #7\relax
+ \pdfpagewidth #8\relax
+ \fi
+ %
+ \setleading{\textleading}
+ %
+ \parindent = \defaultparindent
+ \setemergencystretch
+}
+
+% @letterpaper (the default).
+\def\letterpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \textleading = 13.2pt
+ %
+ % If page is nothing but text, make it come out even.
+ \internalpagesizes{46\baselineskip}{6in}%
+ {\voffset}{.25in}%
+ {\bindingoffset}{36pt}%
+ {11in}{8.5in}%
+}}
+
+% Use @smallbook to reset parameters for 7x9.25 trim size.
+\def\smallbook{{\globaldefs = 1
+ \parskip = 2pt plus 1pt
+ \textleading = 12pt
+ %
+ \internalpagesizes{7.5in}{5in}%
+ {\voffset}{.25in}%
+ {\bindingoffset}{16pt}%
+ {9.25in}{7in}%
+ %
+ \lispnarrowing = 0.3in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = .5cm
+}}
+
+% Use @smallerbook to reset parameters for 6x9 trim size.
+% (Just testing, parameters still in flux.)
+\def\smallerbook{{\globaldefs = 1
+ \parskip = 1.5pt plus 1pt
+ \textleading = 12pt
+ %
+ \internalpagesizes{7.4in}{4.8in}%
+ {-.2in}{-.4in}%
+ {0pt}{14pt}%
+ {9in}{6in}%
+ %
+ \lispnarrowing = 0.25in
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = .4cm
+}}
+
+% Use @afourpaper to print on European A4 paper.
+\def\afourpaper{{\globaldefs = 1
+ \parskip = 3pt plus 2pt minus 1pt
+ \textleading = 13.2pt
+ %
+ % Double-side printing via postscript on Laserjet 4050
+ % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
+ % To change the settings for a different printer or situation, adjust
+ % \normaloffset until the front-side and back-side texts align. Then
+ % do the same for \bindingoffset. You can set these for testing in
+ % your texinfo source file like this:
+ % @tex
+ % \global\normaloffset = -6mm
+ % \global\bindingoffset = 10mm
+ % @end tex
+ \internalpagesizes{51\baselineskip}{160mm}
+ {\voffset}{\hoffset}%
+ {\bindingoffset}{44pt}%
+ {297mm}{210mm}%
+ %
+ \tolerance = 700
+ \hfuzz = 1pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = 5mm
+}}
+
+% Use @afivepaper to print on European A5 paper.
+% From [email protected], 2 July 2000.
+% He also recommends making @example and @lisp be small.
+\def\afivepaper{{\globaldefs = 1
+ \parskip = 2pt plus 1pt minus 0.1pt
+ \textleading = 12.5pt
+ %
+ \internalpagesizes{160mm}{120mm}%
+ {\voffset}{\hoffset}%
+ {\bindingoffset}{8pt}%
+ {210mm}{148mm}%
+ %
+ \lispnarrowing = 0.2in
+ \tolerance = 800
+ \hfuzz = 1.2pt
+ \contentsrightmargin = 0pt
+ \defbodyindent = 2mm
+ \tableindent = 12mm
+}}
+
+% A specific text layout, 24x15cm overall, intended for A4 paper.
+\def\afourlatex{{\globaldefs = 1
+ \afourpaper
+ \internalpagesizes{237mm}{150mm}%
+ {\voffset}{4.6mm}%
+ {\bindingoffset}{7mm}%
+ {297mm}{210mm}%
+ %
+ % Must explicitly reset to 0 because we call \afourpaper.
+ \globaldefs = 0
+}}
+
+% Use @afourwide to print on A4 paper in landscape format.
+\def\afourwide{{\globaldefs = 1
+ \afourpaper
+ \internalpagesizes{241mm}{165mm}%
+ {\voffset}{-2.95mm}%
+ {\bindingoffset}{7mm}%
+ {297mm}{210mm}%
+ \globaldefs = 0
+}}
+
+% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
+% Perhaps we should allow setting the margins, \topskip, \parskip,
+% and/or leading, also. Or perhaps we should compute them somehow.
+%
+\parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
+\def\pagesizesyyy#1,#2,#3\finish{{%
+ \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
+ \globaldefs = 1
+ %
+ \parskip = 3pt plus 2pt minus 1pt
+ \setleading{\textleading}%
+ %
+ \dimen0 = #1
+ \advance\dimen0 by \voffset
+ %
+ \dimen2 = \hsize
+ \advance\dimen2 by \normaloffset
+ %
+ \internalpagesizes{#1}{\hsize}%
+ {\voffset}{\normaloffset}%
+ {\bindingoffset}{44pt}%
+ {\dimen0}{\dimen2}%
+}}
+
+% Set default to letter.
+%
+\letterpaper
+
+
+\message{and turning on texinfo input format.}
+
+% Define macros to output various characters with catcode for normal text.
+\catcode`\"=\other
+\catcode`\~=\other
+\catcode`\^=\other
+\catcode`\_=\other
+\catcode`\|=\other
+\catcode`\<=\other
+\catcode`\>=\other
+\catcode`\+=\other
+\catcode`\$=\other
+\def\normaldoublequote{"}
+\def\normaltilde{~}
+\def\normalcaret{^}
+\def\normalunderscore{_}
+\def\normalverticalbar{|}
+\def\normalless{<}
+\def\normalgreater{>}
+\def\normalplus{+}
+\def\normaldollar{$}%$ font-lock fix
+
+% This macro is used to make a character print one way in \tt
+% (where it can probably be output as-is), and another way in other fonts,
+% where something hairier probably needs to be done.
+%
+% #1 is what to print if we are indeed using \tt; #2 is what to print
+% otherwise. Since all the Computer Modern typewriter fonts have zero
+% interword stretch (and shrink), and it is reasonable to expect all
+% typewriter fonts to have this, we can check that font parameter.
+%
+\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
+
+% Same as above, but check for italic font. Actually this also catches
+% non-italic slanted fonts since it is impossible to distinguish them from
+% italic fonts. But since this is only used by $ and it uses \sl anyway
+% this is not a problem.
+\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
+
+% Turn off all special characters except @
+% (and those which the user can use as if they were ordinary).
+% Most of these we simply print from the \tt font, but for some, we can
+% use math or other variants that look better in normal text.
+
+\catcode`\"=\active
+\def\activedoublequote{{\tt\char34}}
+\let"=\activedoublequote
+\catcode`\~=\active
+\def~{{\tt\char126}}
+\chardef\hat=`\^
+\catcode`\^=\active
+\def^{{\tt \hat}}
+
+\catcode`\_=\active
+\def_{\ifusingtt\normalunderscore\_}
+\let\realunder=_
+% Subroutine for the previous macro.
+\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
+
+\catcode`\|=\active
+\def|{{\tt\char124}}
+\chardef \less=`\<
+\catcode`\<=\active
+\def<{{\tt \less}}
+\chardef \gtr=`\>
+\catcode`\>=\active
+\def>{{\tt \gtr}}
+\catcode`\+=\active
+\def+{{\tt \char 43}}
+\catcode`\$=\active
+\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
+
+% If a .fmt file is being used, characters that might appear in a file
+% name cannot be active until we have parsed the command line.
+% So turn them off again, and have \everyjob (or @setfilename) turn them on.
+% \otherifyactive is called near the end of this file.
+\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
+
+% Used sometimes to turn off (effectively) the active characters even after
+% parsing them.
+\def\turnoffactive{%
+ \normalturnoffactive
+ \otherbackslash
+}
+
+\catcode`\@=0
+
+% \backslashcurfont outputs one backslash character in current font,
+% as in \char`\\.
+\global\chardef\backslashcurfont=`\\
+\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
+
+% \realbackslash is an actual character `\' with catcode other, and
+% \doublebackslash is two of them (for the pdf outlines).
+{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
+
+% In texinfo, backslash is an active character; it prints the backslash
+% in fixed width font.
+\catcode`\\=\active
+@def@normalbackslash{{@tt@backslashcurfont}}
+% On startup, @fixbackslash assigns:
+% @let \ = @normalbackslash
+
+% \rawbackslash defines an active \ to do \backslashcurfont.
+% \otherbackslash defines an active \ to be a literal `\' character with
+% catcode other.
+@gdef@rawbackslash{@let\=@backslashcurfont}
+@gdef@otherbackslash{@let\=@realbackslash}
+
+% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
+% the literal character `\'.
+%
+@def@normalturnoffactive{%
+ @let\=@normalbackslash
+ @let"=@normaldoublequote
+ @let~=@normaltilde
+ @let^=@normalcaret
+ @let_=@normalunderscore
+ @let|=@normalverticalbar
+ @let<=@normalless
+ @let>=@normalgreater
+ @let+=@normalplus
+ @let$=@normaldollar %$ font-lock fix
+ @unsepspaces
+}
+
+% Make _ and + \other characters, temporarily.
+% This is canceled by @fixbackslash.
+@otherifyactive
+
+% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
+% That is what \eatinput is for; after that, the `\' should revert to printing
+% a backslash.
+%
+@gdef@eatinput input texinfo{@fixbackslash}
+@global@let\ = @eatinput
+
+% On the other hand, perhaps the file did not have a `\input texinfo'. Then
+% the first `\' in the file would cause an error. This macro tries to fix
+% that, assuming it is called before the first `\' could plausibly occur.
+% Also turn back on active characters that might appear in the input
+% file name, in case not using a pre-dumped format.
+%
+@gdef@fixbackslash{%
+ @ifx\@eatinput @let\ = @normalbackslash @fi
+ @catcode`+=@active
+ @catcode`@_=@active
+}
+
+% Say @foo, not \foo, in error messages.
+@escapechar = `@@
+
+% These look ok in all fonts, so just make them not special.
+@catcode`@& = @other
+@catcode`@# = @other
+@catcode`@% = @other
+
+
+@c Local variables:
+@c eval: (add-hook 'write-file-hooks 'time-stamp)
+@c page-delimiter: "^\\\\message"
+@c time-stamp-start: "def\\\\texinfoversion{"
+@c time-stamp-format: "%:y-%02m-%02d.%02H"
+@c time-stamp-end: "}"
+@c End:
+
+@c vim:sw=2:
+
+@ignore
+ arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
+@end ignore
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..bddb915
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,593 @@
+# configure.ac for libgpg-error
+# Copyright (C) 2003, 2004, 2006, 2010, 2013-2017 g10 Code GmbH
+#
+# This file is part of libgpg-error.
+#
+# libgpg-error is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of the
+# License, or (at your option) any later version.
+#
+# libgpg-error is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
+
+# (Process this file with autoconf to produce a configure script.)
+# The following lines are used by ./autogen.sh.
+AC_PREREQ(2.59)
+min_automake_version="1.14"
+
+# To build a release you need to create a tag with the version number
+# (git tag -s libgpg-error-n.m) and run "./autogen.sh --force".
+# Please bump the version number immediately after the release, do
+# another commit, and a push so that the git magic is able to work.
+# See below for the LT versions.
+m4_define([mym4_package],[libgpg-error])
+m4_define([mym4_major], [1])
+m4_define([mym4_minor], [28])
+
+# Below is m4 magic to extract and compute the revision number, the
+# decimalized short revision number, a beta version string, and a flag
+# indicating a development version (mym4_isgit). Note that the m4
+# processing is done by autoconf and not during the configure run.
+m4_define([mym4_verslist], m4_split(m4_esyscmd([./autogen.sh --find-version] \
+ mym4_package mym4_major mym4_minor),[:]))
+m4_define([mym4_isbeta], m4_argn(2, mym4_verslist))
+m4_define([mym4_version], m4_argn(4, mym4_verslist))
+m4_define([mym4_revision], m4_argn(7, mym4_verslist))
+m4_define([mym4_revision_dec], m4_argn(8, mym4_verslist))
+m4_esyscmd([echo ]mym4_version[>VERSION])
+AC_INIT([mym4_package],[mym4_version], [https://bugs.gnupg.org])
+# LT Version numbers, remember to change them just *before* a release.
+# (Code changed: REVISION++)
+# (Interfaces added/removed/changed: CURRENT++, REVISION=0)
+# (Interfaces added: AGE++)
+# (Interfaces removed: AGE=0)
+# Note that added error codes don't constitute an interface change.
+LIBGPG_ERROR_LT_CURRENT=22
+LIBGPG_ERROR_LT_AGE=22
+LIBGPG_ERROR_LT_REVISION=0
+################################################
+
+AC_SUBST(LIBGPG_ERROR_LT_CURRENT)
+AC_SUBST(LIBGPG_ERROR_LT_AGE)
+AC_SUBST(LIBGPG_ERROR_LT_REVISION)
+
+VERSION_NUMBER=m4_esyscmd(printf "0x%02x%02x00" mym4_major mym4_minor)
+AC_SUBST(VERSION_NUMBER)
+
+AC_CONFIG_AUX_DIR([build-aux])
+AM_INIT_AUTOMAKE([serial-tests dist-bzip2])
+AM_MAINTAINER_MODE
+AC_CONFIG_SRCDIR([src/err-sources.h.in])
+AC_CONFIG_HEADER([config.h])
+AC_CONFIG_MACRO_DIR([m4])
+AM_SILENT_RULES
+
+# We need to know about the host architecture to avoid spurious
+# warnings.
+AC_CANONICAL_HOST
+AB_INIT
+
+# Checks for programs.
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_CPP
+AC_PROG_AWK
+AC_CHECK_TOOL(AR, ar, :)
+AC_GNU_SOURCE
+
+# Set some variables depending on the platform for later use.
+have_w32_system=no
+have_w64_system=no
+have_w32ce_system=no
+case "${host}" in
+ x86_64-*mingw32*)
+ have_w32_system=yes
+ have_w64_system=yes
+ ;;
+ *-mingw32ce*)
+ have_w32_system=yes
+ have_w32ce_system=yes
+ ;;
+ *-mingw32*)
+ have_w32_system=yes
+ ;;
+ *-apple-darwin*)
+ # This is the equivalent of the _GNU_SOURCE feature-test-macro
+ # on GNU libc systems.
+ AC_DEFINE(_DARWIN_C_SOURCE, 900000L,
+ Expose all libc features (__DARWIN_C_FULL).)
+ ;;
+ *)
+ ;;
+esac
+
+
+if test "$have_w32_system" != yes; then
+ gl_THREADLIB_EARLY
+fi
+
+# We build libgpg-error with large file support so that we have a 64
+# bit off_t. Our external interface uses the gpgrt_off_t which is
+# anyway specified as 64 bit. Thus the same libgpg-error can be used
+# by software which is not build with large file support.
+AC_SYS_LARGEFILE
+
+
+LT_PREREQ([2.2.6])
+LT_INIT([win32-dll disable-static])
+LT_LANG([Windows Resource])
+
+
+# We need to compile and run a program on the build machine.
+dnl The AC_PROG_CC_FOR_BUILD macro in the AC archive is broken for
+dnl autoconf 2.57.
+dnl AC_PROG_CC_FOR_BUILD
+AC_MSG_CHECKING(for cc for build)
+if test "$cross_compiling" = "yes"; then
+ CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
+else
+ CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
+fi
+AC_MSG_RESULT($CC_FOR_BUILD)
+AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
+
+
+AH_BOTTOM([
+/* Force using of NLS for W32 even if no libintl has been found. This is
+ okay because we have our own gettext implementation for W32. */
+#if defined(HAVE_W32_SYSTEM) && !defined(ENABLE_NLS)
+#define ENABLE_NLS 1
+#endif
+
+/* Connect the generic estream-printf.c to our framework. */
+#define _ESTREAM_PRINTF_REALLOC _gpgrt_realloc
+#define _ESTREAM_PRINTF_EXTRA_INCLUDE "gpgrt-int.h"
+
+/* For building we need to define these macro. */
+#define GPG_ERR_ENABLE_GETTEXT_MACROS 1
+#define GPG_ERR_ENABLE_ERRNO_MACROS 1
+#define GPGRT_ENABLE_ES_MACROS 1
+])
+
+
+# Note, that autogen.sh greps for the next line.
+AM_GNU_GETTEXT_VERSION([0.19.3])
+AM_GNU_GETTEXT([external])
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS([stdlib.h locale.h stdint.h sys/select.h sys/time.h])
+AC_FUNC_STRERROR_R
+case "${host_os}" in
+ solaris*)
+ # All versions of Solaris from 2.4 have a thread-safe strerror().
+ # Since Solaris 10, in addition strerror_r() exists.
+ ;;
+ *)
+ AC_CHECK_FUNC([strerror_r], [],
+AC_MSG_WARN([[Without strerror_r, gpg_strerror_r might not be thread-safe]]))
+ ;;
+esac
+
+AC_CHECK_FUNCS([flockfile vasprintf])
+
+
+#
+# Checks for typedefs, structures, and compiler characteristics.
+#
+AC_C_CONST
+
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+AC_HEADER_TIME
+AC_CHECK_SIZEOF(time_t,,[[
+#include <stdio.h>
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+]])
+
+# Find a 64 bit integer type to be used instead of off_t. We prefer
+# the standard integer types over int64_t and finally try long long.
+if test "$ac_cv_sizeof_int" = "8"; then
+ replacement_for_off_t="int"
+elif test "$ac_cv_sizeof_long" = "8"; then
+ replacement_for_off_t="long"
+elif test "$ac_cv_header_stdint_h" = yes; then
+ replacement_for_off_t="int64_t"
+elif test "$ac_cv_sizeof_long_long" = "8"; then
+ replacement_for_off_t="long long"
+else
+ AC_MSG_ERROR([[
+***
+*** No 64 bit signed integer type found. Can't build this library.
+***]])
+fi
+AC_DEFINE_UNQUOTED(REPLACEMENT_FOR_OFF_T, "$replacement_for_off_t",
+ [Used by mkheader to insert the replacement type.])
+
+
+
+#
+# Setup gcc specific options
+#
+AC_MSG_NOTICE([checking for cc features])
+if test "$GCC" = yes; then
+ # Check whether gcc does not emit a diagnostic for unknown -Wno-*
+ # options. This is the case for gcc >= 4.6
+ AC_MSG_CHECKING([if gcc ignores unknown -Wno-* options])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6 )
+#kickerror
+#endif]],[])],[_gcc_silent_wno=yes],[_gcc_silent_wno=no])
+ AC_MSG_RESULT($_gcc_silent_wno)
+
+ # Note that it is okay to use CFLAGS here because these are just
+ # warning options and the user should have a chance of overriding
+ # them.
+ if test "$USE_MAINTAINER_MODE" = "yes"; then
+ M_CFLAGS="-O3 -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
+ M_CFLAGS="$M_CFLAGS -Wformat -Wno-format-y2k -Wformat-security"
+ if test x"$_gcc_silent_wno" = xyes ; then
+ _gcc_wopt=yes
+ else
+ AC_MSG_CHECKING([if gcc supports -Wno-missing-field-initializers])
+ _gcc_cflags_save=$CFLAGS
+ CFLAGS="-Wno-missing-field-initializers"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
+ [_gcc_wopt=yes],[_gcc_wopt=no])
+ AC_MSG_RESULT($_gcc_wopt)
+ CFLAGS=$_gcc_cflags_save;
+ fi
+ if test x"$_gcc_wopt" = xyes ; then
+ M_CFLAGS="$M_CFLAGS -W -Wno-sign-compare -Wno-missing-field-initializers"
+ fi
+
+ AC_MSG_CHECKING([if gcc supports -Wdeclaration-after-statement])
+ _gcc_cflags_save=$CFLAGS
+ CFLAGS="-Wdeclaration-after-statement"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_wopt=yes,_gcc_wopt=no)
+ AC_MSG_RESULT($_gcc_wopt)
+ CFLAGS=$_gcc_cflags_save;
+ if test x"$_gcc_wopt" = xyes ; then
+ M_CFLAGS="$M_CFLAGS -Wdeclaration-after-statement"
+ fi
+
+ # Prepend the maintainer-cflags so that the user can override
+ # them, e.g. to override the optimization flags for debugging.
+ CFLAGS="$M_CFLAGS $CFLAGS"
+ else
+ CFLAGS="$CFLAGS -Wall"
+ fi
+
+ AC_MSG_CHECKING([if gcc supports -Wpointer-arith])
+ _gcc_cflags_save=$CFLAGS
+ CFLAGS="-Wpointer-arith"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_psign=yes,_gcc_psign=no)
+ AC_MSG_RESULT($_gcc_psign)
+ CFLAGS=$_gcc_cflags_save;
+ if test x"$_gcc_psign" = xyes ; then
+ CFLAGS="$CFLAGS -Wpointer-arith"
+ fi
+
+ # The undocumented option -Wno-psabi suppresses the annoying
+ # "the ABI of passing union with long double has changed in GCC 4.4"
+ # which is emitted in estream-printf.c but entirely irrelvant
+ # because that union is local to the file.
+ if test x"$_gcc_silent_wno" = xyes ; then
+ CFLAGS="$CFLAGS -Wno-psabi"
+ fi
+fi
+
+#
+# Check whether the compiler supports the GCC style aligned attribute
+#
+AC_CACHE_CHECK([whether the GCC style aligned attribute is supported],
+ [gcry_cv_gcc_attribute_aligned],
+ [gcry_cv_gcc_attribute_aligned=no
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE(
+ [[struct { int a; } foo __attribute__ ((aligned (16)));]])],
+ [gcry_cv_gcc_attribute_aligned=yes])])
+if test "$gcry_cv_gcc_attribute_aligned" = "yes" ; then
+ AC_DEFINE(HAVE_GCC_ATTRIBUTE_ALIGNED,1,
+ [Defined if a GCC style "__attribute__ ((aligned (n))" is supported])
+fi
+
+#
+# Check for ELF visibility support.
+#
+AC_CACHE_CHECK(whether the visibility attribute is supported,
+ gcry_cv_visibility_attribute,
+ [gcry_cv_visibility_attribute=no
+ AC_LANG_CONFTEST([AC_LANG_SOURCE(
+ [[int foo __attribute__ ((visibility ("hidden"))) = 1;
+ int bar __attribute__ ((visibility ("protected"))) = 1;
+ ]])])
+
+ if ${CC-cc} -Werror -S conftest.c -o conftest.s \
+ 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then
+ if grep '\.hidden.*foo' conftest.s >/dev/null 2>&1 ; then
+ if grep '\.protected.*bar' conftest.s >/dev/null 2>&1; then
+ gcry_cv_visibility_attribute=yes
+ fi
+ fi
+ fi
+ ])
+if test "$gcry_cv_visibility_attribute" = "yes"; then
+ AC_CACHE_CHECK(for broken visibility attribute,
+ gcry_cv_broken_visibility_attribute,
+ [gcry_cv_broken_visibility_attribute=yes
+ AC_LANG_CONFTEST([AC_LANG_SOURCE(
+ [[int foo (int x);
+ int bar (int x) __asm__ ("foo")
+ __attribute__ ((visibility ("hidden")));
+ int bar (int x) { return x; }
+ ]])])
+
+ if ${CC-cc} -Werror -S conftest.c -o conftest.s \
+ 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then
+ if grep '\.hidden@<:@ _@:>@foo' conftest.s >/dev/null 2>&1;
+ then
+ gcry_cv_broken_visibility_attribute=no
+ fi
+ fi
+ ])
+fi
+if test "$gcry_cv_visibility_attribute" = "yes"; then
+ AC_CACHE_CHECK(for broken alias attribute,
+ gcry_cv_broken_alias_attribute,
+ [gcry_cv_broken_alias_attribute=yes
+ AC_LANG_CONFTEST([AC_LANG_SOURCE(
+ [[extern int foo (int x) __asm ("xyzzy");
+ int bar (int x) { return x; }
+ extern __typeof (bar) foo __attribute ((weak, alias ("bar")));
+ extern int dfoo;
+ extern __typeof (dfoo) dfoo __asm ("abccb");
+ int dfoo = 1;
+ ]])])
+
+ if ${CC-cc} -Werror -S conftest.c -o conftest.s \
+ 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ; then
+ if grep 'xyzzy' conftest.s >/dev/null 2>&1 && \
+ grep 'abccb' conftest.s >/dev/null 2>&1; then
+ gcry_cv_broken_alias_attribute=no
+ fi
+ fi
+ ])
+fi
+if test "$gcry_cv_visibility_attribute" = "yes"; then
+ AC_CACHE_CHECK(if gcc supports -fvisibility=hidden,
+ gcry_cv_gcc_has_f_visibility,
+ [gcry_cv_gcc_has_f_visibility=no
+ _gcc_cflags_save=$CFLAGS
+ CFLAGS="-fvisibility=hidden"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
+ gcry_cv_gcc_has_f_visibility=yes)
+ CFLAGS=$_gcc_cflags_save;
+ ])
+fi
+if test "$gcry_cv_visibility_attribute" = "yes" \
+ && test "$gcry_cv_broken_visibility_attribute" != "yes" \
+ && test "$gcry_cv_broken_alias_attribute" != "yes" \
+ && test "$gcry_cv_gcc_has_f_visibility" = "yes"
+ then
+ AC_DEFINE(GPGRT_USE_VISIBILITY, 1,
+ [Define to use the GNU C visibility attribute.])
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+fi
+
+#
+# Check whether ld supports a version script.
+# (Actually not a check but a list of systems which are known to support it.)
+#
+have_ld_version_script=no
+case "${host}" in
+ *-*-linux*)
+ have_ld_version_script=yes
+ ;;
+ *-*-gnu*)
+ have_ld_version_script=yes
+ ;;
+esac
+AC_ARG_ENABLE([ld-version-script],
+ AC_HELP_STRING([--enable-ld-version-script],
+ [enable/disable use of linker version script.
+ (default is system dependent)]),
+ [have_ld_version_script=$enableval],
+ [ : ] )
+AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
+
+
+#
+# Check for thread library.
+#
+# Windows has always thread support; thus we don't bother to test for
+# it as it may lead to false results when cross building.
+if test "$have_w32_system" = yes; then
+ AC_DEFINE([USE_WINDOWS_THREADS], [1])
+ LIBTHREAD=
+ LTLIBTHREAD=
+ LIBMULTITHREAD=
+ LTLIBMULTITHREAD=
+ THREADLIB_CPPFLAGS=""
+ AC_SUBST([LIBTHREAD])
+ AC_SUBST([LTLIBTHREAD])
+ AC_SUBST([LIBMULTITHREAD])
+ AC_SUBST([LTLIBMULTITHREAD])
+else
+ gl_LOCK
+ if test "$gl_threads_api" = posix; then
+ AC_CHECK_SIZEOF(pthread_mutex_t,,[AC_INCLUDES_DEFAULT
+ #include <pthread.h>])
+ fi
+fi
+
+# Default value for GPG_ERROR_CONFIG_LIBS
+config_libs="-lgpg-error"
+
+#
+# Check for other libraries (now only for -lrt).
+#
+LIB_SCHED_YIELD=
+AC_SUBST([LIB_SCHED_YIELD])
+AC_SEARCH_LIBS([sched_yield], [rt posix4],
+ [if test "$ac_cv_search_sched_yield" != "none required"; then
+ LIB_SCHED_YIELD=$ac_cv_search_sched_yield
+ config_libs="$config_libs $LIB_SCHED_YIELD"
+ fi])
+
+#
+# Prepare building of estream
+#
+estream_INIT
+
+#
+# Substitution used for gpg-error-config
+#
+GPG_ERROR_CONFIG_LIBS="$config_libs"
+if test "x$LIBTHREAD" != x; then
+ GPG_ERROR_CONFIG_LIBS="${GPG_ERROR_CONFIG_LIBS} ${LIBTHREAD}"
+fi
+if test "x$LIBMULTITHREAD" != x; then
+ GPG_ERROR_CONFIG_MT_LIBS="${LIBMULTITHREAD}"
+else
+ GPG_ERROR_CONFIG_MT_LIBS=""
+fi
+GPG_ERROR_CONFIG_CFLAGS=""
+if test "x$THREADLIB_CPPFLAGS" != x; then
+ GPG_ERROR_CONFIG_MT_CFLAGS="${THREADLIB_CPPFLAGS}"
+else
+ GPG_ERROR_CONFIG_MT_CFLAGS=""
+fi
+GPG_ERROR_CONFIG_ISUBDIRAFTER=""
+GPG_ERROR_CONFIG_HOST="$host"
+AC_SUBST(GPG_ERROR_CONFIG_LIBS)
+AC_SUBST(GPG_ERROR_CONFIG_CFLAGS)
+AC_SUBST(GPG_ERROR_CONFIG_MT_LIBS)
+AC_SUBST(GPG_ERROR_CONFIG_MT_CFLAGS)
+AC_SUBST(GPG_ERROR_CONFIG_ISUBDIRAFTER)
+AC_SUBST(GPG_ERROR_CONFIG_HOST)
+
+
+#
+# Special defines for certain platforms
+#
+force_use_syscfg=no
+if test "$have_w32_system" = yes; then
+ AC_DEFINE(HAVE_W32_SYSTEM,1,[Defined if we run on a W32 API based system])
+ if test "$have_w64_system" = yes; then
+ AC_DEFINE(HAVE_W64_SYSTEM,1,[Defined if we run on 64 bit W32 API system])
+ fi
+ if test "$have_w32ce_system" = yes; then
+ AC_DEFINE(HAVE_W32CE_SYSTEM,1,[Defined if we run on WindowsCE])
+ GPG_ERROR_CONFIG_ISUBDIRAFTER="gpg-extra"
+ fi
+ force_use_syscfg=yes
+fi
+if test x$cross_compiling = xyes; then
+ force_use_syscfg=yes
+fi
+
+AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
+AM_CONDITIONAL(HAVE_W64_SYSTEM, test "$have_w64_system" = yes)
+AM_CONDITIONAL(HAVE_W32CE_SYSTEM, test "$have_w32ce_system" = yes)
+AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
+AM_CONDITIONAL(FORCE_USE_SYSCFG, test x$force_use_syscfg = xyes)
+
+AC_DEFINE_UNQUOTED(HOST_TRIPLET_STRING, "$host", [The host triplet])
+
+
+#
+# Provide information about the build.
+#
+BUILD_REVISION="mym4_revision"
+AC_SUBST(BUILD_REVISION)
+AC_DEFINE_UNQUOTED(BUILD_REVISION, "$BUILD_REVISION",
+ [GIT commit id revision used to build this package])
+
+changequote(,)dnl
+BUILD_VERSION=`echo "$PACKAGE_VERSION"|sed 's/\([0-9.]*\).*/\1./'`
+changequote([,])dnl
+BUILD_VERSION="${BUILD_VERSION}0.mym4_revision_dec"
+BUILD_FILEVERSION=`echo "${BUILD_VERSION}" | tr . ,`
+AC_SUBST(BUILD_VERSION)
+AC_SUBST(BUILD_FILEVERSION)
+
+AC_ARG_ENABLE([build-timestamp],
+ AC_HELP_STRING([--enable-build-timestamp],
+ [set an explicit build timestamp for reproducibility.
+ (default is the current time in ISO-8601 format)]),
+ [if test "$enableval" = "yes"; then
+ BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`
+ else
+ BUILD_TIMESTAMP="$enableval"
+ fi],
+ [BUILD_TIMESTAMP="<none>"])
+AC_SUBST(BUILD_TIMESTAMP)
+AC_DEFINE_UNQUOTED(BUILD_TIMESTAMP, "$BUILD_TIMESTAMP",
+ [The time this package was configured for a build])
+
+
+
+AC_ARG_ENABLE(languages, AC_HELP_STRING([--disable-languages],
+ [do not build support for other languages than C]))
+AM_CONDITIONAL([LANGUAGES_SOME], [test "x$enable_languages" != xno])
+
+build_doc=yes
+AC_ARG_ENABLE([doc], AC_HELP_STRING([--disable-doc],
+ [do not build the documentation]),
+ build_doc=$enableval, build_doc=yes)
+AM_CONDITIONAL([BUILD_DOC], [test "x$build_doc" != xno])
+
+build_tests=yes
+AC_ARG_ENABLE([tests], AC_HELP_STRING([--disable-tests],
+ [do not build the tests]),
+ build_tests=$enableval, build_tests=yes)
+AM_CONDITIONAL([BUILD_TESTS], [test "x$build_tests" != xno])
+
+#
+# Substitution
+#
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([doc/Makefile po/Makefile.in m4/Makefile])
+AC_CONFIG_FILES([src/Makefile tests/Makefile])
+AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpg-error.asd])
+AC_CONFIG_FILES([src/versioninfo.rc src/gpg-error.w32-manifest])
+AC_CONFIG_FILES([src/gpg-error-config], [chmod +x src/gpg-error-config])
+
+AC_OUTPUT
+
+tmp=
+if test "$have_w32_system" != yes; then
+ if test x"$gl_use_threads" = xno; then
+ tmp=" NO-THREADS"
+ fi
+fi
+echo "
+ $PACKAGE_NAME v$PACKAGE_VERSION has been configured as follows:
+
+ Revision: mym4_revision (mym4_revision_dec)
+ Platform: $host$tmp
+"
+if test "$gcry_cv_gcc_attribute_aligned" != "yes" ; then
+cat <<G10EOF
+***
+*** Please note that your compiler does not support the GCC style
+*** aligned attribute. Using this software may evoke bus errors.
+***
+G10EOF
+fi
diff --git a/contrib/ChangeLog-2011 b/contrib/ChangeLog-2011
new file mode 100644
index 0000000..87c1aa4
--- /dev/null
+++ b/contrib/ChangeLog-2011
@@ -0,0 +1,25 @@
+2011-12-01 Werner Koch <[email protected]>
+
+ NB: ChangeLog files are no longer manually maintained. Starting
+ on December 1st, 2011 we put change information only in the GIT
+ commit log, and generate a top-level ChangeLog file from logs at
+ "make dist". See doc/HACKING for details.
+
+2010-11-15 Marcus Brinkmann <[email protected]>
+
+ * conf-w32ce-msc/stdint.h: New file.
+ * conf-w32ce-msc/build.mk (conf_sources): Add stdint.h.
+
+2010-11-15 Werner Koch <[email protected]>
+
+ * conf-w32ce-msc/build.mk (clean): New.
+
+2010-11-02 Werner Koch <[email protected]>
+
+ * conf-w32ce-msc/build.mk: Change directory layout. Provide
+ install target.
+
+2010-10-28 Werner Koch <[email protected]>
+
+ * contrib/conf-w32ce-msc/build.mk: New.
+ * contrib/conf-w32ce-msc/config.h: New.
diff --git a/contrib/conf-w32ce-msc/build.mk b/contrib/conf-w32ce-msc/build.mk
new file mode 100755
index 0000000..0909509
--- /dev/null
+++ b/contrib/conf-w32ce-msc/build.mk
@@ -0,0 +1,144 @@
+# build.mk - Makefile to build libgpg-error using Visual-C
+# Copyright 2010 g10 Code GmbH
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This file 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.
+
+# This is a helper make script to build libgpg-error for WindowsCE
+# using the Microsoft Visual C compiler.
+
+# The target build directory where we run the Visual C compiler/ This
+# needs to be an absolute directory name. Further we expect this
+# structure of the tree:
+#
+# TARGET/src - Source directories: One directory for each project
+# /bin - Installed DLLs
+# /lib - Installed import libs.
+# /include - Instaled header files.
+
+targetdir = /home/smb/xppro-gnu
+targetsrc = $(targetdir)/src
+
+# Install directories (relative)
+bindir = ../../../bin
+libdir = ../../../lib
+incdir = ../../../include
+
+help:
+ @echo "Run "
+ @echo " make -f ../contrib/conf-w32ce-msc/build.mk copy-source"
+ @echo "on the POSIX system and then"
+ @echo " nmake -f build.mk all"
+ @echo " nmake -f build.mk install"
+ @echo "on the Windows system"
+
+ce_defines = -DWINCE -D_WIN32_WCE=0x502 -DUNDER_CE \
+ -DWIN32_PLATFORM_PSPC -D_UNICODE -DUNICODE \
+ -D_CONSOLE -DARM -D_ARM_
+#-D_DEBUG -DDEBUG
+
+# Some options of Visual-C:
+# -W3 Set warning level 3
+# -Zi Generate debug info
+# -Od Disable optimization
+# -Gm Enable minimal rebuild (for C++)
+# -EHsc Exception handling model sc
+# -MTd Create a debug multithreaded executable
+# -fp: Floating point behaviour
+# -GR- Disable runtime type information
+# -Os Favor small code
+# -LD Create a DLL
+# -Fe Set executable output name (may be only a directory)
+CFLAGS = -nologo -W3 -fp:fast -Os $(ce_defines) \
+ -DHAVE_CONFIG_H -DDLL_EXPORT -I. -Igpg-extra
+
+LDFLAGS =
+
+# Standard source files
+sources = \
+ init.c init.h \
+ strsource.c \
+ strerror.c \
+ code-to-errno.c \
+ code-from-errno.c \
+ w32-gettext.c \
+ gettext.h \
+ err-sources.h \
+ err-codes.h
+
+# Sources files in this directory inclduing this Makefile
+conf_sources = \
+ build.mk \
+ config.h \
+ stdint.h
+
+# Source files built by running the standard build system.
+built_sources = \
+ code-from-errno.h \
+ code-to-errno.h \
+ err-codes-sym.h \
+ err-sources-sym.h \
+ errnos-sym.h \
+ gpg-error.h \
+ mkerrcodes.h \
+ mkw32errmap.map.c \
+ gpg-error.def \
+ gpg-extra/errno.h
+
+copy-static-source:
+ @if [ ! -f ./w32-gettext.c ]; then \
+ echo "Please cd to the src/ directory first"; \
+ exit 1; \
+ fi
+ cp -t $(targetsrc)/libgpg-error/src $(sources);
+ cd ../contrib/conf-w32ce-msc ; \
+ cp -t $(targetsrc)/libgpg-error/src $(conf_sources)
+
+
+copy-built-source:
+ @if [ ! -f ./mkw32errmap.map.c ]; then \
+ echo "Please build using ./autogen.sh --build-w32ce first"; \
+ exit 1; \
+ fi
+ cp -t $(targetsrc)/libgpg-error/src $(built_sources)
+ -mkdir $(targetsrc)/libgpg-error/src/gpg-extra
+ mv $(targetsrc)/libgpg-error/src/errno.h \
+ $(targetsrc)/libgpg-error/src/gpg-extra
+
+copy-source: copy-static-source copy-built-source
+
+
+all: $(sources) $(conf_sources) $(built_sources)
+ $(CC) $(CFLAGS) -c w32-gettext.c
+ $(CC) $(CFLAGS) -c init.c
+ $(CC) $(CFLAGS) -c strsource.c
+ $(CC) $(CFLAGS) -c strerror.c
+ $(CC) $(CFLAGS) -c code-to-errno.c
+ $(CC) $(CFLAGS) -c code-from-errno.c
+ link.exe /DLL /IMPLIB:libgpg-error-0-msc.lib \
+ /OUT:libgpg-error-0-msc.dll \
+ /DEF:gpg-error.def /NOLOGO /MANIFEST:NO \
+ /NODEFAULTLIB:"oldnames.lib" /DYNAMICBASE:NO \
+ w32-gettext.obj init.obj strsource.obj strerror.obj \
+ code-to-errno.obj code-from-errno.obj \
+ coredll.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib \
+ commctrl.lib /subsystem:windowsce,5.02
+
+install: all
+ -mkdir $(bindir:/=\)
+ -mkdir $(libdir:/=\)
+ -mkdir $(incdir:/=\)
+ -mkdir $(incdir:/=\)\gpg-extra
+ copy /y gpg-error.h $(incdir:/=\)
+ copy /y gpg-extra\errno.h $(incdir:/=\)\gpg-extra
+ copy /y libgpg-error-0-msc.dll $(bindir:/=\)
+ copy /y libgpg-error-0-msc.lib $(libdir:/=\)
+
+clean:
+ del *.obj libgpg-error-0-msc.lib \
+ libgpg-error-0-msc.dll libgpg-error-0-msc.exe
diff --git a/contrib/conf-w32ce-msc/config.h b/contrib/conf-w32ce-msc/config.h
new file mode 100755
index 0000000..1d8132c
--- /dev/null
+++ b/contrib/conf-w32ce-msc/config.h
@@ -0,0 +1,153 @@
+/* config.h for building with Visual-C for WindowsCE.
+ * Copyright 2010 g10 Code GmbH
+ *
+ * This file is free software; as a special exception the author gives
+ * unlimited permission to copy and/or distribute it, with or without
+ * modifications, as long as this notice is preserved.
+ *
+ * This file 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.
+ */
+
+/* This file was originally created by running
+ * ./autogen.sh --build-w32ce
+ * on svn revision 253 (libgpg-error 1.10) and then adjusted to work
+ * with Visual-C.
+ */
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "1.11-msc1"
+
+
+/* Name of package */
+#define PACKAGE "libgpg-error"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "[email protected]"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "libgpg-error"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "libgpg-error " PACKAGE_VERSION
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "libgpg-error"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+
+
+/* Define to 1 if translation of program messages to the user's native
+ language is requested. */
+/* #undef ENABLE_NLS */
+
+/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
+ CoreFoundation framework. */
+/* #undef HAVE_CFLOCALECOPYCURRENT */
+
+/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
+ the CoreFoundation framework. */
+/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+ */
+/* #undef HAVE_DCGETTEXT */
+
+/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
+ don't. */
+#define HAVE_DECL_STRERROR_R 0
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+/* #undef HAVE_DLFCN_H */
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+/* #undef HAVE_GETTEXT */
+
+/* Define if you have the iconv() function and it works. */
+/* #undef HAVE_ICONV */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the <locale.h> header file. */
+/* #undef HAVE_LOCALE_H */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strerror_r' function. */
+/* #undef HAVE_STRERROR_R */
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Defined if we run on WindowsCE */
+#define HAVE_W32CE_SYSTEM 1
+
+/* Defined if we run on a W32 API based system */
+#define HAVE_W32_SYSTEM 1
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#define LT_OBJDIR ".libs/"
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+/* #undef NO_MINUS_C_MINUS_O */
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if strerror_r returns char *. */
+/* #undef STRERROR_R_CHAR_P */
+
+
+/* Version number of package */
+#define VERSION PACKAGE_VERSION
+
+/* Define to 1 if on MINIX. */
+/* #undef _MINIX */
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+/* #undef _POSIX_1_SOURCE */
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+/* #undef _POSIX_SOURCE */
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+
+/* Force using of NLS for W32 even if no libintl has been found. This is
+ okay because we have our own gettext implementation for W32. */
+#if defined(HAVE_W32_SYSTEM) && !defined(ENABLE_NLS)
+#define ENABLE_NLS 1
+#endif
+/* For building we need to define these macro. */
+#define GPG_ERR_ENABLE_GETTEXT_MACROS 1
+#define GPG_ERR_ENABLE_ERRNO_MACROS 1
+
+/* snprintf is not part of oldnames.lib thus we redefine it here. */
+#define snprintf _snprintf
+
diff --git a/contrib/conf-w32ce-msc/stdint.h b/contrib/conf-w32ce-msc/stdint.h
new file mode 100755
index 0000000..0a821b7
--- /dev/null
+++ b/contrib/conf-w32ce-msc/stdint.h
@@ -0,0 +1,9 @@
+typedef unsigned long long uint64_t;
+typedef long long int64_t;
+typedef unsigned int uint32_t;
+typedef int int32_t;
+typedef unsigned short uint16_t;
+typedef short int16_t;
+typedef unsigned int uintptr_t;
+typedef int intptr_t;
+
diff --git a/doc/HACKING b/doc/HACKING
new file mode 100644
index 0000000..e30b2f8
--- /dev/null
+++ b/doc/HACKING
@@ -0,0 +1,25 @@
+# HACKING -*- org -*-
+#+TITLE: Various hacking notes
+#+STARTUP: showall
+
+* No more ChangeLog files
+
+ Do not modify any of the ChangeLog files in Libgpg-error. Starting
+ on December 1st, 2011 we put change information only in the GIT
+ commit log, and generate a top-level ChangeLog file from logs at
+ "make dist" time. As such, there are strict requirements on the
+ form of the commit log messages. The old ChangeLog files have all
+ be renamed to ChangeLog-2011
+
+
+* Commit log requirements
+
+ Your commit log should always start with a one-line summary, the
+ second line should be blank, and the remaining lines are usually
+ ChangeLog-style entries for all affected files. However, it's fine
+ -- even recommended -- to write a few lines of prose describing the
+ change, when the summary and ChangeLog entries don't give enough of
+ the big picture. Omit the leading TABs that you're used to seeing
+ in a "real" ChangeLog file, but keep the maximum line length at 72
+ or smaller, so that the generated ChangeLog lines, each with its
+ leading TAB, will not exceed 80 columns.
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..d052283
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,93 @@
+# Makefile.am for libgpg-error documentation
+# Copyright (C) 2014 g10 Code GmbH
+#
+# This file is part of libgpg-error.
+#
+# libgpg-error is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of the
+# License, or (at your option) any later version.
+#
+# libgpg-error is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, see <https://www.gnu.org/licenses/>.
+
+
+EXTRA_DIST = HACKING errorref.txt \
+ yat2m.c
+
+DISTCLEANFILES = gpgrt.cps yat2m-stamp.tmp yat2m-stamp $(myman_pages)
+CLEANFILES = yat2m errorref.txt.x
+
+info_TEXINFOS = gpgrt.texi
+gpgrt_TEXINFOS = lgpl.texi gpl.texi
+
+YAT2M_OPTIONS = -I $(srcdir) \
+ --release "Libgpg-error @PACKAGE_VERSION@" --source "GnuPG"
+
+myman_sources = gpgrt.texi
+myman_pages = gpg-error-config.1
+
+man_MANS = $(myman_pages)
+
+yat2m: yat2m.c
+ $(CC_FOR_BUILD) -DPACKAGE_VERSION="\"$(PACKAGE_VERSION)\"" \
+ -o $@ $(srcdir)/yat2m.c
+
+
+yat2m-stamp: $(myman_sources)
+ @rm -f yat2m-stamp.tmp
+ @touch yat2m-stamp.tmp
+ for file in $(myman_sources) ; do \
+ ./yat2m $(YAT2M_OPTIONS) --store \
+ `test -f '$$file' || echo '$(srcdir)/'`$$file ; done
+ @mv -f yat2m-stamp.tmp $@
+
+yat2m-stamp: yat2m
+
+$(myman_pages) : yat2m-stamp
+ @if test -f $@; then :; else \
+ trap 'rm -rf yat2m-stamp yat2m-lock' 1 2 13 15; \
+ if mkdir yat2m-lock 2>/dev/null; then \
+ rm -f yat2m-stamp; \
+ $(MAKE) $(AM_MAKEFLAGS) yat2m-stamp; \
+ rmdir yat2m-lock; \
+ else \
+ while test -d yat2m-lock; do sleep 1; done; \
+ test -f yat2m-stamp; exit $$?; \
+ fi; \
+ fi
+
+# Make sure that gpgrt.texi is touched if any other texi file has
+# been modified. This is required so that the version.texi magic
+# updates the release date.
+gpgrt.texi : $(gpgrt_TEXINFOS)
+ touch $(srcdir)/gpgrt.texi
+
+errorref.txt.x : errorref.txt
+ sed '/^##/ d' $< >$@
+ echo "# Installed by $(PACKAGE_NAME) $(PACKAGE_VERSION)" >>$@
+
+install-exec-hook:
+if CROSS_COMPILING
+ @echo "not install yat2m while cross-compiling"
+else
+ @echo "installing yat2m on the build system"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) \
+ yat2m "$(DESTDIR)$(bindir)/yat2m"
+endif
+
+install-data-local: errorref.txt.x
+ $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
+ $(INSTALL_DATA) errorref.txt.x $(DESTDIR)$(pkgdatadir)/errorref.txt
+
+uninstall-local:
+ -@rm $(DESTDIR)$(pkgdatadir)/errorref.txt
+if !CROSS_COMPILING
+ -@rm $(DESTDIR)$(bindir)/yat2m
+endif
diff --git a/doc/errorref.txt b/doc/errorref.txt
new file mode 100644
index 0000000..284123b
--- /dev/null
+++ b/doc/errorref.txt
@@ -0,0 +1,1122 @@
+# errorref.txt - Description of error codes
+# Copyright (C) 2003-2004, 2010, 2013-2016 g10 Code GmbH
+#
+# This file is part of libgpg-error.
+#
+# libgpg-error is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+#
+# libgpg-error is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, see <https://www.gnu.org/licenses/>.
+##
+## Note that lines with a leading double hash will not installed.
+## Please do not put any tabs into this file.
+##
+## find ~/s/{gnupg,libgpg-error,libksba,libgcrypt,gpgme,gpa} -type f \
+## -name '*.[ch]' -print0 | xargs -0 grep -n GPG_ERR_
+
+
+GPG_ERR_UNKNOWN_PACKET Unknown packet
+
+ GNUPG: - Redefined to G10ERR_UNKNOWN_PACKET in gpg.
+
+GPG_ERR_UNKNOWN_VERSION Unknown version in packet
+
+ Used by GnuPG 2.1 to identify valid OpenPGP packets with an
+ unknown version.
+
+GPG_ERR_PUBKEY_ALGO Invalid public key algorithm
+
+ GNUPG: - Redefined to G10ERR_PUBKEY_ALGO in gpg.
+ - Public key algorithm is not allowed by OpenPGP.
+ GCRYPT: - Public key algorithm is not defined or not available.
+ Note that this is also the case if the algorithm has
+ been disabled.
+ - [version < 1.5] Checking of the RSA secret key failed
+ (consistency check).
+
+GPG_ERR_DIGEST_ALGO Invalid digest algorithm
+
+ GNUPG: - Digest algorithm is not supported.
+ - Redefined to G10ERR_PUBKEY_ALGO in gpg.
+ - Digest algorithm is not allowed by OpenPGP.
+ - Unsupported algorithm given to "--hash=" option of
+ certain Assuan server commands.
+ - Signature creation or verification failed due to
+ an unsupported hash algorithm.
+ GCRYPT: - Digest key algorithm is not defined or not available.
+ Note that this is also the case if the algorithm has
+ been disabled.
+ - Unsupported digest algorithm in a selftest.
+ - Invalid digest algorithm used in FIPS mode. Note that
+ in enforced-FIPS mode there is no such error return.
+ - Message digested or HMAC computation finished with no
+ message algorithm enabled for the hash context.
+ - Bad digest algorithm given to public key function.
+
+GPG_ERR_BAD_PUBKEY Bad public key
+
+ GNUPG: - Redefined to G10ERR_BAD_PUBKEY in gpg.
+ - Missing public or domain parameter in an s-expression.
+ If the curve name is mssing GPG_ERR_INV_CURVE may be
+ used as well.
+
+GPG_ERR_BAD_SECKEY Bad secret key
+
+ GNUPG: - Invalid format of a S-expression encoded private key in
+ gpg-agent.
+ - Missing secret parameter in an s-expression.
+ - A protected or shadowed private key was passed to the
+ OpenPGP card application for storing it on the card.
+ - A private key passed to the OpenPGP card application does
+ not match the requirements of the card or misses required
+ parameters.
+ - Gpg'agents import key command is not able to convert
+ the key to the internal format.
+ GCRYPT: - Checking the secret key failed (consistency check).
+
+
+GPG_ERR_BAD_SIGNATURE Bad signature
+
+ GNUPG: - Redefined to G10ERR_BAD_SIGN in gpg.
+ - The MDC check of an OpenPGP encrypted message failed.
+ - A OpenPGP key signature did not verify.
+ - A signature with a key flagged as "never trust" was made.
+ GCRYPT: - A public key signature did not verify.
+
+GPG_ERR_NO_PUBKEY No public key
+
+ GNUPG: - Redefined to G10ERR_NO_PUBKEY in gpg.
+ - A key was requested from an OpenPGP card but the key is
+ not stored on the card.
+ - The public key could not be retrieved from a corresponding
+ certificate on a card (command READKEY in scd).
+ - A requested certificate was not found or an unspecified
+ error occurred while selecting a X.509 certificate in
+ gpgsm.
+ - The specified certificate or key was not found. This
+ does not necessary mean that the certifciate is not
+ available but the specification method may not be usable
+ for the given certificate. May also happen for
+ certificates somewhere in the chain while validaiting a
+ certificate chain.
+ - The requested encryption certificate was not found.
+ - A certificate specified in a CMS message is not
+ available and thus the signature could not be verified
+ or details of the certificate be shown.
+ GPA: - No key was given for encryption.
+ - The selected encryption protocol is not available.
+
+GPG_ERR_CHECKSUM Checksum error
+
+ GNUPG: - The checksum of an unprotected OpenPGP secret key packet
+ is wrong.
+ GCRYPT: - Decryption in AESWRAP mode does not match the expected IV.
+ [more to come]
+
+GPG_ERR_BAD_PASSPHRASE Bad passphrase
+
+ GNUPG: - The entered passphrase does not verify
+
+GPG_ERR_CIPHER_ALGO Invalid cipher algorithm
+
+GPG_ERR_KEYRING_OPEN Cannot open keyring
+
+GPG_ERR_INV_PACKET Invalid packet
+
+GPG_ERR_INV_ARMOR Invalid armor
+
+GPG_ERR_NO_USER_ID No user ID
+
+GPG_ERR_NO_SECKEY No secret key
+
+ NTBTLS: - No private key or pre-shared key available.
+
+GPG_ERR_WRONG_SECKEY Wrong secret key used
+
+GPG_ERR_BAD_KEY Bad session key
+
+ GNUPG: - gpg-agent's command IMPORT_KEY or EXPORT_KEY is used
+ without a prior KEYWRAP_KEY command.
+
+ [more to come]
+
+
+GPG_ERR_COMPR_ALGO Unknown compression algorithm
+
+GPG_ERR_NO_PRIME Number is not prime
+
+GPG_ERR_NO_ENCODING_METHOD Invalid encoding method
+
+GPG_ERR_NO_ENCRYPTION_SCHEME Invalid encryption scheme
+
+GPG_ERR_NO_SIGNATURE_SCHEME Invalid signature scheme
+
+GPG_ERR_INV_ATTR Invalid attribute
+
+
+GPG_ERR_NO_VALUE No value
+
+ GNUPG: - A timestamp value is expect but there is none.
+ KSBA: - A timestamp value is expect but there is none.
+ - A certificate is missing a required property.
+ - A CMS object is missing a required property.
+ - Converting a Distinguised Name to an RFC2253 string failed.
+
+
+GPG_ERR_NOT_FOUND Not found
+
+ A search operation did not return a matching value.
+
+
+GPG_ERR_VALUE_NOT_FOUND Value not found
+
+ GNUPG: - A keyblock or a cert object was requested but not
+ found. This might indicate an internal error here.
+
+
+GPG_ERR_SYNTAX Syntax error
+
+GPG_ERR_BAD_MPI Bad MPI value
+
+GPG_ERR_INV_PASSPHRASE Invalid passphrase
+
+ GNUPG: - Required constraints of the passphrase are not met.
+
+GPG_ERR_SIG_CLASS Invalid signature class
+
+GPG_ERR_RESOURCE_LIMIT Resources exhausted
+
+GPG_ERR_INV_KEYRING Invalid keyring
+
+GPG_ERR_TRUSTDB Trust DB error
+
+
+GPG_ERR_BAD_CERT Bad certificate
+
+ NTBTLS: - No subject found in the certifciate.
+
+
+GPG_ERR_INV_USER_ID Invalid user ID
+
+ GNUPG: - Used to indicate a bad specification of a user id.
+ [more to come]
+
+
+GPG_ERR_UNEXPECTED Unexpected error
+
+GPG_ERR_TIME_CONFLICT Time conflict
+
+GPG_ERR_KEYSERVER Keyserver error
+
+
+GPG_ERR_WRONG_PUBKEY_ALGO Wrong public key algorithm
+
+ GNUPG: - The algorithm is not expected. For example a DSA
+ algorithm is used where a non-DSA algorithm is expected
+ or vice versa. May indicate an internal error.
+ NTBTLS: - Public key type mismatch. The peer presented a
+ different key type than requested.
+
+
+GPG_ERR_TRIBUTE_TO_D_A Tribute to D. A.
+
+GPG_ERR_WEAK_KEY Weak encryption key
+
+GPG_ERR_INV_KEYLEN Invalid key length
+
+GPG_ERR_INV_ARG Invalid argument
+
+ GCRYPT: - Unsupported length of input data in encrypt or decrypt
+ cipher functions. For example not matching the block
+ lengths of the algorithm.
+ - Incompatible args given; e.g. two or none if exactly one
+ is required.
+ [more to come]
+
+
+GPG_ERR_BAD_URI Syntax error in URI
+
+GPG_ERR_INV_URI Invalid URI
+
+GPG_ERR_NETWORK Network error
+
+GPG_ERR_UNKNOWN_HOST Unknown host
+
+ Used instead of the non-portable EHOSTNOTFOUND which is
+ returned by some systems as a mapping of h_errno's
+ HOST_NOT_FOUND
+
+
+GPG_ERR_SELFTEST_FAILED Selftest failed
+
+GPG_ERR_NOT_ENCRYPTED Data not encrypted
+
+GPG_ERR_NOT_PROCESSED Data not processed
+
+GPG_ERR_UNUSABLE_PUBKEY Unusable public key
+
+GPG_ERR_UNUSABLE_SECKEY Unusable secret key
+
+GPG_ERR_INV_VALUE Invalid value
+
+ NTBTLS: - A DH parameter is out of range
+
+
+GPG_ERR_BAD_CERT_CHAIN Bad certificate chain
+
+GPG_ERR_MISSING_CERT Missing certificate
+
+ NTBTLS: - The server needs to send a certifciate but none has been
+ set. See also GPG_ERR_MISSING_ISSUER_CERT and
+ GPG_ERR_MISSING_CLIENT_CERT.
+
+
+
+GPG_ERR_NO_DATA No data
+
+GPG_ERR_BUG Bug
+
+GPG_ERR_NOT_SUPPORTED Not supported
+
+ Used if a feature is currently not supported but may be
+ enabled for example using a program option. Commonly used if
+ a feature has been disabled by an administrator. See also
+ GPG_ERR_NOT_ENABLED. Sometimes also used for features which
+ are not yet supported.
+
+
+GPG_ERR_INV_OP Invalid operation code
+
+GPG_ERR_TIMEOUT Timeout
+
+ Some function or network access timed out.
+
+GPG_ERR_INTERNAL Internal error
+
+GPG_ERR_EOF_GCRYPT EOF (gcrypt)
+
+GPG_ERR_INV_OBJ Invalid object
+
+GPG_ERR_TOO_SHORT Provided object is too short
+
+GPG_ERR_TOO_LARGE Provided object is too large
+
+GPG_ERR_NO_OBJ Missing item in object
+
+GPG_ERR_NOT_IMPLEMENTED Not implemented
+
+ NTBTLS: - The requested feature is not implemented.
+
+GPG_ERR_CONFLICT Conflicting use
+
+ NTBTLS: - Function has already been called and may not be called
+ again at this protocol state.
+ GNUPG: - Returned by g13 when creating a new container on a device
+ which seems to be in use.
+
+
+GPG_ERR_INV_CIPHER_MODE Invalid cipher mode
+
+GPG_ERR_INV_FLAG Invalid flag
+
+ GPGME: Used to indicate an invalid combination of flags.
+
+
+GPG_ERR_INV_HANDLE Invalid handle
+
+GPG_ERR_TRUNCATED Result truncated
+
+GPG_ERR_INCOMPLETE_LINE Incomplete line
+
+GPG_ERR_INV_RESPONSE Invalid response
+
+GPG_ERR_NO_AGENT No agent running
+
+GPG_ERR_AGENT agent error
+
+GPG_ERR_INV_DATA Invalid data
+
+ GNUPG: - Used in app-openpgp.c for a badly formatted request.
+ GCRYPT: - No passphrase given for gcry_kdf_derive.
+ - An opaque MPI is given to a public key function but not
+ expected.
+
+GPG_ERR_ASSUAN_SERVER_FAULT Unspecific Assuan server fault
+
+GPG_ERR_ASSUAN General Assuan error
+
+ GNUPG: - Used by Assuan command handler if they fail to do basic
+ things like an es_fdopen or es_fopencookie.
+
+
+GPG_ERR_INV_SESSION_KEY Invalid session key
+
+GPG_ERR_INV_SEXP Invalid S-expression
+
+GPG_ERR_UNSUPPORTED_ALGORITHM Unsupported algorithm
+
+GPG_ERR_NO_PIN_ENTRY No pinentry
+
+GPG_ERR_PIN_ENTRY pinentry error
+
+GPG_ERR_BAD_PIN Bad PIN
+
+GPG_ERR_INV_NAME Invalid name
+
+ GNUPG: - Formerly used in GPGSM to indicate an error in
+ the specification of a user id. Later replaced by
+ GPG_ERR_INV_USER_ID.
+ - In G13 to indicate a bad file name (e.g. one with
+ an embedded Nul byte when given as escaped string.
+ - In SCDAEMON for an unknown attribute name.
+
+ Also used for URLs which have non-acceptable characters for the
+ specific application.
+
+ [more to come]
+
+GPG_ERR_BAD_DATA Bad data
+
+GPG_ERR_INV_PARAMETER Invalid parameter
+
+ GNUPG: - Returned if gpg-agent sends a new generated key with
+ unknown parameter names.
+ - Invalid parameter in the parameter file for key
+ generation by gpgsm.
+
+GPG_ERR_WRONG_CARD Wrong card
+
+GPG_ERR_NO_DIRMNGR No dirmngr
+
+GPG_ERR_DIRMNGR dirmngr error
+
+GPG_ERR_CERT_REVOKED Certificate revoked
+
+GPG_ERR_NO_CRL_KNOWN No CRL known
+
+GPG_ERR_CRL_TOO_OLD CRL too old
+
+GPG_ERR_LINE_TOO_LONG Line too long
+
+GPG_ERR_NOT_TRUSTED Not trusted
+
+GPG_ERR_CANCELED Operation cancelled
+
+GPG_ERR_BAD_CA_CERT Bad CA certificate
+
+GPG_ERR_CERT_EXPIRED Certificate expired
+
+GPG_ERR_CERT_TOO_YOUNG Certificate too young
+
+GPG_ERR_UNSUPPORTED_CERT Unsupported certificate
+
+GPG_ERR_UNKNOWN_SEXP Unknown S-expression
+
+GPG_ERR_UNSUPPORTED_PROTECTION Unsupported protection
+
+GPG_ERR_CORRUPTED_PROTECTION Corrupted protection
+
+GPG_ERR_AMBIGUOUS_NAME Ambiguous name
+
+GPG_ERR_CARD Card error
+
+GPG_ERR_CARD_RESET Card reset required
+
+GPG_ERR_CARD_REMOVED Card removed
+
+GPG_ERR_INV_CARD Invalid card
+
+GPG_ERR_CARD_NOT_PRESENT Card not present
+
+GPG_ERR_NO_PKCS15_APP No PKCS15 application
+
+GPG_ERR_NOT_CONFIRMED Not confirmed
+
+GPG_ERR_CONFIGURATION Configuration error
+
+GPG_ERR_NO_POLICY_MATCH No policy match
+
+GPG_ERR_INV_INDEX Invalid index
+
+GPG_ERR_INV_ID Invalid ID
+
+GPG_ERR_NO_SCDAEMON No SmartCard daemon
+
+GPG_ERR_SCDAEMON SmartCard daemon error
+
+GPG_ERR_UNSUPPORTED_PROTOCOL Unsupported protocol
+
+ GPG: - An unsupported keyserver protocol.
+ GPG_AGENT: - Invalid shadow_info protocol (not "t1-v1")
+ LIBKSBA: - Unknown OID of the OCSP response bytes
+ GPGME: - GPGME_PROTOCOL_xxx not supported.
+ NTBTLS: - Handshake protocol version not supported.
+
+GPG_ERR_BAD_PIN_METHOD Bad PIN method
+
+GPG_ERR_CARD_NOT_INITIALIZED Card not initialized
+
+ SCDAEMON: - A card function is called but the card has not yet
+ been initialized. This may be due to a conflict with
+ another card using connection or due to a bug.
+
+GPG_ERR_UNSUPPORTED_OPERATION Unsupported operation
+
+GPG_ERR_WRONG_KEY_USAGE Wrong key usage
+
+ GNUPG: - Key usage not possible with selected algorithm.
+
+GPG_ERR_NOTHING_FOUND Nothing found
+
+ Indicates that the operation was not possible because nothing has
+ been found. For example an update request for non existent data.
+
+GPG_ERR_WRONG_BLOB_TYPE Wrong blob type
+
+GPG_ERR_MISSING_VALUE Missing value
+
+ GNUPG: - Not enough parameters for a secret key send to gpg-agent.
+
+ GCRYPT: - A required parameter has not been given.
+
+
+GPG_ERR_HARDWARE Hardware problem
+
+GPG_ERR_PIN_BLOCKED PIN blocked
+
+GPG_ERR_USE_CONDITIONS Conditions of use not satisfied
+
+GPG_ERR_PIN_NOT_SYNCED PINs are not synced
+
+GPG_ERR_INV_CRL Invalid CRL
+
+GPG_ERR_BAD_BER BER error
+
+GPG_ERR_INV_BER Invalid BER
+
+GPG_ERR_ELEMENT_NOT_FOUND Element not found
+
+GPG_ERR_IDENTIFIER_NOT_FOUND Identifier not found
+
+GPG_ERR_INV_TAG Invalid tag
+
+GPG_ERR_INV_LENGTH Invalid length
+
+ GCRYPT: - Bad block length for certain cipher algorithms and
+ modes.
+ - Bad length of input data; e.g. not a multiple of the
+ block length.
+ - A length does not match the size of the digest
+ algorithm.
+ - Length of signature or public key is not as expected
+ (e.g. in EdDSA).
+ [more to come]
+ GNUPG: - Invalid hash length for a pubkey
+ [more to come]
+
+GPG_ERR_INV_KEYINFO Invalid key info
+
+ KSBA: - Returned if the ASN.1 Keyinfo structure is not valid
+
+GPG_ERR_UNEXPECTED_TAG Unexpected tag
+
+GPG_ERR_NOT_DER_ENCODED Not DER encoded
+
+GPG_ERR_NO_CMS_OBJ No CMS object
+
+GPG_ERR_INV_CMS_OBJ Invalid CMS object
+
+GPG_ERR_UNKNOWN_CMS_OBJ Unknown CMS object
+
+GPG_ERR_UNSUPPORTED_CMS_OBJ Unsupported CMS object
+
+GPG_ERR_UNSUPPORTED_ENCODING Unsupported encoding
+
+ GNUPG: - Returned by Dirmngr if a keyserver returns a HTML document.
+
+
+GPG_ERR_UNSUPPORTED_CMS_VERSION Unsupported CMS version
+
+
+GPG_ERR_UNKNOWN_ALGORITHM Unknown algorithm
+
+ GCRYPT: gcry_kdf_proc for an unknown kdf algorithm
+
+GPG_ERR_INV_ENGINE Invalid crypto engine
+
+ GPGME: Several uses use cases. For example:
+ - Unexpected format of a status line.
+
+GPG_ERR_PUBKEY_NOT_TRUSTED Public key not trusted
+GPG_ERR_DECRYPT_FAILED Decryption failed
+GPG_ERR_KEY_EXPIRED Key expired
+GPG_ERR_SIG_EXPIRED Signature expired
+GPG_ERR_ENCODING_PROBLEM Encoding problem
+
+GPG_ERR_INV_STATE Invalid state
+
+ The state (of a protocol) is not possible or not defined at all.
+
+ NTBTLS: - Data received in an unexpected state.
+ - A function is called while not being in the right state.
+
+
+GPG_ERR_DUP_VALUE Duplicated value
+
+GPG_ERR_MISSING_ACTION Missing action
+
+ GNUPG: - In G13 the server command "MOUNT" is used without prior
+ use of the command "OPEN".
+
+ others: - The libassuan ce-server test program uses this to
+ indicate that the client did not connect to the server
+ as requested.
+
+GPG_ERR_MODULE_NOT_FOUND ASN.1 module not found
+
+GPG_ERR_INV_OID_STRING Invalid OID string
+
+GPG_ERR_INV_TIME Invalid time
+
+GPG_ERR_INV_CRL_OBJ Invalid CRL object
+
+GPG_ERR_UNSUPPORTED_CRL_VERSION Unsupported CRL version
+
+
+GPG_ERR_INV_CERT_OBJ Invalid certificate object
+
+ GPGME: - A bad certificate (gpgme_key_t) has been passed to a
+ function. For example it might be incomplete due to a
+ missing fingerprint.
+
+
+GPG_ERR_UNKNOWN_NAME Unknown name
+
+ Used by GPG to indicate an unknown ECC curve name (may also
+ indicate missing ECC support). It is also used to indicate an
+ unsuported parameter name in functions which take a name and
+ value to update state. Note that GPG_ERR_UNKNOWN_CURVE is
+ used instead by newer code.
+
+GPG_ERR_LOCALE_PROBLEM A locale function failed
+
+GPG_ERR_NOT_LOCKED Not locked
+
+GPG_ERR_PROTOCOL_VIOLATION Protocol violation
+
+ GNUPG: - Used for invalid HTTP responses.
+
+
+GPG_ERR_INV_MAC Invalid MAC
+
+ The length, algo, or other properties of a MAC are not met.
+ See also GPG_ERR_BAD_MAC.
+
+
+GPG_ERR_INV_REQUEST Invalid request
+
+GPG_ERR_UNKNOWN_EXTN Unknown extension
+
+GPG_ERR_UNKNOWN_CRIT_EXTN Unknown critical extension
+
+GPG_ERR_LOCKED Locked
+
+GPG_ERR_UNKNOWN_OPTION Unknown option
+
+GPG_ERR_UNKNOWN_COMMAND Unknown command
+
+GPG_ERR_NOT_OPERATIONAL Not operational
+
+GPG_ERR_NO_PASSPHRASE No passphrase given
+
+GPG_ERR_NO_PIN No PIN given
+
+GPG_ERR_NOT_ENABLED Not enabled
+
+ Similar to GPG_ERR_NOT_SUPPORTED. In general this error is
+ used for disabled features which can be expected to be enabled
+ by the user.
+
+
+GPG_ERR_NO_ENGINE No crypto engine
+
+GPG_ERR_MISSING_KEY Missing key
+
+ GNUPG: - gpg-agent returns this error on import or export if a key
+ wrapping transport key has not been specified.
+ - It is used when the name "Key" is not found while looking
+ up name value pairs of the extended private key format
+
+ GCRYPT: - A key has not been set when calling a symmetric
+ encryption function.
+
+GPG_ERR_TOO_MANY Too many objects
+
+ GPG: - Dirmngr KS_GET called with too many pattern so that the
+ maximum Assuan line length would overflow.
+ - gpgsm's command export --secret called with too man keys.
+ GPGME: - To many patterns in gpgme-tools's KEYLIST command.
+
+GPG_ERR_LIMIT_REACHED Limit reached
+
+ A programmed limit has been reached.
+
+ GnuPG: gpgtar: Extract directory can't be created because too
+ many of directories with a similar name are already existing.
+
+GPG_ERR_NOT_INITIALIZED Not initialized
+
+ An operation can't be performed because something has not been
+ initialized. This might be a missing initialization of an entire
+ subsystems or a prerequisite for using a function is not
+ fulfilled.
+
+GPG_ERR_MISSING_ISSUER_CERT Missing issuer certificate
+
+GPG_ERR_NO_KEYSERVER No keyserver available
+
+ No keyserver configured or no keyserver available due to
+ missing support for the requested protocol. Found in Dirmngr.
+
+GPG_ERR_INV_CURVE Invalid elliptic curve
+
+ The curve parameter is missing or the curve is invalid; for
+ example it is not possible to get affine coordinates for the
+ public key.
+
+GPG_ERR_UNKNOWN_CURVE Unknown elliptic curve
+
+ The curve is not known or not supported by the protocol.
+
+
+GPG_ERR_DUP_KEY Duplicated key
+
+ A duplicated key was detected. For example a unique key in a
+ database occurred more than once. Also used if in a protocol
+ an expected key was returned more than once.
+
+GPG_ERR_AMBIGUOUS Ambiguous search
+
+ A search etc returned an ambigious result. This usually means
+ that the search string was not specific enough.
+
+GPG_ERR_NO_CRYPT_CTX No crypto context
+
+ A crypto context was expected but not given. Commonly used by
+ Libgcrypt.
+
+GPG_ERR_WRONG_CRYPT_CTX Wrong crypto context
+
+ The given crypto context does not match the requirements. For
+ example in Libgcrypt a crypto context has private data
+ pertaining to certain algorithms. This error is for example
+ returned if a crypto context initialized for a different
+ algorithm is used.
+
+GPG_ERR_BAD_CRYPT_CTX Bad crypto context
+
+ The is a problem with the crypto context. For example it has
+ not been properly initialized.
+
+GPG_ERR_CRYPT_CTX_CONFLICT Conflict in the crypto context
+
+ Conflicting use of a crypto context. For example if a context
+ is used with objects that don't match the state of the
+ context.
+
+GPG_ERR_BROKEN_PUBKEY Broken public key
+
+ The public key was mathematically not correctly generated.
+ (It would have been nicer if we would have used BAD_PUBKEY for
+ this, but that error code is in long time use to describe for
+ example policy and encoding problems with a key. Using
+ INV_PUBKEY would have been better for these purposes)
+
+GPG_ERR_BROKEN_SECKEY Broken secret key
+
+ The secret key was mathematically not correctly generated.
+
+GPG_ERR_MAC_ALGO
+
+ GCRYPT: - MAC key algorithm is not defined or not available.
+
+
+GPG_ERR_FULLY_CANCELED Operation fully cancelled
+
+GPG_ERR_UNFINISHED Operation not yet finished
+
+GPG_ERR_BUFFER_TOO_SHORT Buffer too short
+
+GPG_ERR_SEXP_INV_LEN_SPEC Invalid length specifier in S-expression
+
+GPG_ERR_SEXP_STRING_TOO_LONG String too long in S-expression
+
+GPG_ERR_SEXP_UNMATCHED_PAREN Unmatched parentheses in S-expression
+
+GPG_ERR_SEXP_NOT_CANONICAL S-expression not canonical
+
+GPG_ERR_SEXP_BAD_CHARACTER Bad character in S-expression
+
+GPG_ERR_SEXP_BAD_QUOTATION Bad quotation in S-expression
+
+GPG_ERR_SEXP_ZERO_PREFIX Zero prefix in S-expression
+
+GPG_ERR_SEXP_NESTED_DH Nested display hints in S-expression
+
+GPG_ERR_SEXP_UNMATCHED_DH Unmatched display hints
+
+GPG_ERR_SEXP_UNEXPECTED_PUNC Unexpected reserved punctuation in S-expression
+
+GPG_ERR_SEXP_BAD_HEX_CHAR Bad hexadecimal character in S-expression
+
+GPG_ERR_SEXP_ODD_HEX_NUMBERS Odd hexadecimal numbers in S-expression
+
+GPG_ERR_SEXP_BAD_OCT_CHAR Bad octal character in S-expression
+
+GPG_ERR_SUBKEYS_EXP_REV All subkeys are expired or revoked
+
+GPG_ERR_DB_CORRUPTED Database is corrupted
+
+GPG_ERR_SERVER_FAILED Server indicated a failure
+
+GPG_ERR_NO_NAME No name
+
+ EAI_NONAME may be mapped to this code.
+
+GPG_ERR_NO_KEY No key
+
+ Some kind of key was not found.
+
+GPG_ERR_LEGACY_KEY Legacy key
+
+ Used by GnuPG to identify version 2 and 3 OpenPGP key packets.
+
+GPG_ERR_REQUEST_TOO_SHORT Request too short
+
+ A received request is too short to continue processing.
+
+GPG_ERR_REQUEST_TOO_LONG Request too long
+
+ A received request is too long to continue processing. This may
+ be due to an internal limitation, a protocol violation, or due to
+ the use of a newer version of a protocol.
+
+GPG_ERR_OBJ_TERM_STATE Object is in termination state
+
+ For cards this is the ISO status word 0x6285 (file is in
+ termination state).
+
+GPG_ERR_NO_CERT_CHAIN No certificate chain
+
+ NTBTLS: - A CA chain has not been set but is required.
+
+GPG_ERR_CERT_TOO_LARGE Certificate is too large
+
+ NTBTLS: - A certificate is too large to be used by the protocol.
+
+GPG_ERR_INV_RECORD Invalid record
+
+ NTBTLS: - An invalid record was received
+
+GPG_ERR_BAD_MAC The MAC does not verify
+
+ NTBTLS: - MAC verification of the message failed.
+
+GPG_ERR_UNEXPECTED_MSG Unexpected message
+
+ GNUPG: - An unexpected WKS message was received.
+ NTBTLS: - Unexpected message received.
+
+GPG_ERR_COMPR_FAILED Compression or decompression failed
+
+ NTBTLS: - As the description says.
+
+GPG_ERR_WOULD_WRAP A counter would wrap
+
+ NTBTLS: - Too many messages exchanged
+ Other: - A counter would wrap.
+
+GPG_ERR_FATAL_ALERT Fatal alert message received
+
+ NTBTLS: - Fatal alert message received from the peer.
+
+GPG_ERR_NO_CIPHER No cipher algorithm
+
+ NTBTLS: - Server and client have no algo in common
+
+GPG_ERR_MISSING_CLIENT_CERT Missing client certificate
+
+ NTBTLS: - No certificate received from client.
+
+GPG_ERR_CLOSE_NOTIFY Close notification received
+
+ NTBTLS: - Alert with a close notification received
+
+GPG_ERR_TICKET_EXPIRED Ticket expired
+
+ NTBTLS: - Session ticket has expired.
+
+GPG_ERR_BAD_TICKET Bad ticket
+
+ NTBTLS: - Bad new session ticket message.
+
+GPG_ERR_UNKNOWN_IDENTITY Unknown identity
+
+ NTBTLS: - Unknown PSK identify received
+
+GPG_ERR_BAD_HS_CERT Bad certificate message in handshake
+
+ NTBTLS: - As the description says.
+
+GPG_ERR_BAD_HS_CERT_REQ Bad certificate request message in handshake
+
+ NTBTLS: - As the description says.
+
+GPG_ERR_BAD_HS_CERT_VER Bad certificate verify message in handshake
+
+ NTBTLS: - As the description says.
+
+GPG_ERR_BAD_HS_CHANGE_CIPHER Bad change cipher message in handshake
+
+ NTBTLS: - As the description says.
+
+GPG_ERR_BAD_HS_CLIENT_HELLO Bad client hello message in handshake
+
+ NTBTLS: - As the description says.
+
+GPG_ERR_BAD_HS_SERVER_HELLO Bad server hello message in handshake
+
+ NTBTLS: - As the description says.
+
+GPG_ERR_BAD_HS_SERVER_HELLO_DONE Bad server hello done message in handshake
+
+ NTBTLS: - As the description says.
+
+GPG_ERR_BAD_HS_FINISHED Bad finished message in handshake
+
+ NTBTLS: - As the description says.
+
+GPG_ERR_BAD_HS_SERVER_KEX Bad server key exchange message in handshake
+
+ NTBTLS: - As the description says.
+
+GPG_ERR_BAD_HS_CLIENT_KEX Bad client key exchange message in handshake
+
+ NTBTLS: - As the description says.
+
+
+GPG_ERR_BOGUS_STRING Bogus string
+
+ Used if a protocol sends length prefixed strings which contain a
+ Nul byte and further processing would discard the rest of the
+ string. May also be used if a string contains unexpected and
+ possible dangerous characters (e.g. control characters in a domain
+ name).
+
+GPG_ERR_FORBIDDEN Forbidden
+
+ The use of a features is not allowed due to insufficient rights.
+ Use by gpg-agent as an error codes for restricted commands.
+
+GPG_ERR_KEY_DISABLED Key disabled
+
+ GNUPG: - The key has been disabled by the user.
+
+GPG_ERR_KEY_ON_CARD Not possible with a card based key
+
+ GNUPG: - The gpg-agent returns this if a DELETE_KEY commands is
+ used for a smartcard based key.
+
+GPG_ERR_INV_LOCK_OBJ Invalid lock object
+
+ GPGRT: - The provided lock object is not valid. This indicates an
+ internal problem in libgpg-error or more likely a
+ programming error.
+
+GPG_ERR_TRUE True
+
+ Used to return the boolean value True. Note that GPG_ERR_NO_ERROR
+ (with the value 0) is also often used to indicate the value true.
+
+GPG_ERR_FALSE False
+
+ Used to return the boolean value False.
+
+
+GPG_ERR_ASS_GENERAL General IPC error
+
+GPG_ERR_ASS_ACCEPT_FAILED IPC accept call failed
+
+GPG_ERR_ASS_CONNECT_FAILED IPC connect call failed
+
+GPG_ERR_ASS_INV_RESPONSE Invalid IPC response
+
+GPG_ERR_ASS_INV_VALUE Invalid value passed to IPC
+
+GPG_ERR_ASS_INCOMPLETE_LINE Incomplete line passed to IPC
+
+GPG_ERR_ASS_LINE_TOO_LONG Line passed to IPC too long
+
+GPG_ERR_ASS_NESTED_COMMANDS Nested IPC commands
+
+GPG_ERR_ASS_NO_DATA_CB No data callback in IPC
+
+GPG_ERR_ASS_NO_INQUIRE_CB No inquire callback in IPC
+
+GPG_ERR_ASS_NOT_A_SERVER Not an IPC server
+
+GPG_ERR_ASS_NOT_A_CLIENT Not an IPC client
+
+GPG_ERR_ASS_SERVER_START Problem starting IPC server
+
+GPG_ERR_ASS_READ_ERROR IPC read error
+
+GPG_ERR_ASS_WRITE_ERROR IPC write error
+
+GPG_ERR_ASS_TOO_MUCH_DATA Too much data for IPC layer
+
+GPG_ERR_ASS_UNEXPECTED_CMD Unexpected IPC command
+
+GPG_ERR_ASS_UNKNOWN_CMD Unknown IPC command
+
+GPG_ERR_ASS_SYNTAX IPC syntax error
+
+GPG_ERR_ASS_CANCELED IPC call has been cancelled
+
+GPG_ERR_ASS_NO_INPUT No input source for IPC
+
+GPG_ERR_ASS_NO_OUTPUT No output source for IPC
+
+GPG_ERR_ASS_PARAMETER IPC parameter error
+
+GPG_ERR_ASS_UNKNOWN_INQUIRE Unknown IPC inquire
+
+GPG_ERR_ENGINE_TOO_OLD Crypto engine too old
+
+GPG_ERR_WINDOW_TOO_SMALL Screen or window too small
+
+ Pinentry: - The size of the screen is too small.
+
+GPG_ERR_WINDOW_TOO_LARGE Screen or window too large
+
+GPG_ERR_MISSING_ENVVAR Required environment variable not set
+
+ Pinentry: - The size of the screen can't be determined.
+
+GPG_ERR_USER_ID_EXISTS User ID already exists
+
+ GNUPG: - Existing user ID in --quick-gen-key.
+
+GPG_ERR_NAME_EXISTS Name already exists
+
+GPG_ERR_DUP_NAME Duplicated name
+
+GPG_ERR_TOO_YOUNG Objects is too young
+
+ For example used if a file is younger than expected.
+
+GPG_ERR_TOO_OLD Objects is too old
+
+ Used if an object is too old to be used. This is a more generic
+ code than GPG_ERR_ENGINE_TOO_OLD or GPG_ERR_CRL_TOO_OLD.
+
+GPG_ERR_UNKNOWN_FLAG Unknown flag
+
+ The flag is not known.
+
+ GNUPG: - The flag part of the string given to the
+ option --default-new-key-algo value is not known.
+
+GPG_ERR_INV_ORDER Invalid execution order
+
+ GNUPG: - In Dirmngr used for the libdns error code DNS_EORDER.
+
+GPG_ERR_ALREADY_FETCHED Already fetched
+
+ GNUPG: - In Dirmngr used for the libdns error code DNS_EFETCHED.
+
+GPG_ERR_TRY_LATER Try again later
+
+ This indicates that a server asked to try again later; thus it is
+ different from EAGAIN which is used by the local system. This
+ code is for example used instead of h_error's TRY_AGAIN.
+
+GPG_ERR_WRONG_NAME Wrong name
+
+ NTBTLS: - Hostname does not match the certificate
+
+GPG_ERR_SYSTEM_BUG System bug detected
+
+ The underlying operating system misbehaved. For example it wrote
+ more to a buffer than the told maximum size.
+
+
+GPG_ERR_DNS_UNKNOWN Unknown DNS error
+
+ Used by Dirmngr for DNS errors from libdns (DNS_EUNKNOWN);
+
+GPG_ERR_DNS_SECTION Invalid DNS section
+
+ Used by Dirmngr for DNS errors from libdns (DNS_ESECTION);
+
+GPG_ERR_DNS_ADDRESS Invalid textual address form
+
+ Used by Dirmngr for DNS errors from libdns (DNS_EADDRESS);
+
+GPG_ERR_DNS_NO_QUERY Missing DNS query packet
+
+ Used by Dirmngr for DNS errors from libdns (DNS_ENOQUERY);
+
+GPG_ERR_DNS_NO_ANSWER Missing DNS answer packet
+
+ Used by Dirmngr for DNS errors from libdns (DNS_ENOANSWER);
+
+GPG_ERR_DNS_CLOSED Connection closed in DNS
+
+ Used by Dirmngr for DNS errors from libdns (DNS_ECONNFIN);
+
+GPG_ERR_DNS_VERIFY Verification failed in DNS
+
+ Used by Dirmngr for DNS errors from libdns (DNS_EVERIFY);
+
+GPG_ERR_DNS_TIMEOUT DNS Timeout
+
+ A DNS query timed out
+
+GPG_ERR_LDAP_GENERAL LDAP General error
+
+ Catch all error for LDAP. Use when an error code could not be
+ mapped to a gpg-error code.
+
+GPG_ERR_LDAP_ATTR_GENERAL LDAP General attribute error
+GPG_ERR_LDAP_NAME_GENERAL LDAP General name error
+GPG_ERR_LDAP_SECURITY_GENERAL LDAP General security error
+GPG_ERR_LDAP_SERVICE_GENERAL LDAP General service error
+GPG_ERR_LDAP_UPDATE_GENERAL LDAP General update error
+GPG_ERR_LDAP_E_GENERAL LDAP Experimental error code
+GPG_ERR_LDAP_X_GENERAL LDAP Private error code
+GPG_ERR_LDAP_OTHER_GENERAL LDAP Other general error
+
+ The 8 GPG_ERR_LDAP_*_GENERAL error codes may be used to map ranges
+ of LDAP errors to one specific code. OpenLDAP uses LDAP_xxx_RANGE(n)
+ macros for that mapping. "Other general error" may be used similar
+ to "General error" for mapping of ranges. Here are macros from
+ OpenLDAP for reference:
+
+ #define LDAP_ATTR_ERROR(n) LDAP_RANGE((n),0x10,0x15) /* 16-21 */
+ #define LDAP_NAME_ERROR(n) LDAP_RANGE((n),0x20,0x24) /* 32-34,36 */
+ #define LDAP_SECURITY_ERROR(n) LDAP_RANGE((n),0x2F,0x32) /* 47-50 */
+ #define LDAP_SERVICE_ERROR(n) LDAP_RANGE((n),0x33,0x36) /* 51-54 */
+ #define LDAP_UPDATE_ERROR(n) LDAP_RANGE((n),0x40,0x47) /* 64-69,71 */
+ #define LDAP_E_ERROR(n) LDAP_RANGE((n),0x1000,0x3FFF)
+ #define LDAP_X_ERROR(n) LDAP_RANGE((n),0x4000,0xFFFF)
+
+## end of errorref.txt
diff --git a/doc/gpgrt.texi b/doc/gpgrt.texi
new file mode 100644
index 0000000..857973a
--- /dev/null
+++ b/doc/gpgrt.texi
@@ -0,0 +1,435 @@
+\input texinfo @c -*- Texinfo -*-
+@c %**start of header
+@setfilename gpgrt.info
+@include version.texi
+@settitle The Libgpg-error Reference Manual
+@c Unify some of the indices.
+@syncodeindex tp fn
+@syncodeindex pg fn
+@c %**end of header
+@copying
+This manual is for Libgpg-error (version @value{VERSION},
+@value{UPDATED}), which is a library for code used by all GnuPG
+related packages.
+
+@noindent
+Copyright @copyright{} 2014 g10 Code GmbH
+
+@quotation
+Permission is granted to copy, distribute and/or modify this document
+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. The text of the license can be found in the
+section entitled ``GNU General Public License''.
+@end quotation
+@end copying
+
+@dircategory Libraries
+@direntry
+* libgpg-error: (gnupg). Error codes and common code for GnuPG.
+@end direntry
+
+@c A couple of macros with no effect on texinfo
+@c but used by the yat2m processor.
+@macro manpage {a}
+@end macro
+@macro mansect {a}
+@end macro
+@macro manpause
+@end macro
+@macro mancont
+@end macro
+
+@c
+@c Printing stuff taken from gcc.
+@c
+@macro gnupgtabopt{body}
+@code{\body\}
+@end macro
+
+
+@c
+@c Titlepage
+@c
+@setchapternewpage odd
+@titlepage
+@title The Libgpg-error Reference Manual
+@subtitle Version @value{VERSION}
+@subtitle @value{UPDATED}
+@author Werner Koch (@email{wk@@gnupg.org})
+
+@page
+@vskip 0pt plus 1filll
+@insertcopying
+@end titlepage
+
+@ifnothtml
+@summarycontents
+@contents
+@page
+@end ifnothtml
+
+
+@ifnottex
+@node Top
+@top The Libgpg-error Library
+@insertcopying
+@end ifnottex
+
+
+@menu
+* Introduction:: What is Libgpg-error.
+* Preparation:: What you should do before using the library.
+* Generalities:: General library functions and data types.
+* Tools:: Utility tools
+
+Appendices
+
+* Library Copying:: The GNU Lesser General Public License
+ says how you can copy and share Libgpg-error.
+* Copying:: The GNU General Public License says how you
+ can copy and share some parts of Libgpg-error.
+
+Indices
+
+@c * Figures and Tables:: Index of figures and tables.
+* Concept Index:: Index of concepts and programs.
+* Function and Data Index:: Index of functions, variables and data types.
+
+@end menu
+
+@ifhtml
+@page
+@summarycontents
+@contents
+@end ifhtml
+
+
+@c **********************************************************
+@c ******************* Introduction ***********************
+@c **********************************************************
+@node Introduction
+@chapter Introduction
+
+Libgpg-error is a library to provide error codes for GnuPG and relates
+software as well as some other general purpose functions. It is
+planned to eventually rename this library to ``gpgrt'' (for GnuPG
+RunTime).
+
+@menu
+* Getting Started:: How to use this manual.
+* Features:: A glance at Libgpg-error’s features.
+* Overview:: Overview about the library.
+@end menu
+
+@node Getting Started
+@section Getting Started
+
+This manual documents the Libgpg-error library application programming
+interface (API). The goal is to that all functions and data types
+provided by the library are explained. However, for now this is only
+a stub and not very useful.
+
+
+@node Features
+@section Features
+
+TBD
+
+@node Overview
+@section Overview
+
+@noindent
+The Libgpg-error library is fully thread-safe, where it makes
+sense to be thread-safe.
+
+TBD
+
+@c **********************************************************
+@c ******************* Preparation ************************
+@c **********************************************************
+@node Preparation
+@chapter Preparation
+
+To use Libgpg-error, you have to perform some changes to your
+sources and the build system. The necessary changes are small and
+explained in the following sections. At the end of this chapter, it
+is described how the library is initialized, and how the requirements
+of the library are verified.
+
+@menu
+* Header:: What header file you need to include.
+* Building sources:: How to build sources using the library.
+* Building sources using Automake:: How to build sources with the help of Automake.
+* Initializing the library:: How to initialize the library.
+* Multi-Threading:: How Libgpg-error can be used in a MT environment.
+@end menu
+
+
+@node Header
+@section Header
+
+All interfaces (data types and functions) of the library are defined
+in the header file @file{libgpg-error.h}. You must include this in all source
+files using the library, either directly or through some other header
+file, like this:
+
+@example
+#include <libgpg-error.h>
+@end example
+
+Note well that the header file is platform specific and may only be
+used on the platform for which it has been build.
+
+The name space of Libgpg-error is @code{gpg_*} and @code{gpgrt*}
+for function and type names and @code{GPG_*} and @code{GPGRT_*}
+for other symbols. In addition the same name prefixes with one
+prepended underscore are reserved for internal use and should never be
+used by an application.
+
+@noindent
+Certain parts of gpg-error.h may be included by defining these macros:
+
+@table @code
+@item GPG_ERR_ENABLE_GETTEXT_MACROS
+Define to provide macros to map the internal gettext API to standard
+names. This has only an effect on Windows platforms.
+
+@item GPGRT_ENABLE_ES_MACROS
+Define to provide "es_" macros for the estream functions.
+@end table
+
+@node Building sources
+@section Building sources
+
+If you want to compile a source file including the `gpg-error.h' header
+file, you must make sure that the compiler can find it in the
+directory hierarchy. This is accomplished by adding the path to the
+directory in which the header file is located to the compilers include
+file search path (via the @option{-I} option).
+
+However, the path to the include file is determined at the time the
+source is configured. To solve this problem, Libgpg-error ships with a small
+helper program @command{gpg-error-config} that knows the path to the
+include file and other configuration options. The options that need
+to be added to the compiler invocation at compile time are output by
+the @option{--cflags} option to @command{gpg-error-config}. The following
+example shows how it can be used at the command line:
+
+@example
+gcc -c foo.c $(gpg-error-config --cflags)
+@end example
+
+Adding the output of @samp{gpg-error-config --cflags} to the
+compiler’s command line will ensure that the compiler can find the
+Libgpg-error header file.
+
+A similar problem occurs when linking the program with the library.
+Again, the compiler has to find the library files. For this to work,
+the path to the library files has to be added to the library search
+path (via the @option{-L} option). For this, the option
+@option{--libs} to @command{gpg-error-config} can be used. The
+example shows how to link @file{foo.o} with the Libgpg-error library
+to a program @command{foo}.
+
+@example
+gcc -o foo foo.o $(gpg-error-config --libs)
+@end example
+
+Of course you can also combine both examples to a single command by
+specifying both options to @command{gpg-error-config}:
+
+@example
+gcc -o foo foo.c $(gpg-error-config --cflags --libs)
+@end example
+
+@node Building sources using Automake
+@section Building sources using Automake
+
+It is much easier if you use GNU Automake instead of writing your own
+Makefiles. If you do that, you do not have to worry about finding and
+invoking the @command{gpg-error-config} script at all. Libgpg-error
+provides an extension to Automake that does all the work for you.
+
+@c A simple macro for optional variables.
+@macro ovar{varname}
+@r{[}@var{\varname\}@r{]}
+@end macro
+@defmac AM_PATH_GPG_ERROR (@ovar{minimum-version}, @ovar{action-if-found}, @ovar{action-if-not-found})
+Check whether Libgpg-error (at least version @var{minimum-version}, if
+given) exists on the host system. If it is found, execute
+@var{action-if-found}, otherwise do @var{action-if-not-found}, if
+given.
+
+Additionally, the function defines @code{GPG_ERROR_CFLAGS} to the
+flags needed for compilation of the program to find the
+@file{gpg-error.h} header file, and @code{GPG_ERROR_LIBS} to the
+linker flags needed to link the program to the Libgpg-error library. If
+the used helper script does not match the target type you are building
+for a warning is printed and the string @code{libgpg-error} is
+appended to the variable @code{gpg_config_script_warn}.
+
+This macro searches for @command{gpg-error-config} along the PATH. If
+you are cross-compiling, it is useful to set the environment variable
+@code{SYSROOT} to the top directory of your target. The macro will
+then first look for the helper program in the @file{bin} directory
+below that top directory. An absolute directory name must be used for
+@code{SYSROOT}. Finally, if the configure command line option
+@code{--with-libgpg-error-prefix} is used, only its value is used for
+the top directory below which the helper script is expected.
+
+@end defmac
+
+You can use the defined Autoconf variables like this in your
+@file{Makefile.am}:
+
+@example
+AM_CPPFLAGS = $(GPG_ERROR_CFLAGS)
+LDADD = $(GPG_ERROR_LIBS)
+@end example
+
+@node Initializing the library
+@section Initializing the library
+
+Before the library can be used, it should initialize itself. This is
+achieved by invoking the function @code{gpgrt_check_version} described
+below.
+
+Also, it is often desirable to check that the version of
+Libgpg-error used is indeed one which fits all requirements.
+Even with binary compatibility, new features may have been introduced,
+but due to problem with the dynamic linker an old version may actually
+be used. So you may want to check that the version is okay right
+after program startup.
+
+@deftypefun {const char *} gpgrt_check_version (const char *@var{req_version})
+
+The function @code{gpgrt_check_version} initializes some subsystems used
+by Libgpg-error and must be invoked before any other function in the
+library.
+@xref{Multi-Threading}.
+
+Furthermore, this function returns the version number of the library.
+It can also verify that the version number is higher than a certain
+required version number @var{req_version}, if this value is not a null
+pointer.
+@end deftypefun
+
+
+@node Multi-Threading
+@section Multi-Threading
+
+TBD.
+
+@c **********************************************************
+@c ******************* General ****************************
+@c **********************************************************
+@node Generalities
+@chapter Generalities
+
+TBD. (Description of the error function may be taken from Libgcrypt.)
+
+
+
+@c **********************************************************
+@c ********************* Tools ****************************
+@c **********************************************************
+@node Tools
+@chapter Tools
+
+@menu
+* gpg-error-config:: Print required compiler flags
+@end menu
+
+@c The original version of this man page has been written for Debian and was
+@c contributed to libgpg-error by Daniel Kahn Gillmor <[email protected]>.
+@manpage gpg-error-config.1
+@node gpg-error-config
+@section Print required compiler flags
+@ifset manverb
+.B gpg-error-config
+\- Script to get information about the installed version of libgpg-error
+@end ifset
+
+@mansect synopsis
+@ifset manverb
+.B gpg-error-config
+.RI [ options ]
+@end ifset
+
+@mansect description
+@command{gpg-error-config} is a tool that is used to configure to
+determine the compiler and linker flags that should be used to compile
+and link programs that use Libgpg-error. It is also used
+internally to the @code{.m4} macros for GNU autoconf that are included
+with Libgpg-error.
+
+@mansect options
+@noindent
+@command{gpg-error-config} accepts the following options:
+
+@table @gnupgtabopt
+
+@item --mt
+Provide output appropriate for multithreaded programs. @option{--mt}
+is only useful when combined with other options, and must be the first
+option if present.
+
+@item --version
+Print the currently installed version of Libgpg-error on the
+standard output.
+
+@item --libs
+Print the linker flags that are necessary to link a program using
+Libgpg-error.
+
+@item --cflags
+Print the compiler flags that are necessary to compile a program using
+Libgpg-error.
+
+@item --prefix=@var{prefix}
+If specified, use @var{prefix} instead of the installation prefix that
+Libgpg-error was built with when computing the output for the
+@option{--cflags} and @option{--libs} options. This option is also
+used for the exec prefix if @option{--exec-prefix} was not specified.
+This option must be specified before any @option{--libs} or
+@code{--cflags} options.
+
+@item --exec-prefix=@var{prefix}
+If specified, use @var{prefix} instead of the installation exec prefix
+that Libgpg-error was built with when computing the output for the
+@option{--cflags} and @option{--libs} options. This option must be
+specified before any @option{--libs} or @option{--cflags} options.
+
+@end table
+
+@manpause
+
+
+
+@c **********************************************************
+@c ************* Appendices (license etc.) ****************
+@c **********************************************************
+@include lgpl.texi
+
+@include gpl.texi
+
+@c @node Figures and Tables
+@c #@unnumbered List of Figures and Tables
+@c
+@c @listoffloats Figure
+@c
+@c @listoffloats Table
+
+@node Concept Index
+@unnumbered Concept Index
+
+@printindex cp
+
+@node Function and Data Index
+@unnumbered Function and Data Index
+
+@printindex fn
+
+
+@bye
diff --git a/doc/gpl.texi b/doc/gpl.texi
new file mode 100644
index 0000000..6eb301e
--- /dev/null
+++ b/doc/gpl.texi
@@ -0,0 +1,392 @@
+@node Copying
+@unnumbered GNU General Public License
+
+@cindex GPL, GNU General Public License
+@center Version 2, June 1991
+
+@display
+Copyright @copyright{} 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.
+@end display
+
+@heading 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.
+
+@iftex
+@heading TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+@end iftex
+@ifinfo
+@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+@end ifinfo
+
+@enumerate
+@item
+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.
+
+@item
+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.
+
+@item
+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:
+
+@enumerate a
+@item
+You must cause the modified files to carry prominent notices
+stating that you changed the files and the date of any change.
+
+@item
+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.
+
+@item
+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.)
+@end enumerate
+
+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.
+
+@item
+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:
+
+@enumerate a
+@item
+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,
+
+@item
+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,
+
+@item
+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.)
+@end enumerate
+
+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.
+
+@item
+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.
+
+@item
+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.
+
+@item
+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.
+
+@item
+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.
+
+@item
+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.
+
+@item
+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.
+
+@item
+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.
+
+@center NO WARRANTY
+
+@item
+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.
+
+@item
+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 enumerate
+
+@iftex
+@heading END OF TERMS AND CONDITIONS
+@end iftex
+@ifinfo
+@center END OF TERMS AND CONDITIONS
+@end ifinfo
+
+@page
+@heading 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.
+
+@smallexample
+@var{one line to give the program's name and an idea of what it does.}
+Copyright (C) 19@var{yy} @var{name of author}
+
+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.
+@end smallexample
+
+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:
+
+@smallexample
+Gnomovision version 69, Copyright (C) 19@var{yy} @var{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.
+@end smallexample
+
+The hypothetical commands @samp{show w} and @samp{show c} should show
+the appropriate parts of the General Public License. Of course, the
+commands you use may be called something other than @samp{show w} and
+@samp{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:
+
+@smallexample
+@group
+Yoyodyne, Inc., hereby disclaims all copyright
+interest in the program `Gnomovision'
+(which makes passes at compilers) written
+by James Hacker.
+
+@var{signature of Ty Coon}, 1 April 1989
+Ty Coon, President of Vice
+@end group
+@end smallexample
+
+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/doc/ldap2gpgerr.c b/doc/ldap2gpgerr.c
new file mode 100644
index 0000000..f6fd3cf
--- /dev/null
+++ b/doc/ldap2gpgerr.c
@@ -0,0 +1,184 @@
+/* ldap2gpgerr.c - Mapping of LDAP error codes to gpg-error codes.
+ * Written in 2015 by Werner Koch <[email protected]>
+ *
+ * To the extent possible under law, the author(s) have dedicated all
+ * copyright and related and neighboring rights to this software to
+ * the public domain worldwide. This software is distributed without
+ * any warranty.
+ *
+ * You should have received a copy of the CC0 Public Domain Dedication
+ * along with this software. If not, see
+ * <https://creativecommons.org/publicdomain/zero/1.0/>.
+ */
+
+/*
+ * These functions are not part of libgpg-error so not to introduce a
+ * dependency on a specific LDAP implementation. Feel free to copy
+ * and distribute them with your code.
+ */
+
+#ifdef _WIN32
+# include <winsock2.h>
+# include <winldap.h>
+#else
+# include <ldap.h>
+#endif
+#include <gpg-error.h>
+
+
+/* Windows uses a few other names. Re-map them. */
+#ifdef _WIN32
+# define LDAP_ADMINLIMIT_EXCEEDED LDAP_ADMIN_LIMIT_EXCEEDED
+# define LDAP_UNAVAILABLE_CRITICAL_EXTENSION LDAP_UNAVAILABLE_CRIT_EXTENSION
+# define LDAP_TYPE_OR_VALUE_EXISTS LDAP_ATTRIBUTE_OR_VALUE_EXISTS
+# define LDAP_INSUFFICIENT_ACCESS LDAP_INSUFFICIENT_RIGHTS
+# define LDAP_VLV_ERROR LDAP_VIRTUAL_LIST_VIEW_ERROR
+#endif
+
+
+/* Map LDAP error CODE to an gpg_err_code_t. */
+gpg_err_code_t
+map_ldap_to_gpg_error (int code)
+{
+ gpg_err_code_t ec;
+
+ switch (code)
+ {
+#ifdef LDAP_X_CONNECTING
+ case LDAP_X_CONNECTING: ec = GPG_ERR_LDAP_X_CONNECTING; break;
+#endif
+
+ case LDAP_REFERRAL_LIMIT_EXCEEDED: ec = GPG_ERR_LDAP_REFERRAL_LIMIT; break;
+ case LDAP_CLIENT_LOOP: ec = GPG_ERR_LDAP_CLIENT_LOOP; break;
+ case LDAP_NO_RESULTS_RETURNED: ec = GPG_ERR_LDAP_NO_RESULTS; break;
+ case LDAP_CONTROL_NOT_FOUND: ec = GPG_ERR_LDAP_CONTROL_NOT_FOUND; break;
+ case LDAP_NOT_SUPPORTED: ec = GPG_ERR_LDAP_NOT_SUPPORTED; break;
+ case LDAP_CONNECT_ERROR: ec = GPG_ERR_LDAP_CONNECT; break;
+ case LDAP_NO_MEMORY: ec = GPG_ERR_LDAP_NO_MEMORY; break;
+ case LDAP_PARAM_ERROR: ec = GPG_ERR_LDAP_PARAM; break;
+ case LDAP_USER_CANCELLED: ec = GPG_ERR_LDAP_USER_CANCELLED; break;
+ case LDAP_FILTER_ERROR: ec = GPG_ERR_LDAP_FILTER; break;
+ case LDAP_AUTH_UNKNOWN: ec = GPG_ERR_LDAP_AUTH_UNKNOWN; break;
+ case LDAP_TIMEOUT: ec = GPG_ERR_LDAP_TIMEOUT; break;
+ case LDAP_DECODING_ERROR: ec = GPG_ERR_LDAP_DECODING; break;
+ case LDAP_ENCODING_ERROR: ec = GPG_ERR_LDAP_ENCODING; break;
+ case LDAP_LOCAL_ERROR: ec = GPG_ERR_LDAP_LOCAL; break;
+ case LDAP_SERVER_DOWN: ec = GPG_ERR_LDAP_SERVER_DOWN; break;
+
+ case LDAP_SUCCESS: ec = GPG_ERR_LDAP_SUCCESS; break;
+
+ case LDAP_OPERATIONS_ERROR: ec = GPG_ERR_LDAP_OPERATIONS; break;
+ case LDAP_PROTOCOL_ERROR: ec = GPG_ERR_LDAP_PROTOCOL; break;
+ case LDAP_TIMELIMIT_EXCEEDED: ec = GPG_ERR_LDAP_TIMELIMIT; break;
+ case LDAP_SIZELIMIT_EXCEEDED: ec = GPG_ERR_LDAP_SIZELIMIT; break;
+ case LDAP_COMPARE_FALSE: ec = GPG_ERR_LDAP_COMPARE_FALSE; break;
+ case LDAP_COMPARE_TRUE: ec = GPG_ERR_LDAP_COMPARE_TRUE; break;
+ case LDAP_AUTH_METHOD_NOT_SUPPORTED: ec=GPG_ERR_LDAP_UNSUPPORTED_AUTH;break;
+ case LDAP_STRONG_AUTH_REQUIRED: ec = GPG_ERR_LDAP_STRONG_AUTH_RQRD; break;
+ case LDAP_PARTIAL_RESULTS: ec = GPG_ERR_LDAP_PARTIAL_RESULTS; break;
+ case LDAP_REFERRAL: ec = GPG_ERR_LDAP_REFERRAL; break;
+
+#ifdef LDAP_ADMINLIMIT_EXCEEDED
+ case LDAP_ADMINLIMIT_EXCEEDED: ec = GPG_ERR_LDAP_ADMINLIMIT; break;
+#endif
+
+#ifdef LDAP_UNAVAILABLE_CRITICAL_EXTENSION
+ case LDAP_UNAVAILABLE_CRITICAL_EXTENSION:
+ ec = GPG_ERR_LDAP_UNAVAIL_CRIT_EXTN; break;
+#endif
+
+ case LDAP_CONFIDENTIALITY_REQUIRED: ec = GPG_ERR_LDAP_CONFIDENT_RQRD; break;
+ case LDAP_SASL_BIND_IN_PROGRESS: ec = GPG_ERR_LDAP_SASL_BIND_INPROG; break;
+ case LDAP_NO_SUCH_ATTRIBUTE: ec = GPG_ERR_LDAP_NO_SUCH_ATTRIBUTE; break;
+ case LDAP_UNDEFINED_TYPE: ec = GPG_ERR_LDAP_UNDEFINED_TYPE; break;
+ case LDAP_INAPPROPRIATE_MATCHING: ec = GPG_ERR_LDAP_BAD_MATCHING; break;
+ case LDAP_CONSTRAINT_VIOLATION: ec = GPG_ERR_LDAP_CONST_VIOLATION; break;
+
+#ifdef LDAP_TYPE_OR_VALUE_EXISTS
+ case LDAP_TYPE_OR_VALUE_EXISTS: ec = GPG_ERR_LDAP_TYPE_VALUE_EXISTS; break;
+#endif
+
+ case LDAP_INVALID_SYNTAX: ec = GPG_ERR_LDAP_INV_SYNTAX; break;
+ case LDAP_NO_SUCH_OBJECT: ec = GPG_ERR_LDAP_NO_SUCH_OBJ; break;
+ case LDAP_ALIAS_PROBLEM: ec = GPG_ERR_LDAP_ALIAS_PROBLEM; break;
+ case LDAP_INVALID_DN_SYNTAX: ec = GPG_ERR_LDAP_INV_DN_SYNTAX; break;
+ case LDAP_IS_LEAF: ec = GPG_ERR_LDAP_IS_LEAF; break;
+ case LDAP_ALIAS_DEREF_PROBLEM: ec = GPG_ERR_LDAP_ALIAS_DEREF; break;
+
+#ifdef LDAP_X_PROXY_AUTHZ_FAILURE
+ case LDAP_X_PROXY_AUTHZ_FAILURE: ec = GPG_ERR_LDAP_X_PROXY_AUTH_FAIL; break;
+#endif
+
+ case LDAP_INAPPROPRIATE_AUTH: ec = GPG_ERR_LDAP_BAD_AUTH; break;
+ case LDAP_INVALID_CREDENTIALS: ec = GPG_ERR_LDAP_INV_CREDENTIALS; break;
+
+#ifdef LDAP_INSUFFICIENT_ACCESS
+ case LDAP_INSUFFICIENT_ACCESS: ec = GPG_ERR_LDAP_INSUFFICIENT_ACC; break;
+#endif
+
+ case LDAP_BUSY: ec = GPG_ERR_LDAP_BUSY; break;
+ case LDAP_UNAVAILABLE: ec = GPG_ERR_LDAP_UNAVAILABLE; break;
+ case LDAP_UNWILLING_TO_PERFORM: ec = GPG_ERR_LDAP_UNWILL_TO_PERFORM; break;
+ case LDAP_LOOP_DETECT: ec = GPG_ERR_LDAP_LOOP_DETECT; break;
+ case LDAP_NAMING_VIOLATION: ec = GPG_ERR_LDAP_NAMING_VIOLATION; break;
+ case LDAP_OBJECT_CLASS_VIOLATION: ec = GPG_ERR_LDAP_OBJ_CLS_VIOLATION; break;
+ case LDAP_NOT_ALLOWED_ON_NONLEAF: ec=GPG_ERR_LDAP_NOT_ALLOW_NONLEAF;break;
+ case LDAP_NOT_ALLOWED_ON_RDN: ec = GPG_ERR_LDAP_NOT_ALLOW_ON_RDN; break;
+ case LDAP_ALREADY_EXISTS: ec = GPG_ERR_LDAP_ALREADY_EXISTS; break;
+ case LDAP_NO_OBJECT_CLASS_MODS: ec = GPG_ERR_LDAP_NO_OBJ_CLASS_MODS; break;
+ case LDAP_RESULTS_TOO_LARGE: ec = GPG_ERR_LDAP_RESULTS_TOO_LARGE; break;
+ case LDAP_AFFECTS_MULTIPLE_DSAS: ec = GPG_ERR_LDAP_AFFECTS_MULT_DSAS; break;
+
+#ifdef LDAP_VLV_ERROR
+ case LDAP_VLV_ERROR: ec = GPG_ERR_LDAP_VLV; break;
+#endif
+
+ case LDAP_OTHER: ec = GPG_ERR_LDAP_OTHER; break;
+
+#ifdef LDAP_CUP_RESOURCES_EXHAUSTED
+ case LDAP_CUP_RESOURCES_EXHAUSTED: ec=GPG_ERR_LDAP_CUP_RESOURCE_LIMIT;break;
+ case LDAP_CUP_SECURITY_VIOLATION: ec=GPG_ERR_LDAP_CUP_SEC_VIOLATION; break;
+ case LDAP_CUP_INVALID_DATA: ec = GPG_ERR_LDAP_CUP_INV_DATA; break;
+ case LDAP_CUP_UNSUPPORTED_SCHEME: ec = GPG_ERR_LDAP_CUP_UNSUP_SCHEME; break;
+ case LDAP_CUP_RELOAD_REQUIRED: ec = GPG_ERR_LDAP_CUP_RELOAD; break;
+#endif
+
+#ifdef LDAP_CANCELLED
+ case LDAP_CANCELLED: ec = GPG_ERR_LDAP_CANCELLED; break;
+#endif
+
+#ifdef LDAP_NO_SUCH_OPERATION
+ case LDAP_NO_SUCH_OPERATION: ec = GPG_ERR_LDAP_NO_SUCH_OPERATION; break;
+#endif
+
+#ifdef LDAP_TOO_LATE
+ case LDAP_TOO_LATE: ec = GPG_ERR_LDAP_TOO_LATE; break;
+#endif
+
+#ifdef LDAP_CANNOT_CANCEL
+ case LDAP_CANNOT_CANCEL: ec = GPG_ERR_LDAP_CANNOT_CANCEL; break;
+#endif
+
+#ifdef LDAP_ASSERTION_FAILED
+ case LDAP_ASSERTION_FAILED: ec = GPG_ERR_LDAP_ASSERTION_FAILED; break;
+#endif
+
+#ifdef LDAP_PROXIED_AUTHORIZATION_DENIED
+ case LDAP_PROXIED_AUTHORIZATION_DENIED:
+ ec = GPG_ERR_LDAP_PROX_AUTH_DENIED; break;
+#endif
+
+ default:
+#if defined(LDAP_E_ERROR) && defined(LDAP_X_ERROR)
+ if (LDAP_E_ERROR (code))
+ ec = GPG_ERR_LDAP_E_GENERAL;
+ else if (LDAP_X_ERROR (code))
+ ec = GPG_ERR_LDAP_X_GENERAL;
+ else
+#endif
+ ec = GPG_ERR_LDAP_GENERAL;
+ break;
+ }
+
+ return ec;
+}
diff --git a/doc/lgpl.texi b/doc/lgpl.texi
new file mode 100644
index 0000000..bbd18a0
--- /dev/null
+++ b/doc/lgpl.texi
@@ -0,0 +1,560 @@
+@node Library Copying
+@unnumbered GNU Lesser General Public License
+
+@cindex LGPL, GNU Lesser General Public License
+@center Version 2.1, February 1999
+
+@display
+Copyright @copyright{} 1991, 1999 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.
+
+[This is the first released version of the Lesser GPL. It also counts
+as the successor of the GNU Library Public License, version 2, hence the
+version number 2.1.]
+@end display
+
+@heading Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software---to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software---typically libraries---of the Free
+Software Foundation and other authors who decide to use it. You can use
+it too, but we suggest you first think carefully about whether this
+license or the ordinary General Public License is the better strategy to
+use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+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 and use pieces of it
+in new free programs; and that you are informed that you can do these
+things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the @dfn{Lesser} General Public License because it
+does @emph{Less} to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+``work based on the library'' and a ``work that uses the library''. The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+@iftex
+@heading TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+@end iftex
+@ifinfo
+@center GNU LESSER GENERAL PUBLIC LICENSE
+@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+@end ifinfo
+
+@enumerate 0
+@item
+This License Agreement applies to any software library or other program
+which contains a notice placed by the copyright holder or other
+authorized party saying it may be distributed under the terms of this
+Lesser General Public License (also called ``this License''). Each
+licensee is addressed as ``you''.
+
+ A ``library'' means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The ``Library'', below, refers to any such software library or work
+which has been distributed under these terms. A ``work based on the
+Library'' means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term ``modification''.)
+
+ ``Source code'' for a work means the preferred form of the work for
+making modifications to it. For a library, 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 library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+@item
+You may copy and distribute verbatim copies of the Library's
+complete 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 distribute a copy of this License along with the
+Library.
+
+ 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.
+
+@item
+You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+@enumerate a
+@item
+The modified work must itself be a software library.
+
+@item
+You must cause the files modified to carry prominent notices
+stating that you changed the files and the date of any change.
+
+@item
+You must cause the whole of the work to be licensed at no
+charge to all third parties under the terms of this License.
+
+@item
+If a facility in the modified Library refers to a function or a
+table of data to be supplied by an application program that uses
+the facility, other than as an argument passed when the facility
+is invoked, then you must make a good faith effort to ensure that,
+in the event an application does not supply such function or
+table, the facility still operates, and performs whatever part of
+its purpose remains meaningful.
+
+(For example, a function in a library to compute square roots has
+a purpose that is entirely well-defined independent of the
+application. Therefore, Subsection 2d requires that any
+application-supplied function or table used by this function must
+be optional: if the application does not supply it, the square
+root function must still compute square roots.)
+@end enumerate
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+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 Library, 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 Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+@item
+You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+@item
+You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you 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.
+
+ If distribution of 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 satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+@item
+A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a ``work that uses the Library''. Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a ``work that uses the Library'' with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a ``work that uses the
+library''. The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a ``work that uses the Library'' uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+@item
+As an exception to the Sections above, you may also combine or
+link a ``work that uses the Library'' with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+@enumerate a
+@item
+Accompany the work with the complete corresponding
+machine-readable source code for the Library including whatever
+changes were used in the work (which must be distributed under
+Sections 1 and 2 above); and, if the work is an executable linked
+with the Library, with the complete machine-readable ``work that
+uses the Library'', as object code and/or source code, so that the
+user can modify the Library and then relink to produce a modified
+executable containing the modified Library. (It is understood
+that the user who changes the contents of definitions files in the
+Library will not necessarily be able to recompile the application
+to use the modified definitions.)
+
+@item
+Use a suitable shared library mechanism for linking with the Library. A
+suitable mechanism is one that (1) uses at run time a copy of the
+library already present on the user's computer system, rather than
+copying library functions into the executable, and (2) will operate
+properly with a modified version of the library, if the user installs
+one, as long as the modified version is interface-compatible with the
+version that the work was made with.
+
+@item
+Accompany the work with a written offer, valid for at
+least three years, to give the same user the materials
+specified in Subsection 6a, above, for a charge no more
+than the cost of performing this distribution.
+
+@item
+If distribution of the work is made by offering access to copy
+from a designated place, offer equivalent access to copy the above
+specified materials from the same place.
+
+@item
+Verify that the user has already received a copy of these
+materials or that you have already sent this user a copy.
+@end enumerate
+
+ For an executable, the required form of the ``work that uses the
+Library'' must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be 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.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+@item
+You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+@enumerate a
+@item
+Accompany the combined library with a copy of the same work
+based on the Library, uncombined with any other library
+facilities. This must be distributed under the terms of the
+Sections above.
+
+@item
+Give prominent notice with the combined library of the fact
+that part of it is a work based on the Library, and explaining
+where to find the accompanying uncombined form of the same work.
+@end enumerate
+
+@item
+You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library 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.
+
+@item
+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 Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+@item
+Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+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 with
+this License.
+
+@item
+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 Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library 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 Library.
+
+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.
+
+@item
+If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library 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.
+
+@item
+The Free Software Foundation may publish revised and/or new
+versions of the Lesser 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 Library
+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 Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+@item
+If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+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.
+
+@center NO WARRANTY
+
+@item
+BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY ``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
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+@item
+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 LIBRARY 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
+LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+@end enumerate
+
+@iftex
+@heading END OF TERMS AND CONDITIONS
+@end iftex
+@ifinfo
+@center END OF TERMS AND CONDITIONS
+@end ifinfo
+
+@page
+@heading How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. 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.
+
+@smallexample
+@var{one line to give the library's name and an idea of what it does.}
+Copyright (C) @var{year} @var{name of author}
+
+This library is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or (at
+your option) any later version.
+
+This library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
+USA.
+@end smallexample
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a ``copyright disclaimer'' for the library, if
+necessary. Here is a sample; alter the names:
+
+@smallexample
+Yoyodyne, Inc., hereby disclaims all copyright interest in the library
+`Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+@var{signature of Ty Coon}, 1 April 1990
+Ty Coon, President of Vice
+@end smallexample
+
+That's all there is to it!
diff --git a/doc/yat2m.c b/doc/yat2m.c
new file mode 100644
index 0000000..8c6319c
--- /dev/null
+++ b/doc/yat2m.c
@@ -0,0 +1,1644 @@
+/* yat2m.c - Yet Another Texi 2 Man converter
+ * Copyright (C) 2005, 2013, 2015, 2016, 2017 g10 Code GmbH
+ * Copyright (C) 2006, 2008, 2011 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+/*
+ This is a simple texinfo to man page converter. It needs some
+ special markup in th e texinfo and tries best to get a create man
+ page. It has been designed for the GnuPG man pages and thus only
+ a few texinfo commands are supported.
+
+ To use this you need to add the following macros into your texinfo
+ source:
+
+ @macro manpage {a}
+ @end macro
+ @macro mansect {a}
+ @end macro
+ @macro manpause
+ @end macro
+ @macro mancont
+ @end macro
+
+ They are used by yat2m to select parts of the Texinfo which should
+ go into the man page. These macros need to be used without leading
+ left space. Processing starts after a "manpage" macro has been
+ seen. "mansect" identifies the section and yat2m make sure to
+ emit the sections in the proper order. Note that @mansect skips
+ the next input line if that line begins with @section, @subsection or
+ @chapheading.
+
+ To insert verbatim troff markup, the following texinfo code may be
+ used:
+
+ @ifset manverb
+ .B whateever you want
+ @end ifset
+
+ alternativly a special comment may be used:
+
+ @c man:.B whatever you want
+
+ This is useful in case you need just one line. If you want to
+ include parts only in the man page but keep the texinfo
+ translation you may use:
+
+ @ifset isman
+ stuff to be rendered only on man pages
+ @end ifset
+
+ or to exclude stuff from man pages:
+
+ @ifclear isman
+ stuff not to be rendered on man pages
+ @end ifclear
+
+ the keyword @section is ignored, however @subsection gets rendered
+ as ".SS". @menu is completely skipped. Several man pages may be
+ extracted from one file, either using the --store or the --select
+ option.
+
+ If you want to indent tables in the source use this style:
+
+ @table foo
+ @item
+ @item
+ @table
+ @item
+ @end
+ @end
+
+ Don't change the indentation within a table and keep the same
+ number of white space at the start of the line. yat2m simply
+ detects the number of white spaces in front of an @item and remove
+ this number of spaces from all following lines until a new @item
+ is found or there are less spaces than for the last @item.
+
+ Note that @* does only work correctly if used at the end of an
+ input line.
+
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <ctype.h>
+#include <time.h>
+
+
+#if __GNUC__
+# define MY_GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
+#else
+# define MY_GCC_VERSION 0
+#endif
+
+#if MY_GCC_VERSION >= 20500
+# define ATTR_PRINTF(f, a) __attribute__ ((format(printf,f,a)))
+# define ATTR_NR_PRINTF(f, a) __attribute__ ((noreturn, format(printf,f,a)))
+#else
+# define ATTR_PRINTF(f, a)
+# define ATTR_NR_PRINTF(f, a)
+#endif
+#if MY_GCC_VERSION >= 30200
+# define ATTR_MALLOC __attribute__ ((__malloc__))
+#else
+# define ATTR_MALLOC
+#endif
+
+
+
+#define PGM "yat2m"
+#ifdef PACKAGE_VERSION
+# define VERSION PACKAGE_VERSION
+#else
+# define VERSION "1.0"
+#endif
+
+/* The maximum length of a line including the linefeed and one extra
+ character. */
+#define LINESIZE 1024
+
+/* Number of allowed condition nestings. */
+#define MAX_CONDITION_NESTING 10
+
+/* Option flags. */
+static int verbose;
+static int quiet;
+static int debug;
+static const char *opt_source;
+static const char *opt_release;
+static const char *opt_date;
+static const char *opt_select;
+static const char *opt_include;
+static int opt_store;
+
+/* Flag to keep track whether any error occurred. */
+static int any_error;
+
+
+/* Object to keep macro definitions. */
+struct macro_s
+{
+ struct macro_s *next;
+ char *value; /* Malloced value. */
+ char name[1];
+};
+typedef struct macro_s *macro_t;
+
+/* List of all defined macros. */
+static macro_t macrolist;
+
+/* List of variables set by @set. */
+static macro_t variablelist;
+
+/* List of global macro names. The value part is not used. */
+static macro_t predefinedmacrolist;
+
+/* Object to keep track of @isset and @ifclear. */
+struct condition_s
+{
+ int manverb; /* "manverb" needs special treatment. */
+ int isset; /* This is an @isset condition. */
+ char name[1]; /* Name of the condition macro. */
+};
+typedef struct condition_s *condition_t;
+
+/* The stack used to evaluate conditions. And the current states. */
+static condition_t condition_stack[MAX_CONDITION_NESTING];
+static int condition_stack_idx;
+static int cond_is_active; /* State of ifset/ifclear */
+static int cond_in_verbatim; /* State of "manverb". */
+
+
+/* Object to store one line of content. */
+struct line_buffer_s
+{
+ struct line_buffer_s *next;
+ int verbatim; /* True if LINE contains verbatim data. The default
+ is Texinfo source. */
+ char *line;
+};
+typedef struct line_buffer_s *line_buffer_t;
+
+
+/* Object to collect the data of a section. */
+struct section_buffer_s
+{
+ char *name; /* Malloced name of the section. This may be
+ NULL to indicate this slot is not used. */
+ line_buffer_t lines; /* Linked list with the lines of the section. */
+ line_buffer_t *lines_tail; /* Helper for faster appending to the
+ linked list. */
+ line_buffer_t last_line; /* Points to the last line appended. */
+};
+typedef struct section_buffer_s *section_buffer_t;
+
+/* Variable to keep info about the current page together. */
+static struct
+{
+ /* Filename of the current page or NULL if no page is active. Malloced. */
+ char *name;
+
+ /* Number of allocated elements in SECTIONS below. */
+ size_t n_sections;
+ /* Array with the data of the sections. */
+ section_buffer_t sections;
+
+} thepage;
+
+
+/* The list of standard section names. COMMANDS and ASSUAN are GnuPG
+ specific. */
+static const char * const standard_sections[] =
+ { "NAME", "SYNOPSIS", "DESCRIPTION",
+ "RETURN VALUE", "EXIT STATUS", "ERROR HANDLING", "ERRORS",
+ "COMMANDS", "OPTIONS", "USAGE", "EXAMPLES", "FILES",
+ "ENVIRONMENT", "DIAGNOSTICS", "SECURITY", "CONFORMING TO",
+ "ASSUAN", "NOTES", "BUGS", "AUTHOR", "SEE ALSO", NULL };
+
+
+/*-- Local prototypes. --*/
+static void proc_texi_buffer (FILE *fp, const char *line, size_t len,
+ int *table_level, int *eol_action);
+
+static void die (const char *format, ...) ATTR_NR_PRINTF(1,2);
+static void err (const char *format, ...) ATTR_PRINTF(1,2);
+static void inf (const char *format, ...) ATTR_PRINTF(1,2);
+static void *xmalloc (size_t n) ATTR_MALLOC;
+static void *xcalloc (size_t n, size_t m) ATTR_MALLOC;
+
+
+
+/*-- Functions --*/
+
+/* Print diagnostic message and exit with failure. */
+static void
+die (const char *format, ...)
+{
+ va_list arg_ptr;
+
+ fflush (stdout);
+ fprintf (stderr, "%s: ", PGM);
+
+ va_start (arg_ptr, format);
+ vfprintf (stderr, format, arg_ptr);
+ va_end (arg_ptr);
+ putc ('\n', stderr);
+
+ exit (1);
+}
+
+
+/* Print diagnostic message. */
+static void
+err (const char *format, ...)
+{
+ va_list arg_ptr;
+
+ fflush (stdout);
+ if (strncmp (format, "%s:%d:", 6))
+ fprintf (stderr, "%s: ", PGM);
+
+ va_start (arg_ptr, format);
+ vfprintf (stderr, format, arg_ptr);
+ va_end (arg_ptr);
+ putc ('\n', stderr);
+ any_error = 1;
+}
+
+/* Print diagnostic message. */
+static void
+inf (const char *format, ...)
+{
+ va_list arg_ptr;
+
+ fflush (stdout);
+ fprintf (stderr, "%s: ", PGM);
+
+ va_start (arg_ptr, format);
+ vfprintf (stderr, format, arg_ptr);
+ va_end (arg_ptr);
+ putc ('\n', stderr);
+}
+
+
+static void *
+xmalloc (size_t n)
+{
+ void *p = malloc (n);
+ if (!p)
+ die ("out of core: %s", strerror (errno));
+ return p;
+}
+
+static void *
+xcalloc (size_t n, size_t m)
+{
+ void *p = calloc (n, m);
+ if (!p)
+ die ("out of core: %s", strerror (errno));
+ return p;
+}
+
+static void *
+xrealloc (void *old, size_t n)
+{
+ void *p = realloc (old, n);
+ if (!p)
+ die ("out of core: %s", strerror (errno));
+ return p;
+}
+
+static char *
+xstrdup (const char *string)
+{
+ void *p = malloc (strlen (string)+1);
+ if (!p)
+ die ("out of core: %s", strerror (errno));
+ strcpy (p, string);
+ return p;
+}
+
+
+/* Uppercase the ascii characters in STRING. */
+static char *
+ascii_strupr (char *string)
+{
+ char *p;
+
+ for (p = string; *p; p++)
+ if (!(*p & 0x80))
+ *p = toupper (*p);
+ return string;
+}
+
+
+/* Return the current date as an ISO string. */
+const char *
+isodatestring (void)
+{
+ static char buffer[11+5];
+ struct tm *tp;
+ time_t atime;
+
+ if (opt_date && *opt_date)
+ atime = strtoul (opt_date, NULL, 10);
+ else
+ atime = time (NULL);
+ if (atime < 0)
+ strcpy (buffer, "????" "-??" "-??");
+ else
+ {
+ tp = gmtime (&atime);
+ sprintf (buffer,"%04d-%02d-%02d",
+ 1900+tp->tm_year, tp->tm_mon+1, tp->tm_mday );
+ }
+ return buffer;
+}
+
+
+/* Add NAME to the list of predefined macros which are global for all
+ files. */
+static void
+add_predefined_macro (const char *name)
+{
+ macro_t m;
+
+ for (m=predefinedmacrolist; m; m = m->next)
+ if (!strcmp (m->name, name))
+ break;
+ if (!m)
+ {
+ m = xcalloc (1, sizeof *m + strlen (name));
+ strcpy (m->name, name);
+ m->next = predefinedmacrolist;
+ predefinedmacrolist = m;
+ }
+}
+
+
+/* Create or update a macro with name MACRONAME and set its values TO
+ MACROVALUE. Note that ownership of the macro value is transferred
+ to this function. */
+static void
+set_macro (const char *macroname, char *macrovalue)
+{
+ macro_t m;
+
+ for (m=macrolist; m; m = m->next)
+ if (!strcmp (m->name, macroname))
+ break;
+ if (m)
+ free (m->value);
+ else
+ {
+ m = xcalloc (1, sizeof *m + strlen (macroname));
+ strcpy (m->name, macroname);
+ m->next = macrolist;
+ macrolist = m;
+ }
+ m->value = macrovalue;
+ macrovalue = NULL;
+}
+
+
+/* Create or update a variable with name and value given in NAMEANDVALUE. */
+static void
+set_variable (char *nameandvalue)
+{
+ macro_t m;
+ const char *value;
+ char *p;
+
+ for (p = nameandvalue; *p && *p != ' ' && *p != '\t'; p++)
+ ;
+ if (!*p)
+ value = "";
+ else
+ {
+ *p++ = 0;
+ while (*p == ' ' || *p == '\t')
+ p++;
+ value = p;
+ }
+
+ for (m=variablelist; m; m = m->next)
+ if (!strcmp (m->name, nameandvalue))
+ break;
+ if (m)
+ free (m->value);
+ else
+ {
+ m = xcalloc (1, sizeof *m + strlen (nameandvalue));
+ strcpy (m->name, nameandvalue);
+ m->next = variablelist;
+ variablelist = m;
+ }
+ m->value = xstrdup (value);
+}
+
+
+/* Return true if the macro or variable NAME is set, i.e. not the
+ empty string and not evaluating to 0. */
+static int
+macro_set_p (const char *name)
+{
+ macro_t m;
+
+ for (m = macrolist; m ; m = m->next)
+ if (!strcmp (m->name, name))
+ break;
+ if (!m)
+ for (m = variablelist; m ; m = m->next)
+ if (!strcmp (m->name, name))
+ break;
+ if (!m || !m->value || !*m->value)
+ return 0;
+ if ((*m->value & 0x80) || !isdigit (*m->value))
+ return 1; /* Not a digit but some other string. */
+ return !!atoi (m->value);
+}
+
+
+/* Evaluate the current conditions. */
+static void
+evaluate_conditions (const char *fname, int lnr)
+{
+ int i;
+
+ /* for (i=0; i < condition_stack_idx; i++) */
+ /* inf ("%s:%d: stack[%d] %s %s %c", */
+ /* fname, lnr, i, condition_stack[i]->isset? "set":"clr", */
+ /* condition_stack[i]->name, */
+ /* (macro_set_p (condition_stack[i]->name) */
+ /* ^ !condition_stack[i]->isset)? 't':'f'); */
+
+ cond_is_active = 1;
+ cond_in_verbatim = 0;
+ if (condition_stack_idx)
+ {
+ for (i=0; i < condition_stack_idx; i++)
+ {
+ if (condition_stack[i]->manverb)
+ cond_in_verbatim = (macro_set_p (condition_stack[i]->name)
+ ^ !condition_stack[i]->isset);
+ else if (!(macro_set_p (condition_stack[i]->name)
+ ^ !condition_stack[i]->isset))
+ {
+ cond_is_active = 0;
+ break;
+ }
+ }
+ }
+
+ /* inf ("%s:%d: active=%d verbatim=%d", */
+ /* fname, lnr, cond_is_active, cond_in_verbatim); */
+}
+
+
+/* Push a condition with condition macro NAME onto the stack. If
+ ISSET is true, a @isset condition is pushed. */
+static void
+push_condition (const char *name, int isset, const char *fname, int lnr)
+{
+ condition_t cond;
+ int manverb = 0;
+
+ if (condition_stack_idx >= MAX_CONDITION_NESTING)
+ {
+ err ("%s:%d: condition nested too deep", fname, lnr);
+ return;
+ }
+
+ if (!strcmp (name, "manverb"))
+ {
+ if (!isset)
+ {
+ err ("%s:%d: using \"@ifclear manverb\" is not allowed", fname, lnr);
+ return;
+ }
+ manverb = 1;
+ }
+
+ cond = xcalloc (1, sizeof *cond + strlen (name));
+ cond->manverb = manverb;
+ cond->isset = isset;
+ strcpy (cond->name, name);
+
+ condition_stack[condition_stack_idx++] = cond;
+ evaluate_conditions (fname, lnr);
+}
+
+
+/* Remove the last condition from the stack. ISSET is used for error
+ reporting. */
+static void
+pop_condition (int isset, const char *fname, int lnr)
+{
+ if (!condition_stack_idx)
+ {
+ err ("%s:%d: unbalanced \"@end %s\"",
+ fname, lnr, isset?"isset":"isclear");
+ return;
+ }
+ condition_stack_idx--;
+ free (condition_stack[condition_stack_idx]);
+ condition_stack[condition_stack_idx] = NULL;
+ evaluate_conditions (fname, lnr);
+}
+
+
+
+/* Return a section buffer for the section NAME. Allocate a new buffer
+ if this is a new section. Keep track of the sections in THEPAGE.
+ This function may reallocate the section array in THEPAGE. */
+static section_buffer_t
+get_section_buffer (const char *name)
+{
+ int i;
+ section_buffer_t sect;
+
+ /* If there is no section we put everything into the required NAME
+ section. Given that this is the first one listed it is likely
+ that error are easily visible. */
+ if (!name)
+ name = "NAME";
+
+ for (i=0; i < thepage.n_sections; i++)
+ {
+ sect = thepage.sections + i;
+ if (sect->name && !strcmp (name, sect->name))
+ return sect;
+ }
+ for (i=0; i < thepage.n_sections; i++)
+ if (!thepage.sections[i].name)
+ break;
+ if (thepage.n_sections && i < thepage.n_sections)
+ sect = thepage.sections + i;
+ else
+ {
+ /* We need to allocate or reallocate the section array. */
+ size_t old_n = thepage.n_sections;
+ size_t new_n = 20;
+
+ if (!old_n)
+ thepage.sections = xcalloc (new_n, sizeof *thepage.sections);
+ else
+ {
+ thepage.sections = xrealloc (thepage.sections,
+ ((old_n + new_n)
+ * sizeof *thepage.sections));
+ memset (thepage.sections + old_n, 0,
+ new_n * sizeof *thepage.sections);
+ }
+ thepage.n_sections += new_n;
+
+ /* Setup the tail pointers. */
+ for (i=old_n; i < thepage.n_sections; i++)
+ {
+ sect = thepage.sections + i;
+ sect->lines_tail = &sect->lines;
+ }
+ sect = thepage.sections + old_n;
+ }
+
+ /* Store the name. */
+ assert (!sect->name);
+ sect->name = xstrdup (name);
+ return sect;
+}
+
+
+
+/* Add the content of LINE to the section named SECTNAME. */
+static void
+add_content (const char *sectname, char *line, int verbatim)
+{
+ section_buffer_t sect;
+ line_buffer_t lb;
+
+ sect = get_section_buffer (sectname);
+ if (sect->last_line && !sect->last_line->verbatim == !verbatim)
+ {
+ /* Lets append that line to the last one. We do this to keep
+ all lines of the same kind (i.e.verbatim or not) together in
+ one large buffer. */
+ size_t n1, n;
+
+ lb = sect->last_line;
+ n1 = strlen (lb->line);
+ n = n1 + 1 + strlen (line) + 1;
+ lb->line = xrealloc (lb->line, n);
+ strcpy (lb->line+n1, "\n");
+ strcpy (lb->line+n1+1, line);
+ }
+ else
+ {
+ lb = xcalloc (1, sizeof *lb);
+ lb->verbatim = verbatim;
+ lb->line = xstrdup (line);
+ sect->last_line = lb;
+ *sect->lines_tail = lb;
+ sect->lines_tail = &lb->next;
+ }
+}
+
+
+/* Prepare for a new man page using the filename NAME. */
+static void
+start_page (char *name)
+{
+ if (verbose)
+ inf ("starting page '%s'", name);
+ assert (!thepage.name);
+ thepage.name = xstrdup (name);
+ thepage.n_sections = 0;
+}
+
+
+/* Write the .TH entry of the current page. Return -1 if there is a
+ problem with the page. */
+static int
+write_th (FILE *fp)
+{
+ char *name, *p;
+
+ fputs (".\\\" Created from Texinfo source by yat2m " VERSION "\n", fp);
+
+ name = ascii_strupr (xstrdup (thepage.name));
+ p = strrchr (name, '.');
+ if (!p || !p[1])
+ {
+ err ("no section name in man page '%s'", thepage.name);
+ free (name);
+ return -1;
+ }
+ *p++ = 0;
+ fprintf (fp, ".TH %s %s %s \"%s\" \"%s\"\n",
+ name, p, isodatestring (), opt_release, opt_source);
+ free (name);
+ return 0;
+}
+
+
+/* Process the texinfo command COMMAND (without the leading @) and
+ write output if needed to FP. REST is the remainer of the line
+ which should either point to an opening brace or to a white space.
+ The function returns the number of characters already processed
+ from REST. LEN is the usable length of REST. TABLE_LEVEL is used to
+ control the indentation of tables. */
+static size_t
+proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len,
+ int *table_level, int *eol_action)
+{
+ static struct {
+ const char *name; /* Name of the command. */
+ int what; /* What to do with this command. */
+ const char *lead_in; /* String to print with a opening brace. */
+ const char *lead_out;/* String to print with the closing brace. */
+ } cmdtbl[] = {
+ { "command", 0, "\\fB", "\\fR" },
+ { "code", 0, "\\fB", "\\fR" },
+ { "url", 0, "\\fB", "\\fR" },
+ { "sc", 0, "\\fB", "\\fR" },
+ { "var", 0, "\\fI", "\\fR" },
+ { "samp", 0, "\\(aq", "\\(aq" },
+ { "file", 0, "\\(oq\\fI","\\fR\\(cq" },
+ { "env", 0, "\\(oq\\fI","\\fR\\(cq" },
+ { "acronym", 0 },
+ { "dfn", 0 },
+ { "option", 0, "\\fB", "\\fR" },
+ { "example", 1, ".RS 2\n.nf\n" },
+ { "smallexample", 1, ".RS 2\n.nf\n" },
+ { "asis", 7 },
+ { "anchor", 7 },
+ { "cartouche", 1 },
+ { "ref", 0, "[", "]" },
+ { "xref", 0, "See: [", "]" },
+ { "pxref", 0, "see: [", "]" },
+ { "uref", 0, "(\\fB", "\\fR)" },
+ { "footnote",0, " ([", "])" },
+ { "emph", 0, "\\fI", "\\fR" },
+ { "w", 1 },
+ { "c", 5 },
+ { "efindex", 1 },
+ { "opindex", 1 },
+ { "cpindex", 1 },
+ { "cindex", 1 },
+ { "noindent", 0 },
+ { "section", 1 },
+ { "chapter", 1 },
+ { "subsection", 6, "\n.SS " },
+ { "chapheading", 0},
+ { "item", 2, ".TP\n.B " },
+ { "itemx", 2, ".TQ\n.B " },
+ { "table", 3 },
+ { "itemize", 3 },
+ { "bullet", 0, "* " },
+ { "*", 0, "\n.br"},
+ { "/", 0 },
+ { "end", 4 },
+ { "quotation",1, ".RS\n\\fB" },
+ { "value", 8 },
+ { NULL }
+ };
+ size_t n;
+ int i;
+ const char *s;
+ const char *lead_out = NULL;
+ int ignore_args = 0;
+
+ for (i=0; cmdtbl[i].name && strcmp (cmdtbl[i].name, command); i++)
+ ;
+ if (cmdtbl[i].name)
+ {
+ s = cmdtbl[i].lead_in;
+ if (s)
+ fputs (s, fp);
+ lead_out = cmdtbl[i].lead_out;
+ switch (cmdtbl[i].what)
+ {
+ case 1: /* Throw away the entire line. */
+ s = memchr (rest, '\n', len);
+ return s? (s-rest)+1 : len;
+ case 2: /* Handle @item. */
+ break;
+ case 3: /* Handle table. */
+ if (++(*table_level) > 1)
+ fputs (".RS\n", fp);
+ /* Now throw away the entire line. */
+ s = memchr (rest, '\n', len);
+ return s? (s-rest)+1 : len;
+ break;
+ case 4: /* Handle end. */
+ for (s=rest, n=len; n && (*s == ' ' || *s == '\t'); s++, n--)
+ ;
+ if (n >= 5 && !memcmp (s, "table", 5)
+ && (!n || s[5] == ' ' || s[5] == '\t' || s[5] == '\n'))
+ {
+ if ((*table_level)-- > 1)
+ fputs (".RE\n", fp);
+ else
+ fputs (".P\n", fp);
+ }
+ else if (n >= 7 && !memcmp (s, "example", 7)
+ && (!n || s[7] == ' ' || s[7] == '\t' || s[7] == '\n'))
+ {
+ fputs (".fi\n.RE\n", fp);
+ }
+ else if (n >= 12 && !memcmp (s, "smallexample", 12)
+ && (!n || s[12] == ' ' || s[12] == '\t' || s[12] == '\n'))
+ {
+ fputs (".fi\n.RE\n", fp);
+ }
+ else if (n >= 9 && !memcmp (s, "quotation", 9)
+ && (!n || s[9] == ' ' || s[9] == '\t' || s[9] == '\n'))
+ {
+ fputs ("\\fR\n.RE\n", fp);
+ }
+ /* Now throw away the entire line. */
+ s = memchr (rest, '\n', len);
+ return s? (s-rest)+1 : len;
+ case 5: /* Handle special comments. */
+ for (s=rest, n=len; n && (*s == ' ' || *s == '\t'); s++, n--)
+ ;
+ if (n >= 4 && !memcmp (s, "man:", 4))
+ {
+ for (s+=4, n-=4; n && *s != '\n'; n--, s++)
+ putc (*s, fp);
+ putc ('\n', fp);
+ }
+ /* Now throw away the entire line. */
+ s = memchr (rest, '\n', len);
+ return s? (s-rest)+1 : len;
+ case 6:
+ *eol_action = 1;
+ break;
+ case 7:
+ ignore_args = 1;
+ break;
+ case 8:
+ ignore_args = 1;
+ if (*rest != '{')
+ {
+ err ("opening brace for command '%s' missing", command);
+ return len;
+ }
+ else
+ {
+ /* Find closing brace. */
+ for (s=rest+1, n=1; *s && n < len; s++, n++)
+ if (*s == '}')
+ break;
+ if (*s != '}')
+ {
+ err ("closing brace for command '%s' not found", command);
+ return len;
+ }
+ else
+ {
+ size_t len = s - (rest + 1);
+ macro_t m;
+
+ for (m = variablelist; m; m = m->next)
+ if (strlen (m->name) == len
+ &&!strncmp (m->name, rest+1, len))
+ break;
+ if (m)
+ fputs (m->value, fp);
+ else
+ inf ("texinfo variable '%.*s' is not set",
+ (int)len, rest+1);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ else /* macro */
+ {
+ macro_t m;
+
+ for (m = macrolist; m ; m = m->next)
+ if (!strcmp (m->name, command))
+ break;
+ if (m)
+ {
+ proc_texi_buffer (fp, m->value, strlen (m->value),
+ table_level, eol_action);
+ ignore_args = 1; /* Parameterized macros are not yet supported. */
+ }
+ else
+ inf ("texinfo command '%s' not supported (%.*s)", command,
+ (int)((s = memchr (rest, '\n', len)), (s? (s-rest) : len)), rest);
+ }
+
+ if (*rest == '{')
+ {
+ /* Find matching closing brace. */
+ for (s=rest+1, n=1, i=1; i && *s && n < len; s++, n++)
+ if (*s == '{')
+ i++;
+ else if (*s == '}')
+ i--;
+ if (i)
+ {
+ err ("closing brace for command '%s' not found", command);
+ return len;
+ }
+ if (n > 2 && !ignore_args)
+ proc_texi_buffer (fp, rest+1, n-2, table_level, eol_action);
+ }
+ else
+ n = 0;
+
+ if (lead_out)
+ fputs (lead_out, fp);
+
+ return n;
+}
+
+
+
+/* Process the string LINE with LEN bytes of Texinfo content. */
+static void
+proc_texi_buffer (FILE *fp, const char *line, size_t len,
+ int *table_level, int *eol_action)
+{
+ const char *s;
+ char cmdbuf[256];
+ int cmdidx = 0;
+ int in_cmd = 0;
+ size_t n;
+
+ for (s=line; *s && len; s++, len--)
+ {
+ if (in_cmd)
+ {
+ if (in_cmd == 1)
+ {
+ switch (*s)
+ {
+ case '@': case '{': case '}':
+ putc (*s, fp); in_cmd = 0;
+ break;
+ case ':': /* Not ending a sentence flag. */
+ in_cmd = 0;
+ break;
+ case '.': case '!': case '?': /* Ending a sentence. */
+ putc (*s, fp); in_cmd = 0;
+ break;
+ case ' ': case '\t': case '\n': /* Non collapsing spaces. */
+ putc (*s, fp); in_cmd = 0;
+ break;
+ default:
+ cmdidx = 0;
+ cmdbuf[cmdidx++] = *s;
+ in_cmd++;
+ break;
+ }
+ }
+ else if (*s == '{' || *s == ' ' || *s == '\t' || *s == '\n')
+ {
+ cmdbuf[cmdidx] = 0;
+ n = proc_texi_cmd (fp, cmdbuf, s, len, table_level, eol_action);
+ assert (n <= len);
+ s += n; len -= n;
+ s--; len++;
+ in_cmd = 0;
+ }
+ else if (cmdidx < sizeof cmdbuf -1)
+ cmdbuf[cmdidx++] = *s;
+ else
+ {
+ err ("texinfo command too long - ignored");
+ in_cmd = 0;
+ }
+ }
+ else if (*s == '@')
+ in_cmd = 1;
+ else if (*s == '\n')
+ {
+ switch (*eol_action)
+ {
+ case 1: /* Create a dummy paragraph. */
+ fputs ("\n\\ \n", fp);
+ break;
+ default:
+ putc (*s, fp);
+ }
+ *eol_action = 0;
+ }
+ else if (*s == '\\')
+ fputs ("\\\\", fp);
+ else
+ putc (*s, fp);
+ }
+
+ if (in_cmd > 1)
+ {
+ cmdbuf[cmdidx] = 0;
+ n = proc_texi_cmd (fp, cmdbuf, s, len, table_level, eol_action);
+ assert (n <= len);
+ s += n; len -= n;
+ s--; len++;
+ /* in_cmd = 0; -- doc only */
+ }
+}
+
+
+/* Do something with the Texinfo line LINE. */
+static void
+parse_texi_line (FILE *fp, const char *line, int *table_level)
+{
+ int eol_action = 0;
+
+ /* A quick test whether there are any texinfo commands. */
+ if (!strchr (line, '@'))
+ {
+ fputs (line, fp);
+ putc ('\n', fp);
+ return;
+ }
+ proc_texi_buffer (fp, line, strlen (line), table_level, &eol_action);
+ putc ('\n', fp);
+}
+
+
+/* Write all the lines LINES to FP. */
+static void
+write_content (FILE *fp, line_buffer_t lines)
+{
+ line_buffer_t line;
+ int table_level = 0;
+
+ for (line = lines; line; line = line->next)
+ {
+ if (line->verbatim)
+ {
+ fputs (line->line, fp);
+ putc ('\n', fp);
+ }
+ else
+ {
+/* fputs ("TEXI---", fp); */
+/* fputs (line->line, fp); */
+/* fputs ("---\n", fp); */
+ parse_texi_line (fp, line->line, &table_level);
+ }
+ }
+}
+
+
+
+static int
+is_standard_section (const char *name)
+{
+ int i;
+ const char *s;
+
+ for (i=0; (s=standard_sections[i]); i++)
+ if (!strcmp (s, name))
+ return 1;
+ return 0;
+}
+
+
+/* Finish a page; that is sort the data and write it out to the file. */
+static void
+finish_page (void)
+{
+ FILE *fp;
+ section_buffer_t sect = NULL;
+ int idx;
+ const char *s;
+ int i;
+
+ if (!thepage.name)
+ return; /* No page active. */
+
+ if (verbose)
+ inf ("finishing page '%s'", thepage.name);
+
+ if (opt_select)
+ {
+ if (!strcmp (opt_select, thepage.name))
+ {
+ inf ("selected '%s'", thepage.name );
+ fp = stdout;
+ }
+ else
+ {
+ fp = fopen ( "/dev/null", "w" );
+ if (!fp)
+ die ("failed to open /dev/null: %s\n", strerror (errno));
+ }
+ }
+ else if (opt_store)
+ {
+ inf ("writing '%s'", thepage.name );
+ fp = fopen ( thepage.name, "w" );
+ if (!fp)
+ die ("failed to create '%s': %s\n", thepage.name, strerror (errno));
+ }
+ else
+ fp = stdout;
+
+ if (write_th (fp))
+ goto leave;
+
+ for (idx=0; (s=standard_sections[idx]); idx++)
+ {
+ for (i=0; i < thepage.n_sections; i++)
+ {
+ sect = thepage.sections + i;
+ if (sect->name && !strcmp (s, sect->name))
+ break;
+ }
+ if (i == thepage.n_sections)
+ sect = NULL;
+
+ if (sect)
+ {
+ fprintf (fp, ".SH %s\n", sect->name);
+ write_content (fp, sect->lines);
+ /* Now continue with all non standard sections directly
+ following this one. */
+ for (i++; i < thepage.n_sections; i++)
+ {
+ sect = thepage.sections + i;
+ if (sect->name && is_standard_section (sect->name))
+ break;
+ if (sect->name)
+ {
+ fprintf (fp, ".SH %s\n", sect->name);
+ write_content (fp, sect->lines);
+ }
+ }
+
+ }
+ }
+
+
+ leave:
+ if (fp != stdout)
+ fclose (fp);
+ free (thepage.name);
+ thepage.name = NULL;
+ /* FIXME: Cleanup the content. */
+}
+
+
+
+
+/* Parse one Texinfo file and create manpages according to the
+ embedded instructions. */
+static void
+parse_file (const char *fname, FILE *fp, char **section_name, int in_pause)
+{
+ char *line;
+ int lnr = 0;
+ /* Fixme: The following state variables don't carry over to include
+ files. */
+ int skip_to_end = 0; /* Used to skip over menu entries. */
+ int skip_sect_line = 0; /* Skip after @mansect. */
+ int item_indent = 0; /* How far is the current @item indented. */
+
+ /* Helper to define a macro. */
+ char *macroname = NULL;
+ char *macrovalue = NULL;
+ size_t macrovaluesize = 0;
+ size_t macrovalueused = 0;
+
+ line = xmalloc (LINESIZE);
+ while (fgets (line, LINESIZE, fp))
+ {
+ size_t n = strlen (line);
+ int got_line = 0;
+ char *p, *pend;
+
+ lnr++;
+ if (!n || line[n-1] != '\n')
+ {
+ err ("%s:%d: trailing linefeed missing, line too long or "
+ "embedded Nul character", fname, lnr);
+ break;
+ }
+ line[--n] = 0;
+
+ /* Kludge to allow indentation of tables. */
+ for (p=line; *p == ' ' || *p == '\t'; p++)
+ ;
+ if (*p)
+ {
+ if (*p == '@' && !strncmp (p+1, "item", 4))
+ item_indent = p - line; /* Set a new indent level. */
+ else if (p - line < item_indent)
+ item_indent = 0; /* Switch off indention. */
+
+ if (item_indent)
+ {
+ memmove (line, line+item_indent, n - item_indent + 1);
+ n -= item_indent;
+ }
+ }
+
+
+ if (*line == '@')
+ {
+ for (p=line+1, n=1; *p && *p != ' ' && *p != '\t'; p++)
+ n++;
+ while (*p == ' ' || *p == '\t')
+ p++;
+ }
+ else
+ p = line;
+
+ /* Take action on macro. */
+ if (macroname)
+ {
+ if (n == 4 && !memcmp (line, "@end", 4)
+ && (line[4]==' '||line[4]=='\t'||!line[4])
+ && !strncmp (p, "macro", 5)
+ && (p[5]==' '||p[5]=='\t'||!p[5]))
+ {
+ if (macrovalueused)
+ macrovalue[--macrovalueused] = 0; /* Kill the last LF. */
+ macrovalue[macrovalueused] = 0; /* Terminate macro. */
+ macrovalue = xrealloc (macrovalue, macrovalueused+1);
+
+ set_macro (macroname, macrovalue);
+ macrovalue = NULL;
+ free (macroname);
+ macroname = NULL;
+ }
+ else
+ {
+ if (macrovalueused + strlen (line) + 2 >= macrovaluesize)
+ {
+ macrovaluesize += strlen (line) + 256;
+ macrovalue = xrealloc (macrovalue, macrovaluesize);
+ }
+ strcpy (macrovalue+macrovalueused, line);
+ macrovalueused += strlen (line);
+ macrovalue[macrovalueused++] = '\n';
+ }
+ continue;
+ }
+
+
+ if (n >= 5 && !memcmp (line, "@node", 5)
+ && (line[5]==' '||line[5]=='\t'||!line[5]))
+ {
+ /* Completey ignore @node lines. */
+ continue;
+ }
+
+
+ if (skip_sect_line)
+ {
+ skip_sect_line = 0;
+ if (!strncmp (line, "@section", 8)
+ || !strncmp (line, "@subsection", 11)
+ || !strncmp (line, "@chapheading", 12))
+ continue;
+ }
+
+ /* We only parse lines we need and ignore the rest. There are a
+ few macros used to control this as well as one @ifset
+ command. Parts we know about are saved away into containers
+ separate for each section. */
+
+ /* First process ifset/ifclear commands. */
+ if (*line == '@')
+ {
+ if (n == 6 && !memcmp (line, "@ifset", 6)
+ && (line[6]==' '||line[6]=='\t'))
+ {
+ for (p=line+7; *p == ' ' || *p == '\t'; p++)
+ ;
+ if (!*p)
+ {
+ err ("%s:%d: name missing after \"@ifset\"", fname, lnr);
+ continue;
+ }
+ for (pend=p; *pend && *pend != ' ' && *pend != '\t'; pend++)
+ ;
+ *pend = 0; /* Ignore rest of the line. */
+ push_condition (p, 1, fname, lnr);
+ continue;
+ }
+ else if (n == 8 && !memcmp (line, "@ifclear", 8)
+ && (line[8]==' '||line[8]=='\t'))
+ {
+ for (p=line+9; *p == ' ' || *p == '\t'; p++)
+ ;
+ if (!*p)
+ {
+ err ("%s:%d: name missing after \"@ifsclear\"", fname, lnr);
+ continue;
+ }
+ for (pend=p; *pend && *pend != ' ' && *pend != '\t'; pend++)
+ ;
+ *pend = 0; /* Ignore rest of the line. */
+ push_condition (p, 0, fname, lnr);
+ continue;
+ }
+ else if (n == 4 && !memcmp (line, "@end", 4)
+ && (line[4]==' '||line[4]=='\t')
+ && !strncmp (p, "ifset", 5)
+ && (p[5]==' '||p[5]=='\t'||!p[5]))
+ {
+ pop_condition (1, fname, lnr);
+ continue;
+ }
+ else if (n == 4 && !memcmp (line, "@end", 4)
+ && (line[4]==' '||line[4]=='\t')
+ && !strncmp (p, "ifclear", 7)
+ && (p[7]==' '||p[7]=='\t'||!p[7]))
+ {
+ pop_condition (0, fname, lnr);
+ continue;
+ }
+ }
+
+ /* Take action on ifset/ifclear. */
+ if (!cond_is_active)
+ continue;
+
+ /* Process commands. */
+ if (*line == '@')
+ {
+ if (skip_to_end
+ && n == 4 && !memcmp (line, "@end", 4)
+ && (line[4]==' '||line[4]=='\t'||!line[4]))
+ {
+ skip_to_end = 0;
+ }
+ else if (cond_in_verbatim)
+ {
+ got_line = 1;
+ }
+ else if (n == 6 && !memcmp (line, "@macro", 6))
+ {
+ macroname = xstrdup (p);
+ macrovalue = xmalloc ((macrovaluesize = 1024));
+ macrovalueused = 0;
+ }
+ else if (n == 4 && !memcmp (line, "@set", 4))
+ {
+ set_variable (p);
+ }
+ else if (n == 8 && !memcmp (line, "@manpage", 8))
+ {
+ free (*section_name);
+ *section_name = NULL;
+ finish_page ();
+ start_page (p);
+ in_pause = 0;
+ }
+ else if (n == 8 && !memcmp (line, "@mansect", 8))
+ {
+ if (!thepage.name)
+ err ("%s:%d: section outside of a man page", fname, lnr);
+ else
+ {
+ free (*section_name);
+ *section_name = ascii_strupr (xstrdup (p));
+ in_pause = 0;
+ skip_sect_line = 1;
+ }
+ }
+ else if (n == 9 && !memcmp (line, "@manpause", 9))
+ {
+ if (!*section_name)
+ err ("%s:%d: pausing outside of a man section", fname, lnr);
+ else if (in_pause)
+ err ("%s:%d: already pausing", fname, lnr);
+ else
+ in_pause = 1;
+ }
+ else if (n == 8 && !memcmp (line, "@mancont", 8))
+ {
+ if (!*section_name)
+ err ("%s:%d: continue outside of a man section", fname, lnr);
+ else if (!in_pause)
+ err ("%s:%d: continue while not pausing", fname, lnr);
+ else
+ in_pause = 0;
+ }
+ else if (n == 5 && !memcmp (line, "@menu", 5)
+ && (line[5]==' '||line[5]=='\t'||!line[5]))
+ {
+ skip_to_end = 1;
+ }
+ else if (n == 8 && !memcmp (line, "@include", 8)
+ && (line[8]==' '||line[8]=='\t'||!line[8]))
+ {
+ char *incname = xstrdup (p);
+ FILE *incfp = fopen (incname, "r");
+
+ if (!incfp && opt_include && *opt_include && *p != '/')
+ {
+ free (incname);
+ incname = xmalloc (strlen (opt_include) + 1
+ + strlen (p) + 1);
+ strcpy (incname, opt_include);
+ if ( incname[strlen (incname)-1] != '/' )
+ strcat (incname, "/");
+ strcat (incname, p);
+ incfp = fopen (incname, "r");
+ }
+
+ if (!incfp)
+ err ("can't open include file '%s': %s",
+ incname, strerror (errno));
+ else
+ {
+ parse_file (incname, incfp, section_name, in_pause);
+ fclose (incfp);
+ }
+ free (incname);
+ }
+ else if (n == 4 && !memcmp (line, "@bye", 4)
+ && (line[4]==' '||line[4]=='\t'||!line[4]))
+ {
+ break;
+ }
+ else if (!skip_to_end)
+ got_line = 1;
+ }
+ else if (!skip_to_end)
+ got_line = 1;
+
+ if (got_line && cond_in_verbatim)
+ add_content (*section_name, line, 1);
+ else if (got_line && thepage.name && *section_name && !in_pause)
+ add_content (*section_name, line, 0);
+
+ }
+ if (ferror (fp))
+ err ("%s:%d: read error: %s", fname, lnr, strerror (errno));
+ free (macroname);
+ free (macrovalue);
+ free (line);
+}
+
+
+static void
+top_parse_file (const char *fname, FILE *fp)
+{
+ char *section_name = NULL; /* Name of the current section or NULL
+ if not in a section. */
+ macro_t m;
+
+ while (macrolist)
+ {
+ macro_t next = macrolist->next;
+ free (macrolist->value);
+ free (macrolist);
+ macrolist = next;
+ }
+ while (variablelist)
+ {
+ macro_t next = variablelist->next;
+ free (variablelist->value);
+ free (variablelist);
+ variablelist = next;
+ }
+ for (m=predefinedmacrolist; m; m = m->next)
+ set_macro (m->name, xstrdup ("1"));
+ cond_is_active = 1;
+ cond_in_verbatim = 0;
+
+ parse_file (fname, fp, &section_name, 0);
+ free (section_name);
+ finish_page ();
+}
+
+
+int
+main (int argc, char **argv)
+{
+ int last_argc = -1;
+ const char *s;
+
+ opt_source = "GNU";
+ opt_release = "";
+
+ /* Define default macros. The trick is that these macros are not
+ defined when using the actual texinfo renderer. */
+ add_predefined_macro ("isman");
+ add_predefined_macro ("manverb");
+
+ /* Option parsing. */
+ if (argc)
+ {
+ argc--; argv++;
+ }
+ while (argc && last_argc != argc )
+ {
+ last_argc = argc;
+ if (!strcmp (*argv, "--"))
+ {
+ argc--; argv++;
+ break;
+ }
+ else if (!strcmp (*argv, "--help"))
+ {
+ puts (
+ "Usage: " PGM " [OPTION] [FILE]\n"
+ "Extract man pages from a Texinfo source.\n\n"
+ " --source NAME use NAME as source field\n"
+ " --release STRING use STRING as the release field\n"
+ " --date EPOCH use EPOCH as publication date\n"
+ " --store write output using @manpage name\n"
+ " --select NAME only output pages with @manpage NAME\n"
+ " --verbose enable extra informational output\n"
+ " --debug enable additional debug output\n"
+ " --help display this help and exit\n"
+ " -I DIR also search in include DIR\n"
+ " -D gpgone the only usable define\n\n"
+ "With no FILE, or when FILE is -, read standard input.\n\n"
+ "Report bugs to <https://bugs.gnupg.org>.");
+ exit (0);
+ }
+ else if (!strcmp (*argv, "--version"))
+ {
+ puts (PGM " " VERSION "\n"
+ "Copyright (C) 2005, 2017 g10 Code GmbH\n"
+ "This program comes with ABSOLUTELY NO WARRANTY.\n"
+ "This is free software, and you are welcome to redistribute it\n"
+ "under certain conditions. See the file COPYING for details.");
+ exit (0);
+ }
+ else if (!strcmp (*argv, "--verbose"))
+ {
+ verbose = 1;
+ argc--; argv++;
+ }
+ else if (!strcmp (*argv, "--quiet"))
+ {
+ quiet = 1;
+ argc--; argv++;
+ }
+ else if (!strcmp (*argv, "--debug"))
+ {
+ verbose = debug = 1;
+ argc--; argv++;
+ }
+ else if (!strcmp (*argv, "--source"))
+ {
+ argc--; argv++;
+ if (argc)
+ {
+ opt_source = *argv;
+ argc--; argv++;
+ }
+ }
+ else if (!strcmp (*argv, "--release"))
+ {
+ argc--; argv++;
+ if (argc)
+ {
+ opt_release = *argv;
+ argc--; argv++;
+ }
+ }
+ else if (!strcmp (*argv, "--date"))
+ {
+ argc--; argv++;
+ if (argc)
+ {
+ opt_date = *argv;
+ argc--; argv++;
+ }
+ }
+ else if (!strcmp (*argv, "--store"))
+ {
+ opt_store = 1;
+ argc--; argv++;
+ }
+ else if (!strcmp (*argv, "--select"))
+ {
+ argc--; argv++;
+ if (argc)
+ {
+ opt_select = strrchr (*argv, '/');
+ if (opt_select)
+ opt_select++;
+ else
+ opt_select = *argv;
+ argc--; argv++;
+ }
+ }
+ else if (!strcmp (*argv, "-I"))
+ {
+ argc--; argv++;
+ if (argc)
+ {
+ opt_include = *argv;
+ argc--; argv++;
+ }
+ }
+ else if (!strcmp (*argv, "-D"))
+ {
+ argc--; argv++;
+ if (argc)
+ {
+ add_predefined_macro (*argv);
+ argc--; argv++;
+ }
+ }
+ }
+
+ if (argc > 1)
+ die ("usage: " PGM " [OPTION] [FILE] (try --help for more information)\n");
+
+ /* Take care of supplied timestamp for reproducible builds. See
+ * https://reproducible-builds.org/specs/source-date-epoch/ */
+ if (!opt_date && (s = getenv ("SOURCE_DATE_EPOCH")) && *s)
+ opt_date = s;
+
+ /* Start processing. */
+ if (argc && strcmp (*argv, "-"))
+ {
+ FILE *fp = fopen (*argv, "rb");
+ if (!fp)
+ die ("%s:0: can't open file: %s", *argv, strerror (errno));
+ top_parse_file (*argv, fp);
+ fclose (fp);
+ }
+ else
+ top_parse_file ("-", stdin);
+
+ return !!any_error;
+}
+
+
+/*
+Local Variables:
+compile-command: "gcc -Wall -g -Wall -o yat2m yat2m.c"
+End:
+*/
diff --git a/lang/Makefile.am b/lang/Makefile.am
new file mode 100644
index 0000000..3e380d5
--- /dev/null
+++ b/lang/Makefile.am
@@ -0,0 +1,22 @@
+# Makefile.am for libgpg-error.
+# Copyright (C) 2003, 2006 g10 Code GmbH
+#
+# This file is part of libgpg-error.
+#
+# libgpg-error is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of the
+# License, or (at your option) any later version.
+#
+# libgpg-error is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser 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 = cl
+
+EXTRA_DIST = README
diff --git a/lang/README b/lang/README
new file mode 100644
index 0000000..2d13e21
--- /dev/null
+++ b/lang/README
@@ -0,0 +1,8 @@
+Language Support for libgpg-error
+---------------------------------
+
+This directory contains support for other languages than C.
+
+Directory Language
+
+cl Common Lisp
diff --git a/lang/cl/Makefile.am b/lang/cl/Makefile.am
new file mode 100644
index 0000000..0535fee
--- /dev/null
+++ b/lang/cl/Makefile.am
@@ -0,0 +1,40 @@
+# Makefile.am for libgpg-error.
+# Copyright (C) 2003, 2006 g10 Code GmbH
+#
+# This file is part of libgpg-error.
+#
+# libgpg-error is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of the
+# License, or (at your option) any later version.
+#
+# libgpg-error is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser 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
+
+distributed_clfiles = gpg-error.asd \
+ gpg-error-package.lisp gpg-error.lisp
+
+generated_clfiles = gpg-error-codes.lisp
+
+clfiles = $(distributed_clfiles) $(generated_clfiles)
+
+# FIXME: Should be configurable.
+clfilesdir = $(datadir)/common-lisp/source/gpg-error
+dist_clfiles_DATA = $(distributed_clfiles)
+nodist_clfiles_DATA = $(generated_clfiles)
+
+EXTRA_DIST = README mkerrcodes.awk
+CLEANFILES = gpg-error-codes.lisp
+
+codes_file = $(top_srcdir)/src/err-codes.h.in
+errno_file = $(top_srcdir)/src/errnos.in
+
+gpg-error-codes.lisp: Makefile mkerrcodes.awk $(codes_file) $(errno_file)
+ echo '@errnos@' | cat $(codes_file) - $(errno_file) \
+ | $(AWK) -f $(srcdir)/mkerrcodes.awk >$@
diff --git a/lang/cl/README b/lang/cl/README
new file mode 100644
index 0000000..660508b
--- /dev/null
+++ b/lang/cl/README
@@ -0,0 +1,22 @@
+Common Lisp Support for libgpg-error
+------------------------------------
+
+Requirements:
+
+ASDF Packaging Support
+CFFI Foreign Function Interface
+
+Use with:
+
+> (asdf:operate 'asdf:load-op ':gpg-error)
+> (use-package :gpg-error)
+
+
+TODO
+----
+
+* We probably should define a condition base class. Currently, we do
+ this in the user code only (eg in GPGME).
+
+* Some lispy convenience functions as need arises, for example for
+ output.
diff --git a/lang/cl/gpg-error-package.lisp b/lang/cl/gpg-error-package.lisp
new file mode 100644
index 0000000..73adca0
--- /dev/null
+++ b/lang/cl/gpg-error-package.lisp
@@ -0,0 +1,64 @@
+;;;; libgpg-error-package.lisp
+
+;;; Copyright (C) 2006 g10 Code GmbH
+;;;
+;;; This file is part of libgpg-error.
+;;;
+;;; libgpg-error is free software; you can redistribute it and/or
+;;; modify it under the terms of the GNU Lesser General Public License
+;;; as published by the Free Software Foundation; either version 2.1 of
+;;; the License, or (at your option) any later version.
+;;;
+;;; libgpg-error is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;;; Lesser General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU Lesser General Public
+;;; License along with libgpg-error; if not, write to the Free
+;;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;;; 02111-1307, USA.
+
+;;; Conventions
+;;;
+;;; Error sources and codes are represented as keywords like
+;;; :gpg-err-source-gpg and :gpg-err-unknown-packet.
+;;;
+;;; Errors are represented as lists '(SOURCE CODE). Other
+;;; representations are also accepted in some places.
+;;;
+;;; The following functions are defined which are not defined in the C API:
+;;; gpg-err-source-as-key, gpg-err-source-as-value
+;;; gpg-err-code-as-key, gpg-err-code-as-value
+;;; gpg-err-canonicalize, gpg-err-as-value
+;;; Conversion between keywords and values for error sources and codes.
+;;;
+;;; The following functions from the C API are omitted:
+;;; gpg-strerror-r
+;;;
+;;; The following features work slightly differently:
+;;; *gpg-err-source-default* is a dynamic variable that can be set to
+;;; change the default for gpg-error.
+
+(defpackage #:gpg-error
+ (:use #:common-lisp #:cffi)
+
+ (:export :gpg-err-code-as-key
+ :gpg-err-code-as-value
+ :gpg-err-source-as-key
+ :gpg-err-source-as-value
+ :gpg-err-canonicalize
+ :gpg-err-as-value
+ :gpg-err-make
+ :*gpg-err-source-default*
+ :gpg-error
+ :gpg-err-code
+ :gpg-err-source
+ :gpg-strerror
+ :gpg-strsource
+ :gpg-err-code-from-errno
+ :gpg-err-code-to-errno
+ :gpg-err-code-from-syserror
+ :gpg-err-make-from-errno
+ :gpg-error-from-errno
+ :gpg-error-from-syserror))
diff --git a/lang/cl/gpg-error.asd.in b/lang/cl/gpg-error.asd.in
new file mode 100644
index 0000000..3cb7e96
--- /dev/null
+++ b/lang/cl/gpg-error.asd.in
@@ -0,0 +1,36 @@
+;;; -*- Mode: lisp -*-
+
+;;; Copyright (C) 2006 g10 Code GmbH
+;;;
+;;; This file is part of libgpg-error.
+;;;
+;;; libgpg-error is free software; you can redistribute it and/or
+;;; modify it under the terms of the GNU Lesser General Public License
+;;; as published by the Free Software Foundation; either version 2.1 of
+;;; the License, or (at your option) any later version.
+;;;
+;;; libgpg-error is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;;; Lesser General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU Lesser General Public
+;;; License along with libgpg-error; if not, write to the Free
+;;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;;; 02111-1307, USA.
+
+(defpackage #:gpg-error-system
+ (:use #:common-lisp #:asdf))
+
+(in-package #:gpg-error-system)
+
+(defsystem gpg-error
+ :description "Common error values for all GnuPG components."
+ :author "g10 Code GmbH"
+ :version "@VERSION@"
+ :licence "LGPL"
+ :depends-on ("cffi")
+ :components ((:file "gpg-error-package")
+ (:file "gpg-error-codes"
+ :depends-on ("gpg-error-package"))
+ (:file "gpg-error" :depends-on ("gpg-error-codes"))))
diff --git a/lang/cl/gpg-error.lisp b/lang/cl/gpg-error.lisp
new file mode 100644
index 0000000..cad2532
--- /dev/null
+++ b/lang/cl/gpg-error.lisp
@@ -0,0 +1,233 @@
+;;;; libgpg-error.lisp
+
+;;; Copyright (C) 2006 g10 Code GmbH
+;;;
+;;; This file is part of libgpg-error.
+;;;
+;;; libgpg-error is free software; you can redistribute it and/or
+;;; modify it under the terms of the GNU Lesser General Public License
+;;; as published by the Free Software Foundation; either version 2.1 of
+;;; the License, or (at your option) any later version.
+;;;
+;;; libgpg-error is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;;; Lesser General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU Lesser General Public
+;;; License along with libgpg-error; if not, write to the Free
+;;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;;; 02111-1307, USA.
+
+;;; Set up the library.
+
+(in-package :gpg-error)
+
+(define-foreign-library libgpg-error
+ (:unix "libgpg-error.so")
+ (t (:default "libgpg-error")))
+
+(use-foreign-library libgpg-error)
+
+;;; System dependencies.
+
+(defctype size-t :unsigned-int "The system size_t type.")
+
+;;; Error sources.
+
+(defcenum gpg-err-source-t
+ "The GPG error source type."
+ (:gpg-err-source-unknown 0)
+ (:gpg-err-source-gcrypt 1)
+ (:gpg-err-source-gpg 2)
+ (:gpg-err-source-gpgsm 3)
+ (:gpg-err-source-gpgagent 4)
+ (:gpg-err-source-pinentry 5)
+ (:gpg-err-source-scd 6)
+ (:gpg-err-source-gpgme 7)
+ (:gpg-err-source-keybox 8)
+ (:gpg-err-source-ksba 9)
+ (:gpg-err-source-dirmngr 10)
+ (:gpg-err-source-gsti 11)
+ (:gpg-err-source-any 31)
+ (:gpg-err-source-user-1 32)
+ (:gpg-err-source-user-2 33)
+ (:gpg-err-source-user-3 34)
+ (:gpg-err-source-user-4 35))
+
+(defconstant +gpg-err-source-dim+ 256)
+
+;;; The error code type gpg-err-code-t.
+
+;;; libgpg-error-codes.lisp is loaded by ASDF.
+
+(defctype gpg-error-t :unsigned-int "The GPG error code type.")
+
+;;; Bit mask manipulation constants.
+
+(defconstant +gpg-err-code-mask+ (- +gpg-err-code-dim+ 1))
+
+(defconstant +gpg-err-source-mask+ (- +gpg-err-source-dim+ 1))
+(defconstant +gpg-err-source-shift+ 24)
+
+;;; Constructor and accessor functions.
+
+;;; If we had in-library versions of our static inlines, we wouldn't
+;;; need to replicate them here. Oh well.
+
+(defun c-gpg-err-make (source code)
+ "Construct an error value from an error code and source.
+ Within a subsystem, use gpg-error instead."
+ (logior
+ (ash (logand source +gpg-err-source-mask+)
+ +gpg-err-source-shift+)
+ (logand code +gpg-err-code-mask+)))
+
+(defun c-gpg-err-code (err)
+ "retrieve the error code from an error value."
+ (logand err +gpg-err-code-mask+))
+
+(defun c-gpg-err-source (err)
+ "retrieve the error source from an error value."
+ (logand (ash err (- +gpg-err-source-shift+))
+ +gpg-err-source-mask+))
+
+;;; String functions.
+
+(defcfun ("gpg_strerror" c-gpg-strerror) :string
+ (err gpg-error-t))
+
+(defcfun ("gpg_strsource" c-gpg-strsource) :string
+ (err gpg-error-t))
+
+;;; Mapping of system errors (errno).
+
+(defcfun ("gpg_err_code_from_errno" c-gpg-err-code-from-errno) gpg-err-code-t
+ (err :int))
+
+(defcfun ("gpg_err_code_to_errno" c-gpg-err-code-to-errno) :int
+ (code gpg-err-code-t))
+
+(defcfun ("gpg_err_code_from_syserror"
+ c-gpg-err-code-from-syserror) gpg-err-code-t)
+
+;;; Self-documenting convenience functions.
+
+;;; See below.
+
+;;;
+;;;
+;;; Lispy interface.
+;;;
+;;;
+
+;;; Low-level support functions.
+
+(defun gpg-err-code-as-value (code-key)
+ (foreign-enum-value 'gpg-err-code-t code-key))
+
+(defun gpg-err-code-as-key (code)
+ (foreign-enum-keyword 'gpg-err-code-t code))
+
+(defun gpg-err-source-as-value (source-key)
+ (foreign-enum-value 'gpg-err-source-t source-key))
+
+(defun gpg-err-source-as-key (source)
+ (foreign-enum-keyword 'gpg-err-source-t source))
+
+(defun gpg-err-canonicalize (err)
+ "Canonicalize the error value err."
+ (gpg-err-make (gpg-err-source err) (gpg-err-code err)))
+
+(defun gpg-err-as-value (err)
+ "Get the integer representation of the error value ERR."
+ (let ((error (gpg-err-canonicalize err)))
+ (c-gpg-err-make (gpg-err-source-as-value (gpg-err-source error))
+ (gpg-err-code-as-value (gpg-err-code error)))))
+
+;;; Constructor and accessor functions.
+
+(defun gpg-err-make (source code)
+ "Construct an error value from an error code and source.
+ Within a subsystem, use gpg-error instead."
+ ;; As an exception to the rule, the function gpg-err-make will use
+ ;; the error source value as is when provided as integer, instead of
+ ;; parsing it as an error value.
+ (list (if (integerp source)
+ (gpg-err-source-as-key source)
+ (gpg-err-source source))
+ (gpg-err-code code)))
+
+(defvar *gpg-err-source-default* :gpg-err-source-unknown
+ "define this to specify a default source for gpg-error.")
+
+(defun gpg-error (code)
+ "Construct an error value from an error code, using the default source."
+ (gpg-err-make *gpg-err-source-default* code))
+
+(defun gpg-err-code (err)
+ "Retrieve an error code from the error value ERR."
+ (cond ((listp err) (second err))
+ ((keywordp err) err) ; FIXME
+ (t (gpg-err-code-as-key (c-gpg-err-code err)))))
+
+(defun gpg-err-source (err)
+ "Retrieve an error source from the error value ERR."
+ (cond ((listp err) (first err))
+ ((keywordp err) err) ; FIXME
+ (t (gpg-err-source-as-key (c-gpg-err-source err)))))
+
+;;; String functions.
+
+(defun gpg-strerror (err)
+ "Return a string containig a description of the error code."
+ (c-gpg-strerror (gpg-err-as-value err)))
+
+;;; FIXME: maybe we should use this as the actual implementation for
+;;; gpg-strerror.
+
+;; (defcfun ("gpg_strerror_r" c-gpg-strerror-r) :int
+;; (err gpg-error-t)
+;; (buf :string)
+;; (buflen size-t))
+
+;; (defun gpg-strerror-r (err)
+;; "Return a string containig a description of the error code."
+;; (with-foreign-pointer-as-string (errmsg 256 errmsg-size)
+;; (c-gpg-strerror-r (gpg-err-code-as-value (gpg-err-code err))
+;; errmsg errmsg-size)))
+
+(defun gpg-strsource (err)
+ "Return a string containig a description of the error source."
+ (c-gpg-strsource (gpg-err-as-value err)))
+
+;;; Mapping of system errors (errno).
+
+(defun gpg-err-code-from-errno (err)
+ "Retrieve the error code for the system error. If the system error
+ is not mapped, :gpg-err-unknown-errno is returned."
+ (gpg-err-code-as-key (c-gpg-err-code-from-errno err)))
+
+(defun gpg-err-code-to-errno (code)
+ "Retrieve the system error for the error code. If this is not a
+ system error, 0 is returned."
+ (c-gpg-err-code-to-errno (gpg-err-code code)))
+
+(defun gpg-err-code-from-syserror ()
+ "Retrieve the error code directly from the system ERRNO. If the system error
+ is not mapped, :gpg-err-unknown-errno is returned and
+ :gpg-err-missing-errno if ERRNO has the value 0."
+ (gpg-err-code-as-key (c-gpg-err-code-from-syserror)))
+
+
+;;; Self-documenting convenience functions.
+
+(defun gpg-err-make-from-errno (source err)
+ (gpg-err-make source (gpg-err-code-from-errno err)))
+
+(defun gpg-error-from-errno (err)
+ (gpg-error (gpg-err-code-from-errno err)))
+
+(defun gpg-error-from-syserror ()
+ (gpg-error (gpg-err-code-from-syserror)))
+
diff --git a/lang/cl/mkerrcodes.awk b/lang/cl/mkerrcodes.awk
new file mode 100644
index 0000000..ae29043
--- /dev/null
+++ b/lang/cl/mkerrcodes.awk
@@ -0,0 +1,154 @@
+# mkerrcodes.awk
+# Copyright (C) 2004, 2005, 2006 g10 Code GmbH
+#
+# 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, g10 Code GmbH gives unlimited permission to
+# copy, distribute and modify the lisp source files that are the output
+# of mkerrcodes.awk. You need not follow the terms of the GNU General
+# Public License when using or distributing such scripts, even though
+# portions of the text of mkerrcodes.awk appear in them. The GNU
+# General Public License (GPL) does govern all other use of the material
+# that constitutes the mkerrcodes.awk program.
+#
+# Certain portions of the mkerrcodes.awk source text are designed to be
+# copied (in certain cases, depending on the input) into the output of
+# mkerrcodes.awk. We call these the "data" portions. The rest of the
+# mkerrcodes.awk source text consists of comments plus executable code
+# that decides which of the data portions to output in any given case.
+# We call these comments and executable code the "non-data" portions.
+# mkerrcodes.awk never copies any of the non-data portions into its output.
+#
+# This special exception to the GPL applies to versions of mkerrcodes.awk
+# released by g10 Code GmbH. When you make and distribute a modified version
+# of mkerrcodes.awk, you may extend this special exception to the GPL to
+# apply to your modified version as well, *unless* your modified version
+# has the potential to copy into its output some of the text that was the
+# non-data portion of the version that you started with. (In other words,
+# unless your change moves or copies text from the non-data portions to the
+# data portions.) If your modification has such potential, you must delete
+# any notice of this special exception to the GPL from your modified version.
+
+# The input file is in the following format:
+# [CODE SYMBOL...]
+# @errnos@
+# [CODE SYMBOL...]
+#
+# The difference between the sections is how symbol is transformed.
+# The second section gets GPG_ERR_ prepended before processing.
+#
+# Comments (starting with # and ending at the end of the line) are removed,
+# as is trailing whitespace.
+
+BEGIN {
+ FS="[ \t]+";
+ print ";;;; Output of mkerrcodes.awk. DO NOT EDIT.";
+ print "";
+ print ";;; Copyright (C) 2006 g10 Code GmbH";
+ print ";;;";
+ print ";;; This file is part of libgpg-error.";
+ print ";;;";
+ print ";;; libgpg-error is free software; you can redistribute it and/or";
+ print ";;; modify it under the terms of the GNU Lesser General Public License";
+ print ";;; as published by the Free Software Foundation; either version 2.1 of";
+ print ";;; the License, or (at your option) any later version.";
+ print ";;;";
+ print ";;; libgpg-error is distributed in the hope that it will be useful, but";
+ print ";;; WITHOUT ANY WARRANTY; without even the implied warranty of";
+ print ";;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU";
+ print ";;; Lesser General Public License for more details.";
+ print ";;;";
+ print ";;; You should have received a copy of the GNU Lesser General Public";
+ print ";;; License along with libgpg-error; if not, write to the Free";
+ print ";;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA";
+ print ";;; 02111-1307, USA.";
+ print "";
+
+ header = 1;
+ errnos = 0;
+}
+
+/^#/ { next; }
+
+header {
+ if (errnos)
+ {
+ if ($1 ~ /^[0123456789]+$/)
+ {
+ header = 0;
+
+ print "";
+ print " ;; The following error codes map system errors.";
+ }
+ }
+ else
+ {
+ if ($1 ~ /^[0123456789]+$/)
+ {
+ header = 0;
+
+ print "(in-package :gpg-error)";
+ print "";
+ print ";;; The error code type gpg-err-code-t.";
+ print "";
+ print ";;; This is used for system error codes.";
+ print "(defconstant +gpg-err-system-error+ (ash 1 15))";
+ print "";
+ print ";;; This is one more than the largest allowed entry.";
+ print "(defconstant +gpg-err-code-dim+ 65536)";
+ print "";
+ print ";;; A helper macro to have the keyword values evaluated.";
+ print "(defmacro defcenum-eval (type doc &rest vals)";
+ print " `(defcenum ,type ,doc";
+ print " ,@(loop for v in vals";
+ print " collect `(,(first v) ,(eval (second v))))))";
+ print "";
+ print "(defcenum-eval gpg-err-code-t";
+ print " \"The GPG error code type.\"";
+ }
+ }
+}
+
+!header {
+ sub (/\#.+/, "");
+ sub (/[ ]+$/, ""); # Strip trailing space and tab characters.
+
+ if (/^$/)
+ next;
+
+ # The following can happen for GPG_ERR_CODE_DIM.
+ if ($1 == "")
+ next;
+
+ if (/^@errnos@$/)
+ {
+ header = 1;
+ errnos = 1;
+ next;
+ }
+
+ $2 = tolower($2);
+ gsub ("_", "-", $2);
+
+ if (errnos)
+ print " (:gpg-err-" $2 " (logior +gpg-err-system-error+ " $1 "))";
+ else
+ print " (:" $2 " " $1 ")";
+}
+
+END {
+ # I am very sorry to break lisp coding style here.
+ print ")";
+}
diff --git a/libgpg-error.spec.in b/libgpg-error.spec.in
new file mode 100644
index 0000000..abbf24e
--- /dev/null
+++ b/libgpg-error.spec.in
@@ -0,0 +1,57 @@
+# This is a template. The dist target uses it to create the real file.
+Summary: libgpg-error
+Name: libgpg-error
+Version: @pkg_version@
+Release: 1
+URL: ftp://ftp.gnupg.org/gcrypt/alpha/libgpg-error/
+Source: ftp://ftp.gnupg.org/gcrypt/alpha/libgpg-error/%{name}-%{version}.tar.gz
+Group: Development/Libraries
+Copyright: LGPL
+BuildRoot: %{_tmppath}/%{name}-%{version}
+BuildRequires: make
+Prereq: /sbin/ldconfig
+
+%description
+This is a library that defines common error values for all GnuPG
+components. Among these are GPG, GPGSM, GPGME, GPG-Agent, libgcrypt,
+pinentry, SmartCard Daemon and possibly more in the future.
+
+%prep
+%setup -q
+
+%build
+CFLAGS="$RPM_OPT_FLAGS"; export CFLAGS
+./configure --prefix=/usr
+make
+
+%install
+rm -fr $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT
+make install prefix=$RPM_BUILD_ROOT/usr
+
+%clean
+rm -fr $RPM_BUILD_ROOT
+make distclean
+
+%post
+/sbin/ldconfig
+
+%postun
+/sbin/ldconfig
+
+%files
+%defattr(-,root,root)
+%doc COPYING COPYING.LIB AUTHORS README INSTALL NEWS ChangeLog
+%attr(0755,root,root) %{_bindir}/gpg-error-config
+%attr(0755,root,root) %{_bindir}/gpg-error
+%attr(0755,root,root) %{_libdir}/*gpg-error.so*
+%attr(0755,root,root) %{_libdir}/*gpg-error.la
+%attr(0644,root,root) %{_libdir}/*gpg-error.a
+%{_includedir}/gpg-error.h
+%{_datadir}/aclocal/gpg-error.m4
+
+%changelog
+* Wed Sep 3 2003 Robert Schiele <[email protected]>
+- initial specfile.
+
+# EOF
diff --git a/m4/ChangeLog-2011 b/m4/ChangeLog-2011
new file mode 100644
index 0000000..d803b60
--- /dev/null
+++ b/m4/ChangeLog-2011
@@ -0,0 +1,113 @@
+2011-12-01 Werner Koch <[email protected]>
+
+ NB: ChangeLog files are no longer manually maintained. Starting
+ on December 1st, 2011 we put change information only in the GIT
+ commit log, and generate a top-level ChangeLog file from logs at
+ "make dist". See doc/HACKING for details.
+
+2010-09-16 gettextize <[email protected]>
+
+ * gettext.m4: Upgrade to gettext-0.17.
+ * iconv.m4: Upgrade to gettext-0.17.
+ * lib-link.m4: Upgrade to gettext-0.17.
+ * po.m4: Upgrade to gettext-0.17.
+
+2006-11-23 gettextize <[email protected]>
+
+ * gettext.m4: Upgrade to gettext-0.15.
+ * inttypes-h.m4: New file, from gettext-0.15.
+ * inttypes-pri.m4: Upgrade to gettext-0.15.
+ * lib-link.m4: Upgrade to gettext-0.15.
+ * lib-prefix.m4: Upgrade to gettext-0.15.
+ * lock.m4: New file, from gettext-0.15.
+ * longdouble.m4: Upgrade to gettext-0.15.
+ * nls.m4: Upgrade to gettext-0.15.
+ * po.m4: Upgrade to gettext-0.15.
+ * size_max.m4: Upgrade to gettext-0.15.
+ * visibility.m4: New file, from gettext-0.15.
+ * Makefile.am (EXTRA_DIST): Add the new files.
+
+2006-09-14 Werner Koch <[email protected]>
+
+ * autobuild.m4: New.
+
+2006-03-14 gettextize <[email protected]>
+
+ * codeset.m4: Upgrade to gettext-0.14.5.
+ * gettext.m4: Upgrade to gettext-0.14.5.
+ * glibc2.m4: New file, from gettext-0.14.5.
+ * glibc21.m4: Upgrade to gettext-0.14.5.
+ * iconv.m4: Upgrade to gettext-0.14.5.
+ * intdiv0.m4: Upgrade to gettext-0.14.5.
+ * intmax.m4: New file, from gettext-0.14.5.
+ * inttypes.m4: Upgrade to gettext-0.14.5.
+ * inttypes_h.m4: Upgrade to gettext-0.14.5.
+ * inttypes-pri.m4: Upgrade to gettext-0.14.5.
+ * isc-posix.m4: Upgrade to gettext-0.14.5.
+ * lcmessage.m4: Upgrade to gettext-0.14.5.
+ * lib-ld.m4: Upgrade to gettext-0.14.5.
+ * lib-link.m4: Upgrade to gettext-0.14.5.
+ * lib-prefix.m4: Upgrade to gettext-0.14.5.
+ * longdouble.m4: New file, from gettext-0.14.5.
+ * longlong.m4: New file, from gettext-0.14.5.
+ * nls.m4: Upgrade to gettext-0.14.5.
+ * po.m4: Upgrade to gettext-0.14.5.
+ * printf-posix.m4: New file, from gettext-0.14.5.
+ * progtest.m4: Upgrade to gettext-0.14.5.
+ * signed.m4: New file, from gettext-0.14.5.
+ * size_max.m4: New file, from gettext-0.14.5.
+ * stdint_h.m4: Upgrade to gettext-0.14.5.
+ * uintmax_t.m4: Upgrade to gettext-0.14.5.
+ * ulonglong.m4: Upgrade to gettext-0.14.5.
+ * wchar_t.m4: New file, from gettext-0.14.5.
+ * wint_t.m4: New file, from gettext-0.14.5.
+ * xsize.m4: New file, from gettext-0.14.5.
+ * Makefile.am (EXTRA_DIST): Add the new files.
+
+2005-10-02 Marcus Brinkmann <[email protected]>
+
+ * libtool.m4: Update.
+
+2004-03-01 Marcus Brinkmann <[email protected]>
+
+ * Makefile.am (EXTRA_DIST): Add ac_prog_cc_for_build.m4.
+ * ac_prog_cc_for_build.m4: New file.
+
+2003-12-08 Werner Koch <[email protected]>
+
+ * libtool.m4: Added (CVS only).
+
+2003-12-08 gettextize <[email protected]>
+
+ * gettext.m4: Upgrade to gettext-0.12.1.
+ * inttypes_h.m4: Upgrade to gettext-0.12.1.
+ * lib-ld.m4: Upgrade to gettext-0.12.1.
+ * lib-link.m4: Upgrade to gettext-0.12.1.
+ * lib-prefix.m4: Upgrade to gettext-0.12.1.
+ * nls.m4: New file, from gettext-0.12.1.
+ * po.m4: New file, from gettext-0.12.1.
+ * progtest.m4: Upgrade to gettext-0.12.1.
+ * stdint_h.m4: Upgrade to gettext-0.12.1.
+ * uintmax_t.m4: Upgrade to gettext-0.12.1.
+ * Makefile.am (EXTRA_DIST): Add the new files.
+
+2003-05-15 gettextize <[email protected]>
+
+ * codeset.m4: New file, from gettext-0.11.5.
+ * gettext.m4: New file, from gettext-0.11.5.
+ * glibc21.m4: New file, from gettext-0.11.5.
+ * iconv.m4: New file, from gettext-0.11.5.
+ * intdiv0.m4: New file, from gettext-0.11.5.
+ * inttypes.m4: New file, from gettext-0.11.5.
+ * inttypes_h.m4: New file, from gettext-0.11.5.
+ * inttypes-pri.m4: New file, from gettext-0.11.5.
+ * isc-posix.m4: New file, from gettext-0.11.5.
+ * lcmessage.m4: New file, from gettext-0.11.5.
+ * lib-ld.m4: New file, from gettext-0.11.5.
+ * lib-link.m4: New file, from gettext-0.11.5.
+ * lib-prefix.m4: New file, from gettext-0.11.5.
+ * progtest.m4: New file, from gettext-0.11.5.
+ * stdint_h.m4: New file, from gettext-0.11.5.
+ * uintmax_t.m4: New file, from gettext-0.11.5.
+ * ulonglong.m4: New file, from gettext-0.11.5.
+ * Makefile.am: New file.
diff --git a/m4/Makefile.am b/m4/Makefile.am
new file mode 100644
index 0000000..2f16e46
--- /dev/null
+++ b/m4/Makefile.am
@@ -0,0 +1,3 @@
+EXTRA_DIST = inttypes-h.m4 lock.m4 visibility.m4 glibc2.m4 intmax.m4 longdouble.m4 longlong.m4 printf-posix.m4 signed.m4 size_max.m4 wchar_t.m4 wint_t.m4 xsize.m4 ac_prog_cc_for_build.m4 nls.m4 po.m4 codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4
+
+EXTRA_DIST += autobuild.m4 estream.m4
diff --git a/m4/ac_prog_cc_for_build.m4 b/m4/ac_prog_cc_for_build.m4
new file mode 100644
index 0000000..32329c7
--- /dev/null
+++ b/m4/ac_prog_cc_for_build.m4
@@ -0,0 +1,149 @@
+dnl Available from the GNU Autoconf Macro Archive at:
+dnl https://www.gnu.org/software/ac-archive/htmldoc/ac_prog_cc_for_build.html
+dnl
+dnl All content of this archive is free software;
+dnl you can redistribute it and/or modify it under the terms of the GNU
+dnl General Public License as published by the Free Software Foundation;
+dnl either version 2, or (at your option) any later version.
+dnl
+dnl As a special exception, the respective Autoconf Macro's copyright
+dnl owner gives unlimited permission to copy, distribute and modify the
+dnl configure scripts that are the output of Autoconf when processing the
+dnl Macro. You need not follow the terms of the GNU General Public License
+dnl when using or distributing such scripts, even though portions of the
+dnl text of the Macro appear in them. The GNU General Public License (GPL)
+dnl does govern all other use of the material that constitutes the
+dnl Autoconf Macro.
+dnl
+dnl This special exception to the GPL applies to versions of the Autoconf
+dnl Macro released by the GNU Autoconf Macro Archive. When you make and
+dnl distribute a modified version of the Autoconf Macro, you may extend
+dnl this special exception to the GPL to apply to your modified version as
+dnl well.
+
+dnl Synopsis AC_PROG_CC_FOR_BUILD
+dnl
+dnl This macro searches for a C compiler that generates native
+dnl executables, that is a C compiler that surely is not a cross-compiler.
+dnl This can be useful if you have to generate source code at compile-time
+dnl like for example GCC does.
+dnl
+dnl The macro sets the CC_FOR_BUILD and CPP_FOR_BUILD macros to anything
+dnl needed to compile or link (CC_FOR_BUILD) and preprocess
+dnl (CPP_FOR_BUILD). The value of these variables can be overridden by
+dnl the user by specifying a compiler with an environment variable (like
+dnl you do for standard CC).
+dnl
+dnl It also sets BUILD_EXEEXT and BUILD_OBJEXT to the executable and
+dnl object file extensions for the build platform, and GCC_FOR_BUILD
+dnl to `yes' if the compiler we found is GCC. All these variables but
+dnl GCC_FOR_BUILD are substituted in the Makefile.
+dnl
+dnl Author Paolo Bonzini <[email protected]>
+dnl
+AC_DEFUN([AC_PROG_CC_FOR_BUILD], [dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_CPP])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl
+dnl
+pushdef([AC_TRY_COMPILER], [
+cat > conftest.$ac_ext << EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+[$1]
+EOF
+# If we can't run a trivial program, we are probably using a cross
+compiler.
+# Fail miserably.
+if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} && (./conftest;
+exit) 2>/dev/null; then
+ [$2]=yes
+else
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat conftest.$ac_ext >&AC_FD_CC
+ [$2]=no
+fi
+[$3]=no
+rm -fr conftest*])dnl
+
+dnl Use the standard macros, but make them use other variable names
+dnl
+pushdef([cross_compiling], [#])dnl
+pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl
+pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl
+pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl
+pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl
+pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl
+pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl
+pushdef([ac_cv_objext], ac_cv_build_objext)dnl
+pushdef([ac_exeext], ac_build_exeext)dnl
+pushdef([ac_objext], ac_build_objext)dnl
+pushdef([CC], CC_FOR_BUILD)dnl
+pushdef([CPP], CPP_FOR_BUILD)dnl
+pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl
+pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl
+pushdef([host], build)dnl
+pushdef([host_alias], build_alias)dnl
+pushdef([host_cpu], build_cpu)dnl
+pushdef([host_vendor], build_vendor)dnl
+pushdef([host_os], build_os)dnl
+pushdef([ac_cv_host], ac_cv_build)dnl
+pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl
+pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl
+pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl
+pushdef([ac_cv_host_os], ac_cv_build_os)dnl
+pushdef([ac_cpp], ac_build_cpp)dnl
+pushdef([ac_compile], ac_build_compile)dnl
+pushdef([ac_link], ac_build_link)dnl
+
+dnl Defeat the anti-duplication mechanism
+dnl
+dnl undefine([AC_PROVIDE_AC_PROG_CPP])dnl
+dnl undefine([AC_PROVIDE_AC_PROG_C])dnl
+dnl undefine([AC_PROVIDE_AC_EXEEXT])dnl
+
+AC_PROG_CC
+AC_PROG_CPP
+AC_EXEEXT
+
+dnl Restore the old definitions
+dnl
+popdef([AC_TRY_COMPILER])dnl
+popdef([ac_link])dnl
+popdef([ac_compile])dnl
+popdef([ac_cpp])dnl
+popdef([ac_cv_host_os])dnl
+popdef([ac_cv_host_vendor])dnl
+popdef([ac_cv_host_cpu])dnl
+popdef([ac_cv_host_alias])dnl
+popdef([ac_cv_host])dnl
+popdef([host_os])dnl
+popdef([host_vendor])dnl
+popdef([host_cpu])dnl
+popdef([host_alias])dnl
+popdef([host])dnl
+popdef([CPPFLAGS])dnl
+popdef([CFLAGS])dnl
+popdef([CPP])dnl
+popdef([CC])dnl
+popdef([ac_objext])dnl
+popdef([ac_exeext])dnl
+popdef([ac_cv_objext])dnl
+popdef([ac_cv_exeext])dnl
+popdef([ac_cv_prog_cc_g])dnl
+popdef([ac_cv_prog_cc_works])dnl
+popdef([ac_cv_prog_cc_cross])dnl
+popdef([ac_cv_prog_gcc])dnl
+popdef([ac_cv_prog_CPP])dnl
+popdef([cross_compiling])dnl
+
+dnl Finally, set Makefile variables
+dnl
+BUILD_EXEEXT=$ac_build_exeext
+BUILD_OBJEXT=$ac_build_objext
+AC_SUBST(BUILD_EXEEXT)dnl
+AC_SUBST(BUILD_OBJEXT)dnl
+AC_SUBST([CFLAGS_FOR_BUILD])dnl
+AC_SUBST([CPPFLAGS_FOR_BUILD])dnl
+])
diff --git a/m4/autobuild.m4 b/m4/autobuild.m4
new file mode 100644
index 0000000..bd1f4dc
--- /dev/null
+++ b/m4/autobuild.m4
@@ -0,0 +1,34 @@
+# autobuild.m4 serial 2 (autobuild-3.3)
+# Copyright (C) 2004 Simon Josefsson
+#
+# This file is free software, distributed under the terms of the GNU
+# General Public License. As a special exception to the GNU General
+# Public License, this file may be distributed as part of a program
+# that contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# This file can can be used in projects which are not available under
+# the GNU General Public License or the GNU Library General Public
+# License but which still want to provide support for Autobuild.
+
+# Usage: AB_INIT([MODE]).
+AC_DEFUN([AB_INIT],
+[
+ AC_REQUIRE([AC_CANONICAL_BUILD])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ AC_MSG_NOTICE([autobuild project... ${PACKAGE_NAME:-$PACKAGE}])
+ AC_MSG_NOTICE([autobuild revision... ${PACKAGE_VERSION:-$VERSION}])
+ hostname=`hostname`
+ if test "$hostname"; then
+ AC_MSG_NOTICE([autobuild hostname... $hostname])
+ fi
+ ifelse([$1],[],,[AC_MSG_NOTICE([autobuild mode... $1])])
+ date=`date +%Y%m%d-%H%M%S`
+ if test "$?" != 0; then
+ date=`date`
+ fi
+ if test "$date"; then
+ AC_MSG_NOTICE([autobuild timestamp... $date])
+ fi
+])
diff --git a/m4/codeset.m4 b/m4/codeset.m4
new file mode 100644
index 0000000..a6e67ec
--- /dev/null
+++ b/m4/codeset.m4
@@ -0,0 +1,21 @@
+# codeset.m4 serial AM1 (gettext-0.10.40)
+dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([AM_LANGINFO_CODESET],
+[
+ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
+ [AC_TRY_LINK([#include <langinfo.h>],
+ [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 <langinfo.h> and nl_langinfo(CODESET).])
+ fi
+])
diff --git a/m4/estream.m4 b/m4/estream.m4
new file mode 100644
index 0000000..402ef74
--- /dev/null
+++ b/m4/estream.m4
@@ -0,0 +1,49 @@
+dnl Autoconf macros for libestream
+dnl Copyright (C) 2007 g10 Code GmbH
+dnl
+dnl This file is free software; as a special exception the author gives
+dnl unlimited permission to copy and/or distribute it, with or without
+dnl modifications, as long as this notice is preserved.
+dnl
+dnl This file is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+
+dnl estream_PRINTF_INIT
+dnl Prepare build of source included estream-printf.c
+dnl
+AC_DEFUN([estream_PRINTF_INIT],
+[
+ AC_MSG_NOTICE([checking system features for estream-printf])
+ AC_CHECK_HEADERS(stdint.h)
+ AC_TYPE_LONG_LONG_INT
+ AC_TYPE_LONG_DOUBLE
+ AC_TYPE_INTMAX_T
+ AC_TYPE_UINTMAX_T
+ AC_CHECK_TYPES([ptrdiff_t])
+ AC_CHECK_SIZEOF([unsigned long])
+ AC_CHECK_SIZEOF([void *])
+ AC_CACHE_CHECK([for nl_langinfo and THOUSANDS_SEP],
+ estream_cv_langinfo_thousands_sep,
+ [AC_TRY_LINK([#include <langinfo.h>],
+ [char* cs = nl_langinfo(THOUSANDS_SEP); return !cs;],
+ estream_cv_langinfo_thousands_sep=yes,
+ estream_cv_langinfo_thousands_sep=no)
+ ])
+ if test $estream_cv_langinfo_thousands_sep = yes; then
+ AC_DEFINE(HAVE_LANGINFO_THOUSANDS_SEP, 1,
+ [Define if you have <langinfo.h> and nl_langinfo(THOUSANDS_SEP).])
+ fi
+])
+
+
+dnl estream_INIT
+dnl Prepare build of source included estream.c
+dnl
+AC_DEFUN([estream_INIT],
+[
+ AC_REQUIRE([estream_PRINTF_INIT])
+ AC_MSG_NOTICE([checking system features for estream])
+ AC_CHECK_FUNCS([memrchr])
+])
diff --git a/m4/gettext.m4 b/m4/gettext.m4
new file mode 100644
index 0000000..be247bf
--- /dev/null
+++ b/m4/gettext.m4
@@ -0,0 +1,401 @@
+# gettext.m4 serial 66 (gettext-0.18.2)
+dnl Copyright (C) 1995-2014 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+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 <[email protected]>, 1995-2000.
+dnl Bruno Haible <[email protected]>, 2000-2006, 2008-2010.
+
+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 <inttypes.h> 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(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
+ [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])])
+ 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],
+ ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
+ [yes]))
+ define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
+ gt_NEEDS_INIT
+ AM_GNU_GETTEXT_NEED([$2])
+
+ 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 { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "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 Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
+ gt_INTL_MACOSX
+
+ dnl Set USE_NLS.
+ AC_REQUIRE([AM_NLS])
+
+ ifelse(gt_included_intl, yes, [
+ BUILD_INCLUDED_LIBINTL=no
+ USE_INCLUDED_LIBINTL=no
+ ])
+ LIBINTL=
+ LTLIBINTL=
+ POSUB=
+
+ dnl Add a version number to the cache macros.
+ case " $gt_needs " in
+ *" need-formatstring-macros "*) gt_api_version=3 ;;
+ *" need-ngettext "*) gt_api_version=2 ;;
+ *) gt_api_version=1 ;;
+ esac
+ gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
+ gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
+
+ 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.
+
+ if test $gt_api_version -ge 3; then
+ gt_revision_test_code='
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+'
+ else
+ gt_revision_test_code=
+ fi
+ if test $gt_api_version -ge 2; then
+ gt_expression_test_code=' + * ngettext ("", "", 0)'
+ else
+ gt_expression_test_code=
+ fi
+
+ AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern int *_nl_domain_bindings;
+ ]],
+ [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings
+ ]])],
+ [eval "$gt_func_gnugettext_libc=yes"],
+ [eval "$gt_func_gnugettext_libc=no"])])
+
+ if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "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_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_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);
+ ]],
+ [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+ ]])],
+ [eval "$gt_func_gnugettext_libintl=yes"],
+ [eval "$gt_func_gnugettext_libintl=no"])
+ dnl Now see whether libintl exists and depends on libiconv.
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
+ LIBS="$LIBS $LIBICONV"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);
+ ]],
+ [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+ ]])],
+ [LIBINTL="$LIBINTL $LIBICONV"
+ LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+ eval "$gt_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 { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
+ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
+ && test "$PACKAGE" != gettext-runtime \
+ && test "$PACKAGE" != gettext-tools; }; then
+ gt_use_preinstalled_gnugettext=yes
+ else
+ 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 $LIBTHREAD"
+ LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
+ LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
+ fi
+
+ CATOBJEXT=
+ 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 -n "$INTL_MACOSX_LIBS"; then
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ dnl Some extra flags are needed during linking.
+ LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
+ LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
+ fi
+ fi
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes" \
+ || test "$nls_cv_use_gnu_gettext" = "yes"; then
+ 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 { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+ gt_source="external libintl"
+ else
+ gt_source="libc"
+ fi
+ else
+ gt_source="included intl directory"
+ fi
+ AC_MSG_RESULT([$gt_source])
+ fi
+
+ if test "$USE_NLS" = "yes"; then
+
+ if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+ if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+ 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.
+ INTLOBJS=
+ 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 gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
+m4_define([gt_NEEDS_INIT],
+[
+ m4_divert_text([DEFAULTS], [gt_needs=])
+ m4_define([gt_NEEDS_INIT], [])
+])
+
+
+dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
+AC_DEFUN([AM_GNU_GETTEXT_NEED],
+[
+ m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
+])
+
+
+dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
+AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
diff --git a/m4/glibc2.m4 b/m4/glibc2.m4
new file mode 100644
index 0000000..e8f5bfe
--- /dev/null
+++ b/m4/glibc2.m4
@@ -0,0 +1,30 @@
+# glibc2.m4 serial 1
+dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Test for the GNU C Library, version 2.0 or newer.
+# From Bruno Haible.
+
+AC_DEFUN([gt_GLIBC2],
+ [
+ AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer,
+ ac_cv_gnu_library_2,
+ [AC_EGREP_CPP([Lucky GNU user],
+ [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ >= 2)
+ Lucky GNU user
+ #endif
+#endif
+ ],
+ ac_cv_gnu_library_2=yes,
+ ac_cv_gnu_library_2=no)
+ ]
+ )
+ AC_SUBST(GLIBC2)
+ GLIBC2="$ac_cv_gnu_library_2"
+ ]
+)
diff --git a/m4/glibc21.m4 b/m4/glibc21.m4
new file mode 100644
index 0000000..d95fd98
--- /dev/null
+++ b/m4/glibc21.m4
@@ -0,0 +1,30 @@
+# glibc21.m4 serial 3
+dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Test for the GNU C Library, version 2.1 or newer.
+# From Bruno Haible.
+
+AC_DEFUN([gl_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 <features.h>
+#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 100644
index 0000000..4b29c5f
--- /dev/null
+++ b/m4/iconv.m4
@@ -0,0 +1,268 @@
+# iconv.m4 serial 18 (gettext-0.18.2)
+dnl Copyright (C) 2000-2002, 2007-2014 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl 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).
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ 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_LINK_IFELSE will then fail, the second AC_LINK_IFELSE 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_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <stdlib.h>
+#include <iconv.h>
+ ]],
+ [[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_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <stdlib.h>
+#include <iconv.h>
+ ]],
+ [[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_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
+ dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
+ dnl Solaris 10.
+ am_save_LIBS="$LIBS"
+ if test $am_cv_lib_iconv = yes; then
+ LIBS="$LIBS $LIBICONV"
+ fi
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <iconv.h>
+#include <string.h>
+int main ()
+{
+ int result = 0;
+ /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
+ returns. */
+ {
+ iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
+ if (cd_utf8_to_88591 != (iconv_t)(-1))
+ {
+ static const char input[] = "\342\202\254"; /* EURO SIGN */
+ char buf[10];
+ const char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_utf8_to_88591,
+ (char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res == 0)
+ result |= 1;
+ iconv_close (cd_utf8_to_88591);
+ }
+ }
+ /* Test against Solaris 10 bug: Failures are not distinguishable from
+ successful returns. */
+ {
+ iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
+ if (cd_ascii_to_88591 != (iconv_t)(-1))
+ {
+ static const char input[] = "\263";
+ char buf[10];
+ const char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_ascii_to_88591,
+ (char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res == 0)
+ result |= 2;
+ iconv_close (cd_ascii_to_88591);
+ }
+ }
+ /* Test against AIX 6.1..7.1 bug: Buffer overrun. */
+ {
+ iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
+ if (cd_88591_to_utf8 != (iconv_t)(-1))
+ {
+ static const char input[] = "\304";
+ static char buf[2] = { (char)0xDE, (char)0xAD };
+ const char *inptr = input;
+ size_t inbytesleft = 1;
+ char *outptr = buf;
+ size_t outbytesleft = 1;
+ size_t res = iconv (cd_88591_to_utf8,
+ (char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
+ result |= 4;
+ iconv_close (cd_88591_to_utf8);
+ }
+ }
+#if 0 /* This bug could be worked around by the caller. */
+ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
+ {
+ iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
+ if (cd_88591_to_utf8 != (iconv_t)(-1))
+ {
+ static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+ char buf[50];
+ const char *inptr = input;
+ size_t inbytesleft = strlen (input);
+ char *outptr = buf;
+ size_t outbytesleft = sizeof (buf);
+ size_t res = iconv (cd_88591_to_utf8,
+ (char **) &inptr, &inbytesleft,
+ &outptr, &outbytesleft);
+ if ((int)res > 0)
+ result |= 8;
+ iconv_close (cd_88591_to_utf8);
+ }
+ }
+#endif
+ /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+ provided. */
+ if (/* Try standardized names. */
+ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
+ /* Try IRIX, OSF/1 names. */
+ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
+ /* Try AIX names. */
+ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
+ /* Try HP-UX names. */
+ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
+ result |= 16;
+ return result;
+}]])],
+ [am_cv_func_iconv_works=yes],
+ [am_cv_func_iconv_works=no],
+ [
+changequote(,)dnl
+ case "$host_os" in
+ aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+ *) am_cv_func_iconv_works="guessing yes" ;;
+ esac
+changequote([,])dnl
+ ])
+ LIBS="$am_save_LIBS"
+ ])
+ case "$am_cv_func_iconv_works" in
+ *no) am_func_iconv=no am_cv_lib_iconv=no ;;
+ *) am_func_iconv=yes ;;
+ esac
+ else
+ am_func_iconv=no am_cv_lib_iconv=no
+ fi
+ if test "$am_func_iconv" = yes; then
+ AC_DEFINE([HAVE_ICONV], [1],
+ [Define if you have the iconv() function and it works.])
+ 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])
+])
+
+dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
+dnl avoid warnings like
+dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
+dnl This is tricky because of the way 'aclocal' is implemented:
+dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
+dnl Otherwise aclocal's initial scan pass would miss the macro definition.
+dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
+dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
+dnl warnings.
+m4_define([gl_iconv_AC_DEFUN],
+ m4_version_prereq([2.64],
+ [[AC_DEFUN_ONCE(
+ [$1], [$2])]],
+ [m4_ifdef([gl_00GNULIB],
+ [[AC_DEFUN_ONCE(
+ [$1], [$2])]],
+ [[AC_DEFUN(
+ [$1], [$2])]])]))
+gl_iconv_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_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+#else
+size_t iconv();
+#endif
+ ]],
+ [[]])],
+ [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([
+ $am_cv_proto_iconv])
+ AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
+ [Define as const if the declaration of iconv() needs const.])
+ dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
+ m4_ifdef([gl_ICONV_H_DEFAULTS],
+ [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+ if test -n "$am_cv_proto_iconv_arg1"; then
+ ICONV_CONST="const"
+ fi
+ ])
+ fi
+])
diff --git a/m4/intdiv0.m4 b/m4/intdiv0.m4
new file mode 100644
index 0000000..b8d7817
--- /dev/null
+++ b/m4/intdiv0.m4
@@ -0,0 +1,70 @@
+# intdiv0.m4 serial 1 (gettext-0.11.3)
+dnl Copyright (C) 2002 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl 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 <stdlib.h>
+#include <signal.h>
+
+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 100644
index 0000000..d99c999
--- /dev/null
+++ b/m4/intmax.m4
@@ -0,0 +1,30 @@
+# intmax.m4 serial 2 (gettext-0.14.2)
+dnl Copyright (C) 2002-2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl 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([gl_AC_HEADER_INTTYPES_H])
+ AC_REQUIRE([gl_AC_HEADER_STDINT_H])
+ AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
+ [AC_TRY_COMPILE([
+#include <stddef.h>
+#include <stdlib.h>
+#if HAVE_STDINT_H_WITH_UINTMAX
+#include <stdint.h>
+#endif
+#if HAVE_INTTYPES_H_WITH_UINTMAX
+#include <inttypes.h>
+#endif
+], [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 <stdint.h> or <inttypes.h>.])
+ fi
+])
diff --git a/m4/inttypes-h.m4 b/m4/inttypes-h.m4
new file mode 100644
index 0000000..d7ec94c
--- /dev/null
+++ b/m4/inttypes-h.m4
@@ -0,0 +1,25 @@
+# inttypes-h.m4 serial 1 (gettext-0.15)
+dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
+# <sys/types.h>.
+
+AC_DEFUN([gl_HEADER_INTTYPES_H],
+[
+ AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h,
+ [
+ AC_TRY_COMPILE(
+ [#include <sys/types.h>
+#include <inttypes.h>],
+ [], gl_cv_header_inttypes_h=yes, gl_cv_header_inttypes_h=no)
+ ])
+ if test $gl_cv_header_inttypes_h = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
+ [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
+ fi
+])
diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4
new file mode 100644
index 0000000..ef00da7
--- /dev/null
+++ b/m4/inttypes-pri.m4
@@ -0,0 +1,30 @@
+# inttypes-pri.m4 serial 2 (gettext-0.15)
+dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+# Define PRI_MACROS_BROKEN if <inttypes.h> 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([gl_HEADER_INTTYPES_H])
+ if test $gl_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 <inttypes.h>
+#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 <inttypes.h> exists and defines unusable PRI* macros.])
+ fi
+])
diff --git a/m4/inttypes.m4 b/m4/inttypes.m4
new file mode 100644
index 0000000..779bcea
--- /dev/null
+++ b/m4/inttypes.m4
@@ -0,0 +1,25 @@
+# inttypes.m4 serial 1 (gettext-0.11.4)
+dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
+# <sys/types.h>.
+
+AC_DEFUN([gt_HEADER_INTTYPES_H],
+[
+ AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
+ [
+ AC_TRY_COMPILE(
+ [#include <sys/types.h>
+#include <inttypes.h>],
+ [], 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 <inttypes.h> exists and doesn't clash with <sys/types.h>.])
+ fi
+])
diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4
new file mode 100644
index 0000000..a5d075d
--- /dev/null
+++ b/m4/inttypes_h.m4
@@ -0,0 +1,26 @@
+# inttypes_h.m4 serial 6
+dnl Copyright (C) 1997-2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
+[
+ AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h,
+ [AC_TRY_COMPILE(
+ [#include <sys/types.h>
+#include <inttypes.h>],
+ [uintmax_t i = (uintmax_t) -1;],
+ gl_cv_header_inttypes_h=yes,
+ gl_cv_header_inttypes_h=no)])
+ if test $gl_cv_header_inttypes_h = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
+ [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
+ and declares uintmax_t. ])
+ fi
+])
diff --git a/m4/isc-posix.m4 b/m4/isc-posix.m4
new file mode 100644
index 0000000..74dc8f2
--- /dev/null
+++ b/m4/isc-posix.m4
@@ -0,0 +1,24 @@
+# isc-posix.m4 serial 2 (gettext-0.11.2)
+dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# 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 100644
index 0000000..19aa77e
--- /dev/null
+++ b/m4/lcmessage.m4
@@ -0,0 +1,30 @@
+# lcmessage.m4 serial 4 (gettext-0.14.2)
+dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+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 <[email protected]>, 1995.
+
+# Check whether LC_MESSAGES is available in <locale.h>.
+
+AC_DEFUN([gt_LC_MESSAGES],
+[
+ AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES,
+ [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+ gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)])
+ if test $gt_cv_val_LC_MESSAGES = yes; then
+ AC_DEFINE(HAVE_LC_MESSAGES, 1,
+ [Define if your <locale.h> file defines LC_MESSAGES.])
+ fi
+])
diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4
new file mode 100644
index 0000000..ddc569f
--- /dev/null
+++ b/m4/lib-ld.m4
@@ -0,0 +1,119 @@
+# lib-ld.m4 serial 6
+dnl Copyright (C) 1996-2003, 2009-2014 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Subroutines of libtool.m4,
+dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
+dnl collision with libtool.m4.
+
+dnl From libtool-2.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 lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ acl_cv_prog_gnu_ld=yes
+ ;;
+*)
+ acl_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$acl_cv_prog_gnu_ld
+])
+
+dnl From libtool-2.4. Sets the variable LD.
+AC_DEFUN([AC_LIB_PROG_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_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])dnl
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+ # contains only /bin. Note that ksh looks also at the FPATH variable,
+ # so we have to set that as well for the test.
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ || PATH_SEPARATOR=';'
+ }
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ 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([acl_cv_path_LD],
+[if test -z "$LD"; then
+ acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$acl_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ acl_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_ifs"
+else
+ acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+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 100644
index 0000000..3522d99
--- /dev/null
+++ b/m4/lib-link.m4
@@ -0,0 +1,777 @@
+# lib-link.m4 serial 26 (gettext-0.18.2)
+dnl Copyright (C) 2001-2014 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_PREREQ([2.54])
+
+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.
+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_LINKFLAGS],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+ pushdef([Name],[m4_translit([$1],[./+-], [____])])
+ pushdef([NAME],[m4_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"
+ ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
+ ])
+ LIB[]NAME="$ac_cv_lib[]Name[]_libs"
+ LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
+ INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
+ LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
+ AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+ AC_SUBST([LIB]NAME)
+ AC_SUBST([LTLIB]NAME)
+ AC_SUBST([LIB]NAME[_PREFIX])
+ 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
+ popdef([NAME])
+ popdef([Name])
+])
+
+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
+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. The missing-message
+dnl defaults to 'no' and may contain additional hints for the user.
+dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
+dnl and 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.
+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+ AC_REQUIRE([AC_LIB_RPATH])
+ pushdef([Name],[m4_translit([$1],[./+-], [____])])
+ pushdef([NAME],[m4_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"
+ dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
+ dnl because these -l options might require -L options that are present in
+ dnl LIBS. -l options benefit only from the -L options listed before it.
+ dnl Otherwise, add it to the front of LIBS, because it may be a static
+ dnl library that depends on another static library that is present in LIBS.
+ dnl Static libraries benefit only from the static libraries listed after
+ dnl it.
+ case " $LIB[]NAME" in
+ *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
+ *) LIBS="$LIB[]NAME $LIBS" ;;
+ esac
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[$3]], [[$4]])],
+ [ac_cv_lib[]Name=yes],
+ [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
+ 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 lib][$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=
+ LIB[]NAME[]_PREFIX=
+ fi
+ AC_SUBST([HAVE_LIB]NAME)
+ AC_SUBST([LIB]NAME)
+ AC_SUBST([LTLIB]NAME)
+ AC_SUBST([LIB]NAME[_PREFIX])
+ popdef([NAME])
+ popdef([Name])
+])
+
+dnl Determine the platform dependent parameters needed to use rpath:
+dnl acl_libext,
+dnl acl_shlibext,
+dnl acl_libname_spec,
+dnl acl_library_names_spec,
+dnl acl_hardcode_libdir_flag_spec,
+dnl acl_hardcode_libdir_separator,
+dnl acl_hardcode_direct,
+dnl acl_hardcode_minus_L.
+AC_DEFUN([AC_LIB_RPATH],
+[
+ dnl Tell automake >= 1.10 to complain if config.rpath is missing.
+ m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.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"
+ acl_libext="$acl_cv_libext"
+ acl_shlibext="$acl_cv_shlibext"
+ acl_libname_spec="$acl_cv_libname_spec"
+ acl_library_names_spec="$acl_cv_library_names_spec"
+ acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+ acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+ acl_hardcode_direct="$acl_cv_hardcode_direct"
+ acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
+ 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_FROMPACKAGE(name, package)
+dnl declares that libname comes from the given package. The configure file
+dnl will then not have a --with-libname-prefix option but a
+dnl --with-package-prefix option. Several libraries can come from the same
+dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
+dnl macro call that searches for libname.
+AC_DEFUN([AC_LIB_FROMPACKAGE],
+[
+ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+ define([acl_frompackage_]NAME, [$2])
+ popdef([NAME])
+ pushdef([PACK],[$2])
+ pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+ define([acl_libsinpackage_]PACKUP,
+ m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
+ popdef([PACKUP])
+ popdef([PACK])
+])
+
+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.
+dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
+dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
+[
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+ pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
+ pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+ pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
+ dnl Autoconf >= 2.61 supports dots in --with options.
+ pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
+ 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_ARG_WITH(P_A_C_K[-prefix],
+[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
+ --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ 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/$acl_libdirstem"
+ if test "$acl_libdirstem2" != "$acl_libdirstem" \
+ && ! test -d "$withval/$acl_libdirstem"; then
+ additional_libdir="$withval/$acl_libdirstem2"
+ fi
+ 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=
+ LIB[]NAME[]_PREFIX=
+ dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
+ dnl computed. So it has to be reset here.
+ HAVE_LIB[]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=
+ eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
+ if test -n "$acl_shlibext"; then
+ shrext=".$acl_shlibext" # typically: shrext=.so
+ else
+ shrext=
+ fi
+ if test $use_additional = yes; then
+ dir="$additional_libdir"
+ dnl The same code as in the loop below:
+ dnl First look for a shared library.
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ dnl Then look for a static library.
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ fi
+ if test "X$found_dir" = "X"; then
+ for x in $LDFLAGS $LTLIB[]NAME; do
+ AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+ case "$x" in
+ -L*)
+ dir=`echo "X$x" | sed -e 's/^X-L//'`
+ dnl First look for a shared library.
+ if test -n "$acl_shlibext"; then
+ if test -f "$dir/$libname$shrext"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext"
+ else
+ if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+ ver=`(cd "$dir" && \
+ for f in "$libname$shrext".*; do echo "$f"; done \
+ | sed -e "s,^$libname$shrext\\\\.,," \
+ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+ | sed 1q ) 2>/dev/null`
+ if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+ found_dir="$dir"
+ found_so="$dir/$libname$shrext.$ver"
+ fi
+ else
+ eval library_names=\"$acl_library_names_spec\"
+ for f in $library_names; do
+ if test -f "$dir/$f"; then
+ found_dir="$dir"
+ found_so="$dir/$f"
+ break
+ fi
+ done
+ fi
+ fi
+ fi
+ dnl Then look for a static library.
+ if test "X$found_dir" = "X"; then
+ if test -f "$dir/$libname.$acl_libext"; then
+ found_dir="$dir"
+ found_a="$dir/$libname.$acl_libext"
+ fi
+ fi
+ if test "X$found_dir" != "X"; then
+ if test -f "$dir/$libname.la"; then
+ found_la="$dir/$libname.la"
+ fi
+ fi
+ ;;
+ esac
+ if test "X$found_dir" != "X"; then
+ break
+ fi
+ done
+ fi
+ if test "X$found_dir" != "X"; then
+ 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/$acl_libdirstem" \
+ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; 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 "$acl_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 "$acl_hardcode_libdir_flag_spec" && test "$acl_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 "$acl_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 $acl_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
+ */$acl_libdirstem | */$acl_libdirstem/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+ if test "$name" = '$1'; then
+ LIB[]NAME[]_PREFIX="$basedir"
+ fi
+ additional_includedir="$basedir/include"
+ ;;
+ */$acl_libdirstem2 | */$acl_libdirstem2/)
+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
+ if test "$name" = '$1'; then
+ LIB[]NAME[]_PREFIX="$basedir"
+ fi
+ 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* | gnu* | k*bsd*-gnu) 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/$acl_libdirstem" \
+ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
+ haveit=
+ if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
+ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
+ if test -n "$GCC"; then
+ case $host_os in
+ linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+ esac
+ fi
+ fi
+ if test -z "$haveit"; then
+ haveit=
+ for x in $LDFLAGS $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 "$acl_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:+$acl_hardcode_libdir_separator}$found_dir"
+ done
+ dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$acl_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=\"$acl_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
+ popdef([P_A_C_K])
+ popdef([PACKLIBS])
+ popdef([PACKUP])
+ popdef([PACK])
+ popdef([NAME])
+])
+
+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
+])
+
+dnl For those cases where a variable contains several -L and -l options
+dnl referring to unknown libraries and directories, this macro determines the
+dnl necessary additional linker options for the runtime path.
+dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
+dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
+dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
+dnl otherwise linking without libtool is assumed.
+AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
+[
+ AC_REQUIRE([AC_LIB_RPATH])
+ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+ $1=
+ if test "$enable_rpath" != no; then
+ if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+ dnl Use an explicit option to hardcode directories into the resulting
+ dnl binary.
+ rpathdirs=
+ next=
+ for opt in $2; do
+ if test -n "$next"; then
+ dir="$next"
+ dnl No need to hardcode the standard /usr/lib.
+ if test "X$dir" != "X/usr/$acl_libdirstem" \
+ && test "X$dir" != "X/usr/$acl_libdirstem2"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ next=
+ else
+ case $opt in
+ -L) next=yes ;;
+ -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
+ dnl No need to hardcode the standard /usr/lib.
+ if test "X$dir" != "X/usr/$acl_libdirstem" \
+ && test "X$dir" != "X/usr/$acl_libdirstem2"; then
+ rpathdirs="$rpathdirs $dir"
+ fi
+ next= ;;
+ *) next= ;;
+ esac
+ fi
+ done
+ if test "X$rpathdirs" != "X"; then
+ if test -n ""$3""; then
+ dnl libtool is used for linking. Use -R options.
+ for dir in $rpathdirs; do
+ $1="${$1}${$1:+ }-R$dir"
+ done
+ else
+ dnl The linker is used for linking directly.
+ if test -n "$acl_hardcode_libdir_separator"; then
+ dnl Weird platform: only the last -rpath option counts, the user
+ dnl must pass all path elements in one option.
+ alldirs=
+ for dir in $rpathdirs; do
+ alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
+ done
+ acl_save_libdir="$libdir"
+ libdir="$alldirs"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ $1="$flag"
+ else
+ dnl The -rpath options are cumulative.
+ for dir in $rpathdirs; do
+ acl_save_libdir="$libdir"
+ libdir="$dir"
+ eval flag=\"$acl_hardcode_libdir_flag_spec\"
+ libdir="$acl_save_libdir"
+ $1="${$1}${$1:+ }$flag"
+ done
+ fi
+ fi
+ fi
+ fi
+ fi
+ AC_SUBST([$1])
+])
diff --git a/m4/lib-prefix.m4 b/m4/lib-prefix.m4
new file mode 100644
index 0000000..31f49e4
--- /dev/null
+++ b/m4/lib-prefix.m4
@@ -0,0 +1,224 @@
+# lib-prefix.m4 serial 7 (gettext-0.18)
+dnl Copyright (C) 2001-2005, 2008-2014 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl 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_MULTILIB])
+ 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/$acl_libdirstem"
+ 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* | gnu* | k*bsd*-gnu) 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/$acl_libdirstem"; 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/$acl_libdirstem"; 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"
+])
+
+dnl AC_LIB_PREPARE_MULTILIB creates
+dnl - a variable acl_libdirstem, containing the basename of the libdir, either
+dnl "lib" or "lib64" or "lib/64",
+dnl - a variable acl_libdirstem2, as a secondary possible value for
+dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
+dnl "lib/amd64".
+AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
+[
+ dnl There is no formal standard regarding lib and lib64.
+ dnl On glibc systems, the current practice is that on a system supporting
+ dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
+ dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
+ dnl the compiler's default mode by looking at the compiler's library search
+ dnl path. If at least one of its elements ends in /lib64 or points to a
+ dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
+ dnl Otherwise we use the default, namely "lib".
+ dnl On Solaris systems, the current practice is that on a system supporting
+ dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
+ dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
+ dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ acl_libdirstem=lib
+ acl_libdirstem2=
+ case "$host_os" in
+ solaris*)
+ dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
+ dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
+ dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
+ dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
+ dnl symlink is missing, so we set acl_libdirstem2 too.
+ AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
+ [AC_EGREP_CPP([sixtyfour bits], [
+#ifdef _LP64
+sixtyfour bits
+#endif
+ ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
+ ])
+ if test $gl_cv_solaris_64bit = yes; then
+ acl_libdirstem=lib/64
+ case "$host_cpu" in
+ sparc*) acl_libdirstem2=lib/sparcv9 ;;
+ i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
+ esac
+ fi
+ ;;
+ *)
+ searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+ if test -n "$searchpath"; then
+ acl_save_IFS="${IFS= }"; IFS=":"
+ for searchdir in $searchpath; do
+ if test -d "$searchdir"; then
+ case "$searchdir" in
+ */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+ */../ | */.. )
+ # Better ignore directories of this form. They are misleading.
+ ;;
+ *) searchdir=`cd "$searchdir" && pwd`
+ case "$searchdir" in
+ */lib64 ) acl_libdirstem=lib64 ;;
+ esac ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_IFS"
+ fi
+ ;;
+ esac
+ test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+])
diff --git a/m4/libtool.m4 b/m4/libtool.m4
new file mode 100644
index 0000000..0cd84af
--- /dev/null
+++ b/m4/libtool.m4
@@ -0,0 +1,8027 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool 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.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from https://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 57 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+ [m4_default([$3],
+ [m4_fatal([Libtool version $1 or higher is required],
+ 63)])],
+ [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+ *\ * | *\ *)
+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+m4_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 "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
+dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+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
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ _LT_PATH_MAGIC
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+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 delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME. Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+ [m4_ifval([$1], [$1], [$2])])
+ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+ m4_ifval([$4],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+ lt_dict_add_subkey([lt_decl_dict], [$2],
+ [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+ [0], [m4_fatal([$0: too few arguments: $#])],
+ [1], [m4_fatal([$0: too few arguments: $#: $1])],
+ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+ [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_if([$2], [],
+ m4_quote(lt_decl_varnames),
+ m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'. VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly. In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+# # Some comment about what VAR is for.
+# visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+ [description])))[]dnl
+m4_pushdef([_libtool_name],
+ m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+ [0], [_libtool_name=[$]$1],
+ [1], [_libtool_name=$lt_[]$1],
+ [2], [_libtool_name=$lt_[]$1],
+ [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'. Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+ dnl If the libtool generation code has been placed in $CONFIG_LT,
+ dnl instead of duplicating it all over again into config.status,
+ dnl then we will have config.status run $CONFIG_LT later, so it
+ dnl needs to know what name is stored there:
+ [AC_CONFIG_COMMANDS([libtool],
+ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+ dnl If the libtool generation code is destined for config.status,
+ dnl expand the accumulated commands and init code now:
+ [AC_CONFIG_COMMANDS([libtool],
+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# 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
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable. If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins. After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script. The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+ echo
+ AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+
+Report bugs to <[email protected]>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2011 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+ case $[1] in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+ *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+ esac
+ shift
+done
+
+if $lt_cl_silent; then
+ exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure. Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test "$silent" = yes &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, 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 TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+ m4_if(_LT_TAG, [C], [
+ # 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
+
+ cfgfile="${ofile}T"
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_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
+_LT_EOF
+ ;;
+ esac
+
+ _LT_PROG_LTMAIN
+
+ # 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)
+
+ _LT_PROG_REPLACE_SHELLFNS
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ TIMESTAMP='$TIMESTAMP'
+ RM='$RM'
+ ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+ [C], [_LT_LANG(C)],
+ [C++], [_LT_LANG(CXX)],
+ [Go], [_LT_LANG(GO)],
+ [Java], [_LT_LANG(GCJ)],
+ [Fortran 77], [_LT_LANG(F77)],
+ [Fortran], [_LT_LANG(FC)],
+ [Windows Resource], [_LT_LANG(RC)],
+ [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+ [_LT_LANG($1)],
+ [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+ [LT_SUPPORTED_TAG([$1])dnl
+ m4_append([_LT_TAGS], [$1 ])dnl
+ m4_define([_LT_LANG_]$1[_enabled], [])dnl
+ _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+m4_ifndef([AC_PROG_GO], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_GO. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+m4_defun([AC_PROG_GO],
+[AC_LANG_PUSH(Go)dnl
+AC_ARG_VAR([GOC], [Go compiler command])dnl
+AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+AC_CHECK_TOOL(GOC, gccgo)
+if test -z "$GOC"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
+ fi
+fi
+if test -z "$GOC"; then
+ AC_CHECK_PROG(GOC, gccgo, gccgo, false)
+fi
+])#m4_defun
+])#m4_ifndef
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [LT_LANG(CXX)],
+ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [LT_LANG(F77)],
+ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+ [LT_LANG(FC)],
+ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [m4_ifdef([AC_PROG_GCJ],
+ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([A][M_PROG_GCJ],
+ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([LT_PROG_GCJ],
+ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([AC_PROG_GO],
+ [LT_LANG(GO)],
+ [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+ [LT_LANG(RC)],
+ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])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_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_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.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_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
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+ AC_CHECK_TOOL([LIPO], [lipo], [:])
+ AC_CHECK_TOOL([OTOOL], [otool], [:])
+ AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+ _LT_DECL([], [DSYMUTIL], [1],
+ [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+ _LT_DECL([], [NMEDIT], [1],
+ [Tool to change global to local symbols on Mac OS X])
+ _LT_DECL([], [LIPO], [1],
+ [Tool to manipulate fat objects and archives on Mac OS X])
+ _LT_DECL([], [OTOOL], [1],
+ [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+ _LT_DECL([], [OTOOL64], [1],
+ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+ 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.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ # If there is a non-empty error log, and "single_module"
+ # appears in it, assume the flag caused a linker warning
+ if test -s conftest.err && $GREP single_module conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ # Otherwise, if the output was created with a 0 exit code from
+ # the compiler, it worked.
+ elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ 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"
+ ])
+
+ AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+ [lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+ echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+ echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+ $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -s conftest.err && $GREP force_load conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # 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" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+ m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ if test "$lt_cv_ld_force_load" = "yes"; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+ [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ case $cc_basename in
+ ifort*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test "$_lt_dar_can_shared" = "yes"; then
+ output_verbose_link_cmd=func_echo_all
+ _LT_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_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_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_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}"
+ m4_if([$1], [CXX],
+[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ _LT_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_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
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# 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.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+ lt_aix_libpath_sed='[
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }]'
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`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 "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi],[])
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+ fi
+ ])
+ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+case "$ECHO" in
+ printf*) AC_MSG_RESULT([printf]) ;;
+ print*) AC_MSG_RESULT([print -r]) ;;
+ *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test "X`printf %s $ECHO`" = "X$ECHO" \
+ || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[ --with-sysroot[=DIR] Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted. We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ AC_MSG_RESULT([${with_sysroot}])
+ AC_MSG_ERROR([The sysroot must be an absolute path.])
+ ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and in which our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AS_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 '$LINENO' "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*|s390*-*tpf*|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"
+ ;;
+ powerpc64le-*)
+ LD="${LD-ld} -m elf32lppclinux"
+ ;;
+ powerpc64-*)
+ 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"
+ ;;
+ powerpcle-*)
+ LD="${LD-ld} -m elf64lppc"
+ ;;
+ powerpc-*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ 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_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[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
+ ;;
+*-*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*)
+ case $host in
+ i?86-*-solaris*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ sparc*-*-solaris*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+ LD="${LD-ld}_sol2"
+ fi
+ ;;
+ *)
+ 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*
+ ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+ [lt_cv_ar_at_file=no
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ [echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+ ])
+ ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+ [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+ [Commands used to install an old-style archive])
+
+# 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 \$tool_oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+ [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+ [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ m4_if([$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:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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
+ m4_if([$5], , :, [$5])
+else
+ m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_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 "$_lt_linker_boilerplate" | $SED '/^$/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
+ m4_if([$4], , :, [$4])
+else
+ m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# 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* | cegcc*)
+ # 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;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ 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
+ ;;
+
+ os2*)
+ # The test takes a long time on OS/2.
+ lt_cv_sys_max_cmd_len=8192
+ ;;
+
+ 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
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8 ; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ 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
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+ [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_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 <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#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
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 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;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}]
+_LT_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_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_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* | cegcc*)
+ 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_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_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
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+ [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+ [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+ [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_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:$LINENO: $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:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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_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 ..
+ $RM -r conftest
+ $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+ [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_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
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_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
+_LT_DECL([], [objdir], [0],
+ [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+ test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+ test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+ # We can hardcode non-existent directories.
+ if test "$_LT_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_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+ test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; 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
+_LT_TAGDECL([], [hardcode_action], [0],
+ [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+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
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+ [], [
+if test "$GCC" = yes; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+ *) lt_sed_strip_eq="s,=/,/,g" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # 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 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # 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; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+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"
+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 # correct to gnu/linux during the next big refactor
+ 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 # correct to gnu/linux during the next big refactor
+ 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<name>.so
+ # instead of lib<name>.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*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ ;;
+ m68k)
+ 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=`func_echo_all "$lib" | $SED '\''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'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ 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* | cegcc*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ 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~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ 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}'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ 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
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH.
+ 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
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # 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'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # 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}${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 # correct to gnu/linux during the next big refactor
+ 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
+ ;;
+
+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[[23]].*) 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 # correct to gnu/linux during the next big refactor
+ 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
+ ;;
+
+haiku*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ 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=LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ 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'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[[3-9]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ 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 # correct to gnu/linux during the next big refactor
+ 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
+ ;;
+
+linux*android*)
+ version_type=none # Android doesn't support versioned libraries.
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext'
+ soname_spec='$libname$release$shared_ext'
+ finish_cmds=
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+
+ # 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
+
+ dynamic_linker='Android linker'
+ # Don't embed -rpath directories since the linker doesn't support them.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ 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
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+ [lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+ [lt_cv_shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+ ])
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # 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;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 # correct to gnu/linux during the next big refactor
+ 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=qnx
+ 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='ldqnx.so'
+ ;;
+
+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 # correct to gnu/linux during the next big refactor
+ 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 # correct to gnu/linux during the next big refactor
+ 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
+ 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 # correct to gnu/linux during the next big refactor
+ 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
+ shlibpath_overrides_runpath=yes
+ 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'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ 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'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ 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
+
+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
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+ [Variables whose values should be saved in libtool wrapper scripts and
+ restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+ [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+ [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+ [[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]])
+_LT_DECL([], [soname_spec], [1],
+ [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+ [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+ [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+ [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+ [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+ [[As "finish_cmds", except a single script fragment to be evaled but
+ not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+ [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+ [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+ [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_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="m4_if([$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 <<_LT_EOF 1>&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
+
+_LT_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
+_LT_DECL([], [MAGIC_CMD], [0],
+ [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_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
+ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_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])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 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_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])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+ if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/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
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+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
+ ;;
+
+haiku*)
+ 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])(-bit)?( [LM]SB)? 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 glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-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=pass_all
+ ;;
+
+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
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ 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
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+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
+
+_LT_DECL([], [deplibs_check_method], [1],
+ [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+ [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+ [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (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
+ : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+ NM="$lt_cv_path_NM"
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+ case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+ AC_SUBST([DUMPBIN])
+ if test "$DUMPBIN" != ":"; then
+ NM="$DUMPBIN"
+ fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+ [lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+ cat conftest.out >&AS_MESSAGE_LOG_FD
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+ [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+ [lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-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_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ case $cc_basename in
+ nvcc*)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+ esac
+
+ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+ [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# 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]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ 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
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \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\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+
+# 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
+
+# Try without a prefix underscore, 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.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function
+ # and D for any global variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK ['"\
+" {last_section=section; section=\$ 3};"\
+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+" s[1]~/^[@?]/{print s[1], s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx]"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $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 <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT@&t@_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT@&t@_DLSYM_CONST
+#else
+# define LT@&t@_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT@&t@_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_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_globsym_save_LIBS
+ CFLAGS=$lt_globsym_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
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+ [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+ [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+ [lt_cv_sys_global_symbol_to_c_name_address], [1],
+ [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+ [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([], [nm_file_list_spec], [1],
+ [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_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_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # 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_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # 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_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_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $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_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ *)
+ _LT_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_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_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
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # 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_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_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_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64 which still supported -KPIC.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_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_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd* | netbsdelf*-gnu)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_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_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_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_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # 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_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # 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_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_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ 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_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+ if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
+ fi
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # 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_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_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_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+ case $cc_basename in
+ # old Intel for x86_64 which still supported -KPIC.
+ ecc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ ccc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ *Sun\ F* | *Sun*Fortran*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ *Intel*\ [[CF]]*Compiler*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ *Portland\ Group*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ rdos*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ unicos*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ [Additional compiler flags for building library objects])
+
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ 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
+ # Also, AIX nm treats weak defined symbols like other global defined
+ # symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_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_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw* | cegcc*)
+ case $cc_basename in
+ cl*)
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | gnu*)
+ _LT_TAGVAR(link_all_deplibs, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+], [
+ runpath_var=
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)=
+ _LT_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_TAGVAR(compiler_needs_object, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(hardcode_automatic, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(inherit_rpath, $1)=no
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(module_cmds, $1)=
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_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_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=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ linux* | k*bsd*-gnu | gnu*)
+ _LT_TAGVAR(link_all_deplibs, $1)=no
+ ;;
+ esac
+
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test "$with_gnu_ld" = yes; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+ *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test "$lt_use_gnu_ld_interface" = 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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_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_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [[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_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, 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 install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <[email protected]> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_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_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED \"$sed_uncomment_deffile\" $export_symbols | $SED 1q`" = 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_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_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_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_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* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test "$host_os" = linux-dietlibc; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test "$tmp_diet" = no
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$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' ;;
+ lf95*) # Lahey Fortran 8.1
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ tmp_sharedflag='--shared' ;;
+ xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_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
+
+ case $cc_basename in
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_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~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $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_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&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.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_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_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
+ ;;
+ *)
+ # 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.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_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_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+ runpath_var=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_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_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_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_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_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
+ # Also, AIX nm treats weak defined symbols like other global
+ # defined symbols, whereas GNU nm marks them as "W".
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_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_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ 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_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_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=no
+ 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
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_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_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_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 func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_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_SYS_MODULE_PATH_AIX([$1])
+ _LT_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_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_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*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[[45]]*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # 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_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED \"$sed_uncomment_deffile\" $export_symbols | $SED 1q`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_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_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $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_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2.*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${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_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_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_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ m4_if($1, [], [
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ _LT_LINKER_OPTION([if $CC understands -b],
+ _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+ [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+ [_LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_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_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+ [lt_cv_irix_exported_symbol],
+ [save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(
+ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+ [C++], [[int foo (void) { return 0; }]],
+ [Fortran 77], [[
+ subroutine foo
+ end]],
+ [Fortran], [[
+ subroutine foo
+ end]])])],
+ [lt_cv_irix_exported_symbol=yes],
+ [lt_cv_irix_exported_symbol=no])
+ LDFLAGS="$save_LDFLAGS"])
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd* | netbsdelf*-gnu)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_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_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_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'
+ ;;
+ *)
+ wlarc='${wl}'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_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} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_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_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ _LT_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_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_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_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ if test x$host_vendor = xsni; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+ [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_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_CACHE_CHECK([whether -lc should be explicitly linked in],
+ [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+ [$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_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+ then
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ ])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+ [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+ [enable_shared_with_static_runtimes], [0],
+ [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+ [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+ [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+ [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+ [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+ [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+ [Commands used to build a loadable module if different from building
+ a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+ [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+ [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+ [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+ [Flag to hardcode $libdir into a binary during linking.
+ This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+ [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+ [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ DIR into the resulting binary and the resulting library dependency is
+ "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+ library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+ [Set to "yes" if building a shared library automatically hardcodes DIR
+ into the library and all subsequent libraries and executables linked
+ against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+ [Set to yes if linker adds runtime paths of dependent libraries
+ to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+ [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+ [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+ [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+ [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+ [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+ [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+ [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+ [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+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_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_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+ LT_SYS_DLOPEN_SELF
+ _LT_CMD_STRIPLIB
+
+ # 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])
+
+ _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+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
+else
+ _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+ # 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_TAG_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_CFLAGS=$CFLAGS
+ 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++"}
+ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+ else
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+ fi
+
+ if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ LT_PATH_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_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_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_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_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_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 -v "^Configured with:" | $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_TAGVAR(ld_shlibs, $1)=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_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_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+ 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_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_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_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
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ _LT_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_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_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 func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_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_SYS_MODULE_PATH_AIX([$1])
+ _LT_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_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ if test "$with_gnu_ld" = yes; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared
+ # libraries.
+ _LT_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_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <[email protected]> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # 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_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED \"$sed_uncomment_deffile\" $export_symbols | $SED 1q`" = xEXPORTS; then
+ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_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_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED \"$sed_uncomment_deffile\" $export_symbols | $SED 1q`" = 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_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ freebsd2.*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ freebsd-elf*)
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ gnu*)
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ hpux9*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_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_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_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) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${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_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_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_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_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; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${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_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_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_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_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_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-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_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_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ fi
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-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_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_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; func_echo_all "$list"'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_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_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # 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_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_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_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_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_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_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'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_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=`func_echo_all "$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; func_echo_all "X$list" | $Xsed'
+ ;;
+ xl* | mpixl* | bgxl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ if test "x$supports_anon_versioning" = xyes; then
+ _LT_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 -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+
+ # 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_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_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::"'
+ ;;
+
+ *nto* | *qnx*)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ openbsd*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_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_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_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=func_echo_all
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ osf3* | 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_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_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ ;;
+ esac
+
+ _LT_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=`func_echo_all "$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; func_echo_all "$list"'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ case $host in
+ osf3*)
+ _LT_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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_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 -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_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_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_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_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='func_echo_all'
+
+ # 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_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_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_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_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag -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 -v "^Configured with:" | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_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 -v "^Configured with:" | $GREP "\-L"'
+ fi
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_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_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_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.
+ _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+ '"$_LT_TAGVAR(old_archive_cmds, $1)"
+ _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+ '"$_LT_TAGVAR(reload_cmds, $1)"
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$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_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+ test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+ _LT_TAGVAR(GCC, $1)="$GXX"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ 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
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+# _LT_SYS_HIDDEN_LIBDEPS([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.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+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...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+_LT_EOF
+], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
+package foo
+func foo() {
+}
+_LT_EOF
+])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case ${prev}${p} in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" ||
+ test $p = "-R"; then
+ prev=$p
+ continue
+ fi
+
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test "$pre_test_object_deps_done" = no; then
+ case ${prev} in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+ _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ prev=
+ ;;
+
+ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+ _LT_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+ _LT_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_TAGVAR(predep_objects,$1)=
+ _LT_TAGVAR(postdep_objects,$1)=
+ _LT_TAGVAR(postdeps,$1)=
+ ;;
+
+linux*)
+ case `$CC -V 2>&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_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # 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_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+ [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+ [Dependencies to place before and after the objects being linked to
+ create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+ [The library search path used internally by the compiler when linking
+ a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+ _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_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_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+ # 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_TAG_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_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${F77-"f77"}
+ CFLAGS=$FFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+ GCC=$G77
+ if test -n "$compiler"; then
+ 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_TAGVAR(GCC, $1)="$G77"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC="$lt_save_CC"
+ CFLAGS="$lt_save_CFLAGS"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+ _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+ # 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_TAG_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_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${FC-"f95"}
+ CFLAGS=$FCFLAGS
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ 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_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+ _LT_TAGVAR(LD, $1)="$LD"
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_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_TAG_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_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_GO_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Go compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GO_CONFIG],
+[AC_REQUIRE([LT_PROG_GO])dnl
+AC_LANG_SAVE
+
+# Source file extension for Go test sources.
+ac_ext=go
+
+# Object file extension for compiled Go test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="package main; func main() { }"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='package main; func main() { }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_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_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GOC-"gccgo"}
+CFLAGS=$GOFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# Go did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GO_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_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_TAG_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_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+ :
+ _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+ [AC_CHECK_TOOL(GCJ, gcj,)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_GO
+# ----------
+AC_DEFUN([LT_PROG_GO],
+[AC_CHECK_TOOL(GOC, gccgo,)
+])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+ [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# 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. #
+############################################################
+
+m4_defun([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])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval 'test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+ && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+ >/dev/null 2>&1 \
+ && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
+
+
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+ func_split_long_opt_name=${1%%=*}
+ func_split_long_opt_arg=${1#*=}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+ func_split_short_opt_arg=${1#??}
+ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+
+ _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
+
+ _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
+
+ _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+ func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+ eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
+
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine which file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+ [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+ [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/m4/lock.m4 b/m4/lock.m4
new file mode 100644
index 0000000..73a3c54
--- /dev/null
+++ b/m4/lock.m4
@@ -0,0 +1,42 @@
+# lock.m4 serial 13 (gettext-0.18.2)
+dnl Copyright (C) 2005-2014 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_LOCK],
+[
+ AC_REQUIRE([gl_THREADLIB])
+ if test "$gl_threads_api" = posix; then
+ # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
+ # pthread_rwlock_* functions.
+ AC_CHECK_TYPE([pthread_rwlock_t],
+ [AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
+ [Define if the POSIX multithreading library has read/write locks.])],
+ [],
+ [#include <pthread.h>])
+ # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [[#include <pthread.h>]],
+ [[
+#if __FreeBSD__ == 4
+error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
+#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
+ && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
+error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
+#else
+int x = (int)PTHREAD_MUTEX_RECURSIVE;
+return !x;
+#endif
+ ]])],
+ [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1],
+ [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
+ fi
+ gl_PREREQ_LOCK
+])
+
+# Prerequisites of lib/glthread/lock.c.
+AC_DEFUN([gl_PREREQ_LOCK], [:])
diff --git a/m4/longdouble.m4 b/m4/longdouble.m4
new file mode 100644
index 0000000..25590f4
--- /dev/null
+++ b/m4/longdouble.m4
@@ -0,0 +1,31 @@
+# longdouble.m4 serial 2 (gettext-0.15)
+dnl Copyright (C) 2002-2003, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether the compiler supports the 'long double' type.
+dnl Prerequisite: AC_PROG_CC
+
+dnl This file is only needed in autoconf <= 2.59. Newer versions of autoconf
+dnl have a macro AC_TYPE_LONG_DOUBLE with identical semantics.
+
+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 100644
index 0000000..7b399e0
--- /dev/null
+++ b/m4/longlong.m4
@@ -0,0 +1,23 @@
+# longlong.m4 serial 5
+dnl Copyright (C) 1999-2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# Define HAVE_LONG_LONG if 'long long' works.
+
+AC_DEFUN([gl_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/ltoptions.m4 b/m4/ltoptions.m4
new file mode 100644
index 0000000..5d9acd8
--- /dev/null
+++ b/m4/ltoptions.m4
@@ -0,0 +1,384 @@
+# Helper functions for option handling. -*- Autoconf -*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# 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 7 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it. Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+ _LT_MANGLE_DEFUN([$1], [$2]),
+ [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+ [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME. If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+ dnl
+ dnl Simply set some default values (i.e off) if boolean options were not
+ dnl specified:
+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+ ])
+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+ ])
+ dnl
+ dnl If no reference was made to various pairs of opposing options, then
+ dnl we run the default mode handler for the pair. For example, if neither
+ dnl `shared' nor `disable-shared' was passed, we enable building of shared
+ dnl archives by default:
+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+ [_LT_ENABLE_FAST_INSTALL])
+ ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS], [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]_LT_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=]_LT_ENABLE_SHARED_DEFAULT)
+
+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
+ [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]_LT_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=]_LT_ENABLE_STATIC_DEFAULT)
+
+ _LT_DECL([build_old_libs], [enable_static], [0],
+ [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]_LT_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=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+ [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+ [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for lt_pkg in $withval; do
+ IFS="$lt_save_ifs"
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+ [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+ [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+ [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+ [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+ [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4
new file mode 100644
index 0000000..9000a05
--- /dev/null
+++ b/m4/ltsugar.m4
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# 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 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+ [$#], [2], [[$2]],
+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+ [$#], 1, [],
+ [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+ m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+ [m4_foreach([_Lt_suffix],
+ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+ [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+ [lt_append([$1], [$2], [$3])$4],
+ [$5])],
+ [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+ m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+ m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+ [$5],
+ [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+ [lt_join(m4_quote(m4_default([$4], [[, ]])),
+ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
new file mode 100644
index 0000000..07a8602
--- /dev/null
+++ b/m4/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers -*- Autoconf -*-
+#
+# Copyright (C) 2004 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004
+#
+# 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.
+
+# @configure_input@
+
+# serial 3337 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4.2])
+m4_define([LT_PACKAGE_REVISION], [1.3337])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.4.2'
+macro_revision='1.3337'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4
new file mode 100644
index 0000000..c573da9
--- /dev/null
+++ b/m4/lt~obsolete.m4
@@ -0,0 +1,98 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004.
+#
+# 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 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else. This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/m4/nls.m4 b/m4/nls.m4
new file mode 100644
index 0000000..53cdc8b
--- /dev/null
+++ b/m4/nls.m4
@@ -0,0 +1,32 @@
+# nls.m4 serial 5 (gettext-0.18)
+dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+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 <[email protected]>, 1995-2000.
+dnl Bruno Haible <[email protected]>, 2000-2003.
+
+AC_PREREQ([2.50])
+
+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])
+])
diff --git a/m4/po.m4 b/m4/po.m4
new file mode 100644
index 0000000..84659ea
--- /dev/null
+++ b/m4/po.m4
@@ -0,0 +1,453 @@
+# po.m4 serial 22 (gettext-0.19)
+dnl Copyright (C) 1995-2014 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+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 <[email protected]>, 1995-2000.
+dnl Bruno Haible <[email protected]>, 2000-2003.
+
+AC_PREREQ([2.60])
+
+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([AC_PROG_MKDIR_P])dnl
+ AC_REQUIRE([AC_PROG_SED])dnl
+ AC_REQUIRE([AM_NLS])dnl
+
+ dnl Release version of the gettext macros. This is used to ensure that
+ dnl the gettext macros and po/Makefile.in.in are in sync.
+ AC_SUBST([GETTEXT_MACRO_VERSION], [0.19])
+
+ 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 >&]AS_MESSAGE_LOG_FD[ 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 Test whether it is GNU msgfmt >= 0.15.
+changequote(,)dnl
+ case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
+ *) MSGFMT_015=$MSGFMT ;;
+ esac
+changequote([,])dnl
+ AC_SUBST([MSGFMT_015])
+changequote(,)dnl
+ case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
+ *) GMSGFMT_015=$GMSGFMT ;;
+ esac
+changequote([,])dnl
+ AC_SUBST([GMSGFMT_015])
+
+ 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 >&]AS_MESSAGE_LOG_FD[ 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 Test whether it is GNU xgettext >= 0.15.
+changequote(,)dnl
+ case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
+ *) XGETTEXT_015=$XGETTEXT ;;
+ esac
+changequote([,])dnl
+ AC_SUBST([XGETTEXT_015])
+
+ 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 >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
+
+ dnl Installation directories.
+ dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
+ dnl have to define it here, so that it can be used in po/Makefile.
+ test -n "$localedir" || localedir='${datadir}/locale'
+ AC_SUBST([localedir])
+
+ dnl Support for AM_XGETTEXT_OPTION.
+ test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
+ AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
+
+ AC_CONFIG_COMMANDS([po-directories], [[
+ for ac_file in $CONFIG_FILES; do
+ # Support "outfile[:infile[:infile...]]"
+ case "$ac_file" in
+ *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ esac
+ # PO directories have a Makefile.in generated from Makefile.in.in.
+ case "$ac_file" in */Makefile.in)
+ # Adjust a relative srcdir.
+ ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+ ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
+ ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+ # In autoconf-2.13 it is called $ac_given_srcdir.
+ # In autoconf-2.50 it is called $srcdir.
+ test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+ case "$ac_given_srcdir" in
+ .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+ /*) top_srcdir="$ac_given_srcdir" ;;
+ *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+ # Treat a directory as a PO directory if and only if it has a
+ # POTFILES.in file. This allows packages to have multiple PO
+ # directories under different names or in different locations.
+ if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
+ rm -f "$ac_dir/POTFILES"
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
+ gt_tab=`printf '\t'`
+ cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+ POMAKEFILEDEPS="POTFILES.in"
+ # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
+ # on $ac_dir but don't depend on user-specified configuration
+ # parameters.
+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+ # The LINGUAS file contains the set of available languages.
+ if test -n "$OBSOLETE_ALL_LINGUAS"; then
+ test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+ fi
+ ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+ # Hide the ALL_LINGUAS assignment from automake < 1.5.
+ eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+ else
+ # The set of available languages was given in configure.in.
+ # Hide the ALL_LINGUAS assignment from automake < 1.5.
+ eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
+ fi
+ # Compute POFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+ # Compute UPDATEPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+ # Compute DUMMYPOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+ # Compute GMOFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+ case "$ac_given_srcdir" in
+ .) srcdirpre= ;;
+ *) srcdirpre='$(srcdir)/' ;;
+ esac
+ POFILES=
+ UPDATEPOFILES=
+ DUMMYPOFILES=
+ GMOFILES=
+ for lang in $ALL_LINGUAS; do
+ POFILES="$POFILES $srcdirpre$lang.po"
+ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+ DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+ GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+ done
+ # CATALOGS depends on both $ac_dir and the user's LINGUAS
+ # environment variable.
+ INST_LINGUAS=
+ if test -n "$ALL_LINGUAS"; then
+ for presentlang in $ALL_LINGUAS; do
+ useit=no
+ if test "%UNSET%" != "$LINGUAS"; then
+ desiredlanguages="$LINGUAS"
+ else
+ desiredlanguages="$ALL_LINGUAS"
+ fi
+ for desiredlang in $desiredlanguages; do
+ # Use the presentlang catalog if desiredlang is
+ # a. equal to presentlang, or
+ # b. a variant of presentlang (because in this case,
+ # presentlang can be used as a fallback for messages
+ # which are not translated in the desiredlang catalog).
+ case "$desiredlang" in
+ "$presentlang"*) useit=yes;;
+ esac
+ done
+ if test $useit = yes; then
+ INST_LINGUAS="$INST_LINGUAS $presentlang"
+ fi
+ done
+ fi
+ CATALOGS=
+ if test -n "$INST_LINGUAS"; then
+ for lang in $INST_LINGUAS; do
+ CATALOGS="$CATALOGS $lang.gmo"
+ done
+ fi
+ test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
+ sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
+ for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
+ if test -f "$f"; then
+ case "$f" in
+ *.orig | *.bak | *~) ;;
+ *) cat "$f" >> "$ac_dir/Makefile" ;;
+ esac
+ fi
+ done
+ fi
+ ;;
+ esac
+ done]],
+ [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
+ # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
+ # from automake < 1.5.
+ eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
+ # Capture the value of LINGUAS because we need it to compute CATALOGS.
+ LINGUAS="${LINGUAS-%UNSET%}"
+ ])
+])
+
+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 <<EOT
+$*
+EOT
+ }
+ gt_echo='echo_func'
+ fi
+ fi
+
+ # A sed script that extracts the value of VARIABLE from a Makefile.
+ tab=`printf '\t'`
+ sed_x_variable='
+# Test if the hold space is empty.
+x
+s/P/P/
+x
+ta
+# Yes it was empty. Look if we have the expected variable definition.
+/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{
+ # Seen the first line of the variable definition.
+ s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=//
+ ba
+}
+bd
+:a
+# Here we are processing a line from the variable definition.
+# Remove comment, more precisely replace it with a space.
+s/#.*$/ /
+# See if the line ends in a backslash.
+tb
+:b
+s/\\$//
+# Print the line, without the trailing backslash.
+p
+tc
+# There was no trailing backslash. The end of the variable definition is
+# reached. Clear the hold space.
+s/^.*$//
+x
+bd
+:c
+# A trailing backslash means that the variable definition continues in the
+# next line. Put a nonempty string into the hold space to indicate this.
+s/^.*$/P/
+x
+:d
+'
+changequote([,])dnl
+
+ # Set POTFILES to the value of the Makefile variable POTFILES.
+ sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
+ POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
+ # Compute POTFILES_DEPS as
+ # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
+ POTFILES_DEPS=
+ for file in $POTFILES; do
+ POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
+ done
+ POMAKEFILEDEPS=""
+
+ 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
+ if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+ # The LINGUAS file contains the set of available languages.
+ ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+ POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+ else
+ # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
+ sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
+ ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
+ fi
+ # Hide the ALL_LINGUAS assignment from automake < 1.5.
+ eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+ # 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)
+ # Compute PROPERTIESFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
+ # Compute CLASSFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
+ # Compute QMFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
+ # Compute MSGFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
+ # Compute RESOURCESDLLFILES
+ # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
+ case "$ac_given_srcdir" in
+ .) srcdirpre= ;;
+ *) srcdirpre='$(srcdir)/' ;;
+ esac
+ POFILES=
+ UPDATEPOFILES=
+ DUMMYPOFILES=
+ GMOFILES=
+ PROPERTIESFILES=
+ CLASSFILES=
+ QMFILES=
+ MSGFILES=
+ RESOURCESDLLFILES=
+ 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"
+ PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
+ CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
+ QMFILES="$QMFILES $srcdirpre$lang.qm"
+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
+ frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+ RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
+ 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=
+ JAVACATALOGS=
+ QTCATALOGS=
+ TCLCATALOGS=
+ CSHARPCATALOGS=
+ if test -n "$INST_LINGUAS"; then
+ for lang in $INST_LINGUAS; do
+ CATALOGS="$CATALOGS $lang.gmo"
+ JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
+ QTCATALOGS="$QTCATALOGS $lang.qm"
+ frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+ TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
+ frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+ CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
+ done
+ fi
+
+ sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
+ tab=`printf '\t'`
+ 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" <<EOF
+$frobbedlang.msg: $lang.po
+${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
+${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+EOF
+ done
+ fi
+ if grep -l '@CSHARPCATALOGS@' "$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/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+ cat >> "$ac_file.tmp" <<EOF
+$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
+${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
+${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+EOF
+ done
+ fi
+ if test -n "$POMAKEFILEDEPS"; then
+ cat >> "$ac_file.tmp" <<EOF
+Makefile: $POMAKEFILEDEPS
+EOF
+ fi
+ mv "$ac_file.tmp" "$ac_file"
+])
+
+dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
+AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
+[
+ XGETTEXT_EXTRA_OPTIONS=
+])
+
+dnl Registers an option to be passed to xgettext in the po subdirectory.
+AC_DEFUN([AM_XGETTEXT_OPTION],
+[
+ AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
+ XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
+])
diff --git a/m4/printf-posix.m4 b/m4/printf-posix.m4
new file mode 100644
index 0000000..af10170
--- /dev/null
+++ b/m4/printf-posix.m4
@@ -0,0 +1,44 @@
+# printf-posix.m4 serial 2 (gettext-0.13.1)
+dnl Copyright (C) 2003 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether the printf() function supports POSIX/XSI format strings with
+dnl positions.
+
+AC_DEFUN([gt_PRINTF_POSIX],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
+ gt_cv_func_printf_posix,
+ [
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <string.h>
+/* The string "%2$d %1$d", with dollar characters protected from the shell's
+ dollar expansion (possibly an autoconf bug). */
+static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
+static char buf[100];
+int main ()
+{
+ sprintf (buf, format, 33, 55);
+ return (strcmp (buf, "55 33") != 0);
+}], 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 100644
index 0000000..b499f79
--- /dev/null
+++ b/m4/progtest.m4
@@ -0,0 +1,91 @@
+# progtest.m4 serial 7 (gettext-0.18.2)
+dnl Copyright (C) 1996-2003, 2005, 2008-2014 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+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 <[email protected]>, 1996.
+
+AC_PREREQ([2.50])
+
+# 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
+ # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+ # contains only /bin. Note that ksh looks also at the FPATH variable,
+ # so we have to set that as well for the test.
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ || PATH_SEPARATOR=';'
+ }
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+ ac_executable_p="test -x"
+else
+ ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "$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
+ echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
+ 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 100644
index 0000000..048f593
--- /dev/null
+++ b/m4/signed.m4
@@ -0,0 +1,17 @@
+# signed.m4 serial 1 (gettext-0.10.40)
+dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl 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 100644
index 0000000..029e471
--- /dev/null
+++ b/m4/size_max.m4
@@ -0,0 +1,60 @@
+# size_max.m4 serial 4
+dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl 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 <limits.h>
+#if HAVE_STDINT_H
+#include <stdint.h>
+#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'. Try hard to find a definition that can
+ dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
+ _AC_COMPUTE_INT([sizeof (size_t) * CHAR_BIT - 1], size_t_bits_minus_1,
+ [#include <stddef.h>
+#include <limits.h>], size_t_bits_minus_1=)
+ _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
+ [#include <stddef.h>], fits_in_uint=)
+ if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
+ 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 <stddef.h>
+ extern size_t foo;
+ extern unsigned long foo;
+ ], [], fits_in_uint=0)
+ fi
+ dnl We cannot use 'expr' to simplify this expression, because 'expr'
+ dnl works only with 'long' integers in the host environment, while we
+ dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
+ if test $fits_in_uint = 1; then
+ result="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
+ else
+ result="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
+ fi
+ else
+ dnl Shouldn't happen, but who knows...
+ result='((size_t)~(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 100644
index 0000000..3355f35
--- /dev/null
+++ b/m4/stdint_h.m4
@@ -0,0 +1,26 @@
+# stdint_h.m4 serial 5
+dnl Copyright (C) 1997-2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([gl_AC_HEADER_STDINT_H],
+[
+ AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h,
+ [AC_TRY_COMPILE(
+ [#include <sys/types.h>
+#include <stdint.h>],
+ [uintmax_t i = (uintmax_t) -1;],
+ gl_cv_header_stdint_h=yes,
+ gl_cv_header_stdint_h=no)])
+ if test $gl_cv_header_stdint_h = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
+ [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
+ and declares uintmax_t. ])
+ fi
+])
diff --git a/m4/threadlib.m4 b/m4/threadlib.m4
new file mode 100644
index 0000000..32c2ea5
--- /dev/null
+++ b/m4/threadlib.m4
@@ -0,0 +1,349 @@
+# threadlib.m4 serial 10 (gettext-0.18.2) modified by wk 2014-01-24.
+dnl Copyright (C) 2005-2014 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl gl_THREADLIB
+dnl ------------
+dnl Tests for a multithreading library to be used.
+dnl If the configure.ac contains a definition of the gl_THREADLIB_DEFAULT_NO
+dnl (it must be placed before the invocation of gl_THREADLIB_EARLY!), then the
+dnl default is 'no', otherwise it is system dependent. In both cases, the user
+dnl can change the choice through the options --enable-threads=choice or
+dnl --disable-threads.
+dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
+dnl USE_WINDOWS_THREADS
+dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
+dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
+dnl libtool).
+dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
+dnl programs that really need multithread functionality. The difference
+dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
+dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread".
+dnl Sets THREADLIB_CPPFLAGS to -D_REENTRANT or -D_THREAD_SAFE if needed for
+dnl multithread-safe programs and adds THREADLIB_CPPFLAGS to CPPFLAGS.
+
+AC_DEFUN([gl_THREADLIB_EARLY],
+[
+ AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
+])
+
+dnl The guts of gl_THREADLIB_EARLY. Needs to be expanded only once.
+
+AC_DEFUN([gl_THREADLIB_EARLY_BODY],
+[
+ dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
+ dnl influences the result of the autoconf tests that test for *_unlocked
+ dnl declarations, on AIX 5 at least. Therefore it must come early.
+ AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
+ AC_BEFORE([$0], [gl_ARGP])dnl
+
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
+ dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
+ dnl AC_GNU_SOURCE.
+ m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
+ [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
+ [AC_REQUIRE([AC_GNU_SOURCE])])
+ dnl Check for multithreading.
+ THREADLIB_CPPFLAGS=""
+ m4_ifdef([gl_THREADLIB_DEFAULT_NO],
+ [m4_divert_text([DEFAULTS], [gl_use_threads_default=no])],
+ [m4_divert_text([DEFAULTS], [gl_use_threads_default=])])
+ AC_ARG_ENABLE([threads],
+AC_HELP_STRING([--enable-threads={posix|solaris|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
+AC_HELP_STRING([--disable-threads], [build without multithread safety])]),
+ [gl_use_threads=$enableval],
+ [if test -n "$gl_use_threads_default"; then
+ gl_use_threads="$gl_use_threads_default"
+ else
+changequote(,)dnl
+ case "$host_os" in
+ dnl Disable multithreading by default on OSF/1, because it interferes
+ dnl with fork()/exec(): When msgexec is linked with -lpthread, its
+ dnl child process gets an endless segmentation fault inside execvp().
+ dnl Disable multithreading by default on Cygwin 1.5.x, because it has
+ dnl bugs that lead to endless loops or crashes. See
+ dnl <https://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
+ osf*) gl_use_threads=no ;;
+ cygwin*)
+ case `uname -r` in
+ 1.[0-5].*) gl_use_threads=no ;;
+ *) gl_use_threads=yes ;;
+ esac
+ ;;
+ *) gl_use_threads=yes ;;
+ esac
+changequote([,])dnl
+ fi
+ ])
+ if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
+ # For using <pthread.h>:
+ case "$host_os" in
+ osf*)
+ # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
+ # groks <pthread.h>. cc also understands the flag -pthread, but
+ # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
+ # 2. putting a flag into CPPFLAGS that has an effect on the linker
+ # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
+ # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
+ THREADLIB_CPPFLAGS="$THREADLIB_CPPFLAGS -D_REENTRANT"
+ ;;
+ esac
+ # Some systems optimize for single-threaded programs by default, and
+ # need special flags to disable these optimizations. For example, the
+ # definition of 'errno' in <errno.h>.
+ case "$host_os" in
+ aix* | freebsd*)
+ THREADLIB_CPPFLAGS="$THREADLIB_CPPFLAGS -D_THREAD_SAFE"
+ ;;
+ solaris*)
+ THREADLIB_CPPFLAGS="$THREADLIB_CPPFLAGS -D_REENTRANT"
+ ;;
+ esac
+ fi
+ if test x"$THREADLIB_CPPFLAGS" != x ; then
+ CPPFLAGS="$CPPFLAGS $THREADLIB_CPPFLAGS"
+ fi
+])
+
+dnl The guts of gl_THREADLIB. Needs to be expanded only once.
+
+AC_DEFUN([gl_THREADLIB_BODY],
+[
+ AC_REQUIRE([gl_THREADLIB_EARLY_BODY])
+ gl_threads_api=none
+ LIBTHREAD=
+ LTLIBTHREAD=
+ LIBMULTITHREAD=
+ LTLIBMULTITHREAD=
+ if test "$gl_use_threads" != no; then
+ dnl Check whether the compiler and linker support weak declarations.
+ AC_CACHE_CHECK([whether imported symbols can be declared weak],
+ [gl_cv_have_weak],
+ [gl_cv_have_weak=no
+ dnl First, test whether the compiler accepts it syntactically.
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern void xyzzy ();
+#pragma weak xyzzy]],
+ [[xyzzy();]])],
+ [gl_cv_have_weak=maybe])
+ if test $gl_cv_have_weak = maybe; then
+ dnl Second, test whether it actually works. On Cygwin 1.7.2, with
+ dnl gcc 4.3, symbols declared weak always evaluate to the address 0.
+ AC_RUN_IFELSE(
+ [AC_LANG_SOURCE([[
+#include <stdio.h>
+#pragma weak fputs
+int main ()
+{
+ return (fputs == NULL);
+}]])],
+ [gl_cv_have_weak=yes],
+ [gl_cv_have_weak=no],
+ [dnl When cross-compiling, assume that only ELF platforms support
+ dnl weak symbols.
+ AC_EGREP_CPP([Extensible Linking Format],
+ [#ifdef __ELF__
+ Extensible Linking Format
+ #endif
+ ],
+ [gl_cv_have_weak="guessing yes"],
+ [gl_cv_have_weak="guessing no"])
+ ])
+ fi
+ ])
+ if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
+ # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
+ # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
+ AC_CHECK_HEADER([pthread.h],
+ [gl_have_pthread_h=yes], [gl_have_pthread_h=no])
+ if test "$gl_have_pthread_h" = yes; then
+ # Other possible tests:
+ # -lpthreads (FSU threads, PCthreads)
+ # -lgthreads
+ gl_have_pthread=
+ # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
+ # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
+ # the second one only in libpthread, and lock.c needs it.
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <pthread.h>]],
+ [[pthread_mutex_lock((pthread_mutex_t*)0);
+ pthread_mutexattr_init((pthread_mutexattr_t*)0);]])],
+ [gl_have_pthread=yes])
+ # Test for libpthread by looking for pthread_kill. (Not pthread_self,
+ # since it is defined as a macro on OSF/1.)
+ if test -n "$gl_have_pthread"; then
+ # The program links fine without libpthread. But it may actually
+ # need to link with libpthread in order to create multiple threads.
+ AC_CHECK_LIB([pthread], [pthread_kill],
+ [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
+ # On Solaris and HP-UX, most pthread functions exist also in libc.
+ # Therefore pthread_in_use() needs to actually try to create a
+ # thread: pthread_create from libc will fail, whereas
+ # pthread_create will actually create a thread.
+ case "$host_os" in
+ solaris* | hpux*)
+ AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
+ [Define if the pthread_in_use() detection is hard.])
+ esac
+ ])
+ else
+ # Some library is needed. Try libpthread and libc_r.
+ AC_CHECK_LIB([pthread], [pthread_kill],
+ [gl_have_pthread=yes
+ LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
+ LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
+ if test -z "$gl_have_pthread"; then
+ # For FreeBSD 4.
+ AC_CHECK_LIB([c_r], [pthread_kill],
+ [gl_have_pthread=yes
+ LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
+ LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
+ fi
+ fi
+ if test -n "$gl_have_pthread"; then
+ gl_threads_api=posix
+ AC_DEFINE([USE_POSIX_THREADS], [1],
+ [Define if the POSIX multithreading library can be used.])
+ if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
+ if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
+ AC_DEFINE([USE_POSIX_THREADS_WEAK], [1],
+ [Define if references to the POSIX multithreading library should be made weak.])
+ LIBTHREAD=
+ LTLIBTHREAD=
+ fi
+ fi
+ fi
+ fi
+ fi
+ if test -z "$gl_have_pthread"; then
+ if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
+ gl_have_solaristhread=
+ gl_save_LIBS="$LIBS"
+ LIBS="$LIBS -lthread"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <thread.h>
+#include <synch.h>
+ ]],
+ [[thr_self();]])],
+ [gl_have_solaristhread=yes])
+ LIBS="$gl_save_LIBS"
+ if test -n "$gl_have_solaristhread"; then
+ gl_threads_api=solaris
+ LIBTHREAD=-lthread
+ LTLIBTHREAD=-lthread
+ LIBMULTITHREAD="$LIBTHREAD"
+ LTLIBMULTITHREAD="$LTLIBTHREAD"
+ AC_DEFINE([USE_SOLARIS_THREADS], [1],
+ [Define if the old Solaris multithreading library can be used.])
+ if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
+ AC_DEFINE([USE_SOLARIS_THREADS_WEAK], [1],
+ [Define if references to the old Solaris multithreading library should be made weak.])
+ LIBTHREAD=
+ LTLIBTHREAD=
+ fi
+ fi
+ fi
+ fi
+ if test -z "$gl_have_pthread"; then
+ case "$gl_use_threads" in
+ yes | windows | win32) # The 'win32' is for backward compatibility.
+ if { case "$host_os" in
+ mingw*) true;;
+ *) false;;
+ esac
+ }; then
+ gl_threads_api=windows
+ AC_DEFINE([USE_WINDOWS_THREADS], [1],
+ [Define if the native Windows multithreading API can be used.])
+ fi
+ ;;
+ esac
+ fi
+ fi
+ AC_MSG_CHECKING([for multithread API to use])
+ AC_MSG_RESULT([$gl_threads_api])
+ AC_SUBST([LIBTHREAD])
+ AC_SUBST([LTLIBTHREAD])
+ AC_SUBST([LIBMULTITHREAD])
+ AC_SUBST([LTLIBMULTITHREAD])
+])
+
+AC_DEFUN([gl_THREADLIB],
+[
+ AC_REQUIRE([gl_THREADLIB_EARLY])
+ AC_REQUIRE([gl_THREADLIB_BODY])
+])
+
+
+dnl gl_DISABLE_THREADS
+dnl ------------------
+dnl Sets the gl_THREADLIB default so that threads are not used by default.
+dnl The user can still override it at installation time, by using the
+dnl configure option '--enable-threads'.
+
+AC_DEFUN([gl_DISABLE_THREADS], [
+ m4_divert_text([INIT_PREPARE], [gl_use_threads_default=no])
+])
+
+
+dnl Survey of platforms:
+dnl
+dnl Platform Available Compiler Supports test-lock
+dnl flavours option weak result
+dnl --------------- --------- --------- -------- ---------
+dnl Linux 2.4/glibc posix -lpthread Y OK
+dnl
+dnl GNU Hurd/glibc posix
+dnl
+dnl FreeBSD 5.3 posix -lc_r Y
+dnl posix -lkse ? Y
+dnl posix -lpthread ? Y
+dnl posix -lthr Y
+dnl
+dnl FreeBSD 5.2 posix -lc_r Y
+dnl posix -lkse Y
+dnl posix -lthr Y
+dnl
+dnl FreeBSD 4.0,4.10 posix -lc_r Y OK
+dnl
+dnl NetBSD 1.6 --
+dnl
+dnl OpenBSD 3.4 posix -lpthread Y OK
+dnl
+dnl Mac OS X 10.[123] posix -lpthread Y OK
+dnl
+dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
+dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK
+dnl
+dnl HP-UX 11 posix -lpthread N (cc) OK
+dnl Y (gcc)
+dnl
+dnl IRIX 6.5 posix -lpthread Y 0.5
+dnl
+dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK
+dnl
+dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK
+dnl -lpthread (gcc) Y
+dnl
+dnl Cygwin posix -lpthread Y OK
+dnl
+dnl Any of the above pth -lpth 0.0
+dnl
+dnl Mingw windows N OK
+dnl
+dnl BeOS 5 --
+dnl
+dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
+dnl turned off:
+dnl OK if all three tests terminate OK,
+dnl 0.5 if the first test terminates OK but the second one loops endlessly,
+dnl 0.0 if the first test already loops endlessly.
diff --git a/m4/uintmax_t.m4 b/m4/uintmax_t.m4
new file mode 100644
index 0000000..bf83ed7
--- /dev/null
+++ b/m4/uintmax_t.m4
@@ -0,0 +1,30 @@
+# uintmax_t.m4 serial 9
+dnl Copyright (C) 1997-2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+AC_PREREQ(2.13)
+
+# Define uintmax_t to 'unsigned long' or 'unsigned long long'
+# if it is not already defined in <stdint.h> or <inttypes.h>.
+
+AC_DEFUN([gl_AC_TYPE_UINTMAX_T],
+[
+ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
+ AC_REQUIRE([gl_AC_HEADER_STDINT_H])
+ if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
+ AC_REQUIRE([gl_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 <stdint.h> and <inttypes.h> don't define.])
+ else
+ AC_DEFINE(HAVE_UINTMAX_T, 1,
+ [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
+ fi
+])
diff --git a/m4/ulonglong.m4 b/m4/ulonglong.m4
new file mode 100644
index 0000000..dee10cc
--- /dev/null
+++ b/m4/ulonglong.m4
@@ -0,0 +1,23 @@
+# ulonglong.m4 serial 4
+dnl Copyright (C) 1999-2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
+
+AC_DEFUN([gl_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/visibility.m4 b/m4/visibility.m4
new file mode 100644
index 0000000..2ff6330
--- /dev/null
+++ b/m4/visibility.m4
@@ -0,0 +1,52 @@
+# visibility.m4 serial 1 (gettext-0.15)
+dnl Copyright (C) 2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl Tests whether the compiler supports the command-line option
+dnl -fvisibility=hidden and the function and variable attributes
+dnl __attribute__((__visibility__("hidden"))) and
+dnl __attribute__((__visibility__("default"))).
+dnl Does *not* test for __visibility__("protected") - which has tricky
+dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
+dnl MacOS X.
+dnl Does *not* test for __visibility__("internal") - which has processor
+dnl dependent semantics.
+dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
+dnl "really only recommended for legacy code".
+dnl Set the variable CFLAG_VISIBILITY.
+dnl Defines and sets the variable HAVE_VISIBILITY.
+
+AC_DEFUN([gl_VISIBILITY],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ CFLAG_VISIBILITY=
+ HAVE_VISIBILITY=0
+ if test -n "$GCC"; then
+ AC_MSG_CHECKING([for simple visibility declarations])
+ AC_CACHE_VAL(gl_cv_cc_visibility, [
+ gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+ AC_TRY_COMPILE(
+ [extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+ extern __attribute__((__visibility__("default"))) int exportedvar;
+ extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+ extern __attribute__((__visibility__("default"))) int exportedfunc (void);],
+ [],
+ gl_cv_cc_visibility=yes,
+ gl_cv_cc_visibility=no)
+ CFLAGS="$gl_save_CFLAGS"])
+ AC_MSG_RESULT([$gl_cv_cc_visibility])
+ if test $gl_cv_cc_visibility = yes; then
+ CFLAG_VISIBILITY="-fvisibility=hidden"
+ HAVE_VISIBILITY=1
+ fi
+ fi
+ AC_SUBST([CFLAG_VISIBILITY])
+ AC_SUBST([HAVE_VISIBILITY])
+ AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
+ [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
+])
diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4
new file mode 100644
index 0000000..cde2129
--- /dev/null
+++ b/m4/wchar_t.m4
@@ -0,0 +1,20 @@
+# wchar_t.m4 serial 1 (gettext-0.12)
+dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether <stddef.h> 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 <stddef.h>
+ 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 100644
index 0000000..b8fff9c
--- /dev/null
+++ b/m4/wint_t.m4
@@ -0,0 +1,20 @@
+# wint_t.m4 serial 1 (gettext-0.12)
+dnl Copyright (C) 2003 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether <wchar.h> 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 <wchar.h>
+ 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 100644
index 0000000..85bb721
--- /dev/null
+++ b/m4/xsize.m4
@@ -0,0 +1,13 @@
+# xsize.m4 serial 3
+dnl Copyright (C) 2003-2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_XSIZE],
+[
+ dnl Prerequisites of lib/xsize.h.
+ AC_REQUIRE([gl_SIZE_MAX])
+ AC_REQUIRE([AC_C_INLINE])
+ AC_CHECK_HEADERS(stdint.h)
+])
diff --git a/mkinstalldirs b/mkinstalldirs
new file mode 100755
index 0000000..55d537f
--- /dev/null
+++ b/mkinstalldirs
@@ -0,0 +1,162 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+
+scriptversion=2009-04-28.21; # UTC
+
+# Original author: Noah Friedman <[email protected]>
+# Created: 1993-05-16
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <[email protected]> or send patches to
+
+nl='
+'
+IFS=" "" $nl"
+errstatus=0
+dirmode=
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <[email protected]>."
+
+# process command line arguments
+while test $# -gt 0 ; do
+ case $1 in
+ -h | --help | --h*) # -h for help
+ echo "$usage"
+ exit $?
+ ;;
+ -m) # -m PERM arg
+ shift
+ test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+ dirmode=$1
+ shift
+ ;;
+ --version)
+ echo "$0 $scriptversion"
+ exit $?
+ ;;
+ --) # stop option processing
+ shift
+ break
+ ;;
+ -*) # unknown option
+ echo "$usage" 1>&2
+ exit 1
+ ;;
+ *) # first non-opt arg
+ break
+ ;;
+ esac
+done
+
+for file
+do
+ if test -d "$file"; then
+ shift
+ else
+ break
+ fi
+done
+
+case $# in
+ 0) exit 0 ;;
+esac
+
+# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error. This is a problem when calling mkinstalldirs
+# from a parallel make. We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
+case $dirmode in
+ '')
+ if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ echo "mkdir -p -- $*"
+ exec mkdir -p -- "$@"
+ else
+ # On NextStep and OpenStep, the 'mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because '.' already
+ # exists.
+ test -d ./-p && rmdir ./-p
+ test -d ./--version && rmdir ./--version
+ fi
+ ;;
+ *)
+ if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+ test ! -d ./--version; then
+ echo "mkdir -m $dirmode -p -- $*"
+ exec mkdir -m "$dirmode" -p -- "$@"
+ else
+ # Clean up after NextStep and OpenStep mkdir.
+ for d in ./-m ./-p ./--version "./$dirmode";
+ do
+ test -d $d && rmdir $d
+ done
+ fi
+ ;;
+esac
+
+for file
+do
+ case $file in
+ /*) pathcomp=/ ;;
+ *) pathcomp= ;;
+ esac
+ oIFS=$IFS
+ IFS=/
+ set fnord $file
+ shift
+ IFS=$oIFS
+
+ for d
+ do
+ test "x$d" = x && continue
+
+ pathcomp=$pathcomp$d
+ case $pathcomp in
+ -*) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp"
+
+ mkdir "$pathcomp" || lasterr=$?
+
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
+ else
+ if test ! -z "$dirmode"; then
+ echo "chmod $dirmode $pathcomp"
+ lasterr=
+ chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+ if test ! -z "$lasterr"; then
+ errstatus=$lasterr
+ fi
+ fi
+ fi
+ fi
+
+ pathcomp=$pathcomp/
+ done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/po/.gitattributes b/po/.gitattributes
new file mode 100644
index 0000000..5b0a001
--- /dev/null
+++ b/po/.gitattributes
@@ -0,0 +1,7 @@
+# You should add
+#[filter "cleanpo"]
+# clean = "awk '/^\"POT-Creation-Date:/&&!s{s=1;next};!/^#: /{print}'"
+# to your config file. Normally, autogen.sh does this for you.
+
+/??.po filter=cleanpo
+/??_??.po filter=cleanpo
diff --git a/po/ChangeLog-2011 b/po/ChangeLog-2011
new file mode 100644
index 0000000..ddc40f9
--- /dev/null
+++ b/po/ChangeLog-2011
@@ -0,0 +1,146 @@
+2011-12-01 Werner Koch <[email protected]>
+
+ NB: ChangeLog files are no longer manually maintained. Starting
+ on December 1st, 2011 we put change information only in the GIT
+ commit log, and generate a top-level ChangeLog file from logs at
+ "make dist". See doc/HACKING for details.
+
+2010-09-16 Jakub Bogusz <[email protected]> (wk)
+
+ * pl.po: Update.
+
+2010-09-16 gettextize <[email protected]>
+
+ * Makefile.in.in: Upgrade to gettext-0.17.
+
+2010-05-06 Freek de Kruijf <[email protected]> (wk)
+
+ * nl.po: New.
+
+2010-05-06 Clytie Siddall <[email protected]> (wk)
+
+ * vi.po: Update
+
+2009-08-20 Werner Koch <[email protected]>
+
+ * LINGUAS: Add zh_CN, cs and it.
+ * cs.po: New.
+ * it.po: New.
+
+2009-08-20 Daniel Nylander <[email protected]> (wk)
+
+ * sv.po: Update
+
+2009-08-20 Aron Xu <[email protected]> (wk)
+
+ * zh_CN.po: New.
+
+2009-03-29 Moritz <[email protected]>
+
+ * de.po: Fixed typo.
+
+2008-11-12 Werner Koch <[email protected]>
+
+ * de.po: Fixed typo.
+
+2007-10-29 Daniel Nylander <[email protected]> (wk)
+
+ * sv.po: Update.
+
+2007-10-29 Clytie Siddall <[email protected]> (wk)
+
+ * vi.po: Update.
+
+2007-10-29 Jakub Bogusz <[email protected]> (wk)
+
+ * pl.po: Update.
+
+2007-08-23 Werner Koch <[email protected]>
+
+ * de.po: Typo fix [bug#828].
+
+2007-02-26 Werner Koch <[email protected]>
+
+ * sv.po: Update from Daniel.
+
+2006-12-22 Werner Koch <[email protected]>
+
+ * LINGUAS, sv.po: Installed Swedish translation by Daniel Nylander.
+
+2006-11-23 gettextize <[email protected]>
+
+ * Makefile.in.in: Upgrade to gettext-0.15.
+
+2006-09-14 Werner Koch <[email protected]>
+
+ * de.po: Updated.
+
+2006-09-08 Werner Koch <[email protected]>
+
+ * pl.po: Updated.
+
+2006-03-14 gettextize <[email protected]>
+
+ * Makefile.in.in: Upgrade to gettext-0.14.5.
+ * Rules-quot: Upgrade to gettext-0.14.5.
+
+2006-01-11 Werner Koch <[email protected]>
+
+ * vi.po: New.
+ * LINGUAS: Add vi.
+
+2005-09-29 Marcus Brinkmann <[email protected]>
+
+ * fr.po: New file.
+ * LINGUAS: Add fr.
+
+2005-07-04 Werner Koch <[email protected]>
+
+ * ro.po: New.
+
+2005-06-16 Marcus Brinkmann <[email protected]>
+
+ * de.po: Apply typo fixes from Debian #313977.
+
+2004-04-22 Marcus Brinkmann <[email protected]>
+
+ * POTFILES.in: Add src/gpg-error.c.
+ * pl.po: Add messages for gpg-error.c.
+ * de.po: Likewise.
+
+ * pl.po: Update.
+
+2004-04-20 Marcus Brinkmann <[email protected]>
+
+ * LINGUAS: Add pl.
+ * pl.po: New file.
+
+2003-12-08 gettextize <[email protected]>
+
+ * Makefile.in.in: Upgrade to gettext-0.12.1.
+
+2003-11-14 Werner Koch <[email protected]>
+
+ * de.po: New.
+
+2003-05-15 gettextize <[email protected]>
+
+ * Makefile.in.in: New file, from gettext-0.11.5.
+ * boldquot.sed: New file, from gettext-0.11.5.
+ * [email protected]: New file, from gettext-0.11.5.
+ * [email protected]: New file, from gettext-0.11.5.
+ * insert-header.sin: New file, from gettext-0.11.5.
+ * quot.sed: New file, from gettext-0.11.5.
+ * remove-potcdate.sin: New file, from gettext-0.11.5.
+ * Rules-quot: New file, from gettext-0.11.5.
+
+
+ Copyright 2003, 2010 g10 Code GmbH
+
+ This file is free software; as a special exception the author gives
+ unlimited permission to copy and/or distribute it, with or without
+ modifications, as long as this notice is preserved.
+
+ This file 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.
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644
index 0000000..bff6ab5
--- /dev/null
+++ b/po/LINGUAS
@@ -0,0 +1,20 @@
+# Set of available languages.
+cs
+da
+de
+eo
+fr
+hu
+it
+ja
+nl
+pl
+pt
+ro
+ru
+sr
+sv
+uk
+vi
+zh_CN
+zh_TW
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
new file mode 100644
index 0000000..65184f6
--- /dev/null
+++ b/po/Makefile.in.in
@@ -0,0 +1,475 @@
+# Makefile for PO directory in any package using GNU gettext.
+# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper <[email protected]>
+#
+# 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.19
+GETTEXT_MACRO_VERSION = 0.19
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+
+SED = @SED@
+SHELL = /bin/sh
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datarootdir = @datarootdir@
+datadir = @datadir@
+localedir = @localedir@
+gettextsrcdir = $(datadir)/gettext/po
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+# We use $(mkdir_p).
+# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
+# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
+# @install_sh@ does not start with $(SHELL), so we add it.
+# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
+# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
+# versions, $(mkinstalldirs) and $(install_sh) are unused.
+mkinstalldirs = $(SHELL) @install_sh@ -d
+install_sh = $(SHELL) @install_sh@
+MKDIR_P = @MKDIR_P@
+mkdir_p = @mkdir_p@
+
+GMSGFMT_ = @GMSGFMT@
+GMSGFMT_no = @GMSGFMT@
+GMSGFMT_yes = @GMSGFMT_015@
+GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
+MSGFMT_ = @MSGFMT@
+MSGFMT_no = @MSGFMT@
+MSGFMT_yes = @MSGFMT_015@
+MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
+XGETTEXT_ = @XGETTEXT@
+XGETTEXT_no = @XGETTEXT@
+XGETTEXT_yes = @XGETTEXT_015@
+XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
+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 \
+$(POFILES) $(GMOFILES) \
+$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
+
+POTFILES = \
+
+CATALOGS = @CATALOGS@
+
+POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot
+POFILESDEPS_yes = $(POFILESDEPS_)
+POFILESDEPS_no =
+POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT))
+
+DISTFILESDEPS_ = update-po
+DISTFILESDEPS_yes = $(DISTFILESDEPS_)
+DISTFILESDEPS_no =
+DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO))
+
+# 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 --verbose -o $${lang}.gmo $${lang}.po"; \
+ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -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:
+
+# Ensure that the gettext macros and this Makefile.in.in are in sync.
+CHECK_MACRO_VERSION = \
+ test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
+ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \
+ exit 1; \
+ }
+
+# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
+# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
+# we don't want to bother translators with empty POT files). We assume that
+# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
+# In this case, stamp-po is a nop (i.e. a phony target).
+
+# 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
+ @$(CHECK_MACRO_VERSION)
+ test ! -f $(srcdir)/$(DOMAIN).pot || \
+ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
+ @test ! -f $(srcdir)/$(DOMAIN).pot || { \
+ 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.
+# The determination of whether the package xyz is a GNU one is based on the
+# heuristic whether some file in the top level directory mentions "GNU xyz".
+# If GNU 'find' is available, we avoid grepping through monster files.
+$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
+ package_gnu="$(PACKAGE_GNU)"; \
+ test -n "$$package_gnu" || { \
+ if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \
+ LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f \
+ -size -10000000c -exec grep 'GNU @PACKAGE@' \
+ /dev/null '{}' ';' 2>/dev/null; \
+ else \
+ LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \
+ fi; \
+ } | grep -v 'libtool:' >/dev/null; then \
+ package_gnu=yes; \
+ else \
+ package_gnu=no; \
+ fi; \
+ }; \
+ if test "$$package_gnu" = "yes"; then \
+ package_prefix='GNU '; \
+ else \
+ package_prefix=''; \
+ fi; \
+ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
+ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
+ else \
+ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
+ fi; \
+ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
+ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
+ --files-from=$(srcdir)/POTFILES.in \
+ --copyright-holder='$(COPYRIGHT_HOLDER)' \
+ --msgid-bugs-address="$$msgid_bugs_address" \
+ ;; \
+ *) \
+ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
+ --files-from=$(srcdir)/POTFILES.in \
+ --copyright-holder='$(COPYRIGHT_HOLDER)' \
+ --package-name="$${package_prefix}@PACKAGE@" \
+ --package-version='@VERSION@' \
+ --msgid-bugs-address="$$msgid_bugs_address" \
+ ;; \
+ esac
+ 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): $(POFILESDEPS)
+ @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
+ if test -f "$(srcdir)/$${lang}.po"; then \
+ test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot; \
+ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
+ cd $(srcdir) \
+ && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \
+ *) \
+ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \
+ esac; \
+ }; \
+ 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 \
+ $(mkdir_p) $(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
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(mkdir_p) $(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 \
+ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
+ else \
+ : ; \
+ fi
+installdirs-data-no:
+installdirs-data-yes:
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(mkdir_p) $(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:
+ test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS)
+ @$(MAKE) dist2
+# This is a separate target because 'update-po' must be executed before.
+dist2: stamp-po $(DISTFILES)
+ dists="$(DISTFILES)"; \
+ if test "$(PACKAGE)" = "gettext-tools"; then \
+ dists="$$dists Makevars.template"; \
+ fi; \
+ if test -f $(srcdir)/$(DOMAIN).pot; then \
+ dists="$$dists $(DOMAIN).pot stamp-po"; \
+ 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) || exit 1; \
+ else \
+ cp -p $(srcdir)/$$file $(distdir) || exit 1; \
+ 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) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
+ cd $(srcdir); \
+ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
+ *) \
+ $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
+ esac; \
+ }; 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)
+ @:
+
+# Recreate Makefile by invoking config.status. Explicitly invoke the shell,
+# because execution permission bits may not work on the current file system.
+# Use @SHELL@, which is the shell determined by autoconf for the use by its
+# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient.
+Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
+ cd $(top_builddir) \
+ && @SHELL@ ./config.status $(subdir)/[email protected] po-directories
+
+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 100644
index 0000000..7585237
--- /dev/null
+++ b/po/Makevars
@@ -0,0 +1,79 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# 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 = g10 Code GmbH
+
+# This tells whether or not to prepend "GNU " prefix to the package
+# name that gets inserted into the header of the $(DOMAIN).pot file.
+# Possible values are "yes", "no", or empty. If it is empty, try to
+# detect it automatically by scanning the files in $(top_srcdir) for
+# "GNU packagename" string.
+PACKAGE_GNU = no
+
+# 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 = [email protected]
+
+
+# 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 =
+
+# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
+# context. Possible values are "yes" and "no". Set this to yes if the
+# package uses functions taking also a message context, like pgettext(), or
+# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
+USE_MSGCTXT = no
+
+# These options get passed to msgmerge.
+# Useful options are in particular:
+# --previous to keep previous msgids of translated messages,
+# --quiet to reduce the verbosity.
+MSGMERGE_OPTIONS = --previous
+
+# These options get passed to msginit.
+# If you want to disable line wrapping when writing PO files, add
+# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
+# MSGINIT_OPTIONS.
+MSGINIT_OPTIONS =
+
+# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
+# has changed. Possible values are "yes" and "no". Set this to no if
+# the POT file is checked in the repository and the version control
+# program ignores timestamps.
+PO_DEPENDS_ON_POT = yes
+
+# This tells whether or not to forcibly update $(DOMAIN).pot and
+# regenerate PO files on "make dist". Possible values are "yes" and
+# "no". Set this to no if the POT file and PO files are maintained
+# externally.
+DIST_DEPENDS_ON_UPDATE_PO = yes
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..2a3aabc
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,14 @@
+# List of source files containing translatable strings.
+# Copyright 2003 g10 Code GmbH
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This file 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.
+
+src/err-sources.h
+src/err-codes.h
+src/gpg-error.c
diff --git a/po/Rules-quot b/po/Rules-quot
new file mode 100644
index 0000000..9dc9630
--- /dev/null
+++ b/po/Rules-quot
@@ -0,0 +1,58 @@
+# This file, Rules-quot, can be copied and used freely without restrictions.
+# Special Makefile rules for English message catalogs with quotation marks.
+
+DISTFILES.common.extra1 = quot.sed boldquot.sed [email protected] [email protected] insert-header.sin Rules-quot
+
+.SUFFIXES: .insert-header .po-update-en
+
+
+
+.insert-header.po-update-en:
+ @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
+ if test "$(PACKAGE)" = "gettext-tools"; 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) $(MSGINIT_OPTIONS) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \
+ | $(SED) -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | \
+ { case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \
+ $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \
+ ;; \
+ *) \
+ $(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \
+ ;; \
+ esac } 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
+
[email protected]: insert-header.sin
+ sed -e '/^#/d' -e 's/HEADER/[email protected]/g' $(srcdir)/insert-header.sin > [email protected]
+
[email protected]: insert-header.sin
+ sed -e '/^#/d' -e 's/HEADER/[email protected]/g' $(srcdir)/insert-header.sin > [email protected]
+
+mostlyclean: mostlyclean-quot
+mostlyclean-quot:
+ rm -f *.insert-header
diff --git a/po/boldquot.sed b/po/boldquot.sed
new file mode 100644
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/cs.po b/po/cs.po
new file mode 100644
index 0000000..47ad00f
--- /dev/null
+++ b/po/cs.po
@@ -0,0 +1,1480 @@
+# Czech translation of libgpg-error.
+# Copyright (C) 2009 Free Software Foundation, Inc.
+# This file is distributed under the same license as the libgpg-error package.
+# Petr Pisar <[email protected]>, 2009, 2012, 2014.
+#
+# certificate chain → řetězec (posloupnost) certifikátů
+# keybox → schránka (na klíče)
+# keyring → klíčenka (jen na PGP klíče)
+# armor → ASCII (podoba)
+# encoding → kódování
+# encryption → šifrování
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: libgpg-error 1.18\n"
+"Report-Msgid-Bugs-To: [email protected]\n"
+"PO-Revision-Date: 2014-11-27 19:31+0100\n"
+"Last-Translator: Petr Pisar <[email protected]>\n"
+"Language-Team: Czech <[email protected]>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "Unspecified source"
+msgstr "Zdroj nezadán"
+
+msgid "gcrypt"
+msgstr "gcrypt"
+
+msgid "GnuPG"
+msgstr "GnuPG"
+
+msgid "GpgSM"
+msgstr "GpgSM"
+
+msgid "GPG Agent"
+msgstr "GPG agent"
+
+msgid "Pinentry"
+msgstr "Pinentry"
+
+msgid "SCD"
+msgstr "SCD"
+
+msgid "GPGME"
+msgstr "GPGME"
+
+# XXX: Konzistentní s gnupg2
+msgid "Keybox"
+msgstr "Schránka"
+
+msgid "KSBA"
+msgstr "KSBA"
+
+msgid "Dirmngr"
+msgstr "Dirmngr"
+
+msgid "GSTI"
+msgstr "GSTI"
+
+msgid "GPA"
+msgstr "GPA"
+
+msgid "Kleopatra"
+msgstr "Kleopatra"
+
+msgid "G13"
+msgstr "G13"
+
+msgid "Assuan"
+msgstr "Assuan"
+
+msgid "TLS"
+msgstr "TLS"
+
+msgid "Any source"
+msgstr "Nespecifikovaný zdroj"
+
+msgid "User defined source 1"
+msgstr "Uživatelem definovaný zdroj 1"
+
+msgid "User defined source 2"
+msgstr "Uživatelem definovaný zdroj 2"
+
+msgid "User defined source 3"
+msgstr "Uživatelem definovaný zdroj 3"
+
+msgid "User defined source 4"
+msgstr "Uživatelem definovaný zdroj 4"
+
+msgid "Unknown source"
+msgstr "Neznámý zdroj"
+
+msgid "Success"
+msgstr "Úspěch"
+
+msgid "General error"
+msgstr "Obecná chyba"
+
+msgid "Unknown packet"
+msgstr "Neznámý packet"
+
+msgid "Unknown version in packet"
+msgstr "Neznámá verze v packetu"
+
+msgid "Invalid public key algorithm"
+msgstr "Neplatný algoritmus veřejného klíče"
+
+msgid "Invalid digest algorithm"
+msgstr "Neplatný hashovací algoritmus"
+
+msgid "Bad public key"
+msgstr "Chybný veřejný klíč"
+
+msgid "Bad secret key"
+msgstr "Chybný tajný klíč"
+
+msgid "Bad signature"
+msgstr "Chybný podpis"
+
+msgid "No public key"
+msgstr "Žádný veřejný klíč"
+
+msgid "Checksum error"
+msgstr "Chyba kontrolního součtu"
+
+msgid "Bad passphrase"
+msgstr "Chybné heslo"
+
+msgid "Invalid cipher algorithm"
+msgstr "Neplatný šifrovací algoritmus"
+
+msgid "Cannot open keyring"
+msgstr "Klíčenka otevřena"
+
+msgid "Invalid packet"
+msgstr "Neplatný packet"
+
+msgid "Invalid armor"
+msgstr "Neplatný ASCII zápis"
+
+msgid "No user ID"
+msgstr "Žádný identifikátor uživatele"
+
+msgid "No secret key"
+msgstr "Žádný tajný klíč"
+
+msgid "Wrong secret key used"
+msgstr "Použit špatný tajný klíč"
+
+msgid "Bad session key"
+msgstr "Chybný klíč relace"
+
+msgid "Unknown compression algorithm"
+msgstr "Neznámý kompresní algoritmus"
+
+msgid "Number is not prime"
+msgstr "Číslo není prvočíslo"
+
+msgid "Invalid encoding method"
+msgstr "Neplatná kódovací metoda"
+
+msgid "Invalid encryption scheme"
+msgstr "Neplatné šifrovací schéma"
+
+msgid "Invalid signature scheme"
+msgstr "Neplatné podpisové schéma"
+
+msgid "Invalid attribute"
+msgstr "Neplatný atribut"
+
+msgid "No value"
+msgstr "Žádná hodnota"
+
+msgid "Not found"
+msgstr "Nenalezeno"
+
+msgid "Value not found"
+msgstr "Hodnota nenalezena"
+
+msgid "Syntax error"
+msgstr "Chyba syntaxe"
+
+msgid "Bad MPI value"
+msgstr "Chybná hodnota MPI"
+
+msgid "Invalid passphrase"
+msgstr "Neplatné heslo"
+
+msgid "Invalid signature class"
+msgstr "Neplatní podpisová třída"
+
+msgid "Resources exhausted"
+msgstr "Zdroje vyčerpány"
+
+msgid "Invalid keyring"
+msgstr "Neplatná klíčenka"
+
+msgid "Trust DB error"
+msgstr "Chyba databáze důvěry"
+
+msgid "Bad certificate"
+msgstr "Chybný certifikát"
+
+msgid "Invalid user ID"
+msgstr "Neplatné ID uživatele"
+
+msgid "Unexpected error"
+msgstr "Neočekávaná chyba"
+
+msgid "Time conflict"
+msgstr "Rozpor v času"
+
+msgid "Keyserver error"
+msgstr "Chyba serveru s klíči"
+
+msgid "Wrong public key algorithm"
+msgstr "Špatný algoritmus veřejného klíče"
+
+# This is errror nuber 42 :)
+msgid "Tribute to D. A."
+msgstr "Pocta D. A."
+
+msgid "Weak encryption key"
+msgstr "Slabý šifrovací klíč"
+
+msgid "Invalid key length"
+msgstr "Neplatná délka klíče"
+
+msgid "Invalid argument"
+msgstr "Neplatný argument"
+
+msgid "Syntax error in URI"
+msgstr "Chyba syntaxe v URI"
+
+msgid "Invalid URI"
+msgstr "Neplatné URI"
+
+msgid "Network error"
+msgstr "Chyba sítě"
+
+msgid "Unknown host"
+msgstr "Neznámý stroj"
+
+msgid "Selftest failed"
+msgstr "Sebetestování selhalo"
+
+msgid "Data not encrypted"
+msgstr "Data nešifrována"
+
+msgid "Data not processed"
+msgstr "Data nezpracována"
+
+msgid "Unusable public key"
+msgstr "Nepoužitelný veřejný klíč"
+
+msgid "Unusable secret key"
+msgstr "Nepoužitelný tajný klíč"
+
+msgid "Invalid value"
+msgstr "Neplatná hodnota"
+
+msgid "Bad certificate chain"
+msgstr "Chybný řetězec certifikátů"
+
+msgid "Missing certificate"
+msgstr "Chybí certifikát"
+
+msgid "No data"
+msgstr "Žádná data"
+
+msgid "Bug"
+msgstr "Chyba"
+
+msgid "Not supported"
+msgstr "Nepodporováno"
+
+msgid "Invalid operation code"
+msgstr "Neplatný kód operace"
+
+msgid "Timeout"
+msgstr "Čas vypršel"
+
+msgid "Internal error"
+msgstr "Vnitřní chyba"
+
+msgid "EOF (gcrypt)"
+msgstr "EOF (gcrypt)"
+
+msgid "Invalid object"
+msgstr "Neplatný objekt"
+
+msgid "Provided object is too short"
+msgstr "Dodaný objekt je příliš krátký"
+
+msgid "Provided object is too large"
+msgstr "Dodaný objekt je příliš dlouhý"
+
+msgid "Missing item in object"
+msgstr "V objektu chybí položka"
+
+msgid "Not implemented"
+msgstr "Neimplementováno"
+
+msgid "Conflicting use"
+msgstr "Neslučitelné použití"
+
+msgid "Invalid cipher mode"
+msgstr "Neplatný režim šifry"
+
+msgid "Invalid flag"
+msgstr "Neplatný příznak"
+
+msgid "Invalid handle"
+msgstr "Neplatný deskriptor"
+
+msgid "Result truncated"
+msgstr "Výsledek zkrácen"
+
+msgid "Incomplete line"
+msgstr "Neúplný řádek"
+
+msgid "Invalid response"
+msgstr "Neplatná odpověď"
+
+msgid "No agent running"
+msgstr "Agent neběží"
+
+msgid "Agent error"
+msgstr "Chyba agenta"
+
+msgid "Invalid data"
+msgstr "Neplatná data"
+
+msgid "Unspecific Assuan server fault"
+msgstr "Neurčená porucha serveru Assuan"
+
+msgid "General Assuan error"
+msgstr "Obecná chyba Assuanu"
+
+msgid "Invalid session key"
+msgstr "Neplatný klíč relace"
+
+msgid "Invalid S-expression"
+msgstr "Neplatný S-výraz"
+
+msgid "Unsupported algorithm"
+msgstr "Nepodporovaný algoritmus"
+
+msgid "No pinentry"
+msgstr "Žádný pinentry"
+
+msgid "pinentry error"
+msgstr "chyba pinentry"
+
+msgid "Bad PIN"
+msgstr "Špatný PIN"
+
+msgid "Invalid name"
+msgstr "Neplatné jméno"
+
+msgid "Bad data"
+msgstr "Chybná data"
+
+msgid "Invalid parameter"
+msgstr "Neplatný parametr"
+
+msgid "Wrong card"
+msgstr "Špatná karta"
+
+msgid "No dirmngr"
+msgstr "Žádný dirmngr"
+
+msgid "dirmngr error"
+msgstr "chyba dirmngr"
+
+msgid "Certificate revoked"
+msgstr "Certifikát odvolán"
+
+msgid "No CRL known"
+msgstr "Není znám žádný CRL"
+
+msgid "CRL too old"
+msgstr "Příliš starý CRL"
+
+msgid "Line too long"
+msgstr "Příliš dlouhý řádek"
+
+msgid "Not trusted"
+msgstr "Nedůvěřuje se"
+
+msgid "Operation cancelled"
+msgstr "Operace zrušena"
+
+msgid "Bad CA certificate"
+msgstr "Chybný certifikát autority"
+
+msgid "Certificate expired"
+msgstr "Certifikátu vypršela platnost"
+
+msgid "Certificate too young"
+msgstr "Certifikát je příliš mladý"
+
+msgid "Unsupported certificate"
+msgstr "Nepodporovaný certifikát"
+
+msgid "Unknown S-expression"
+msgstr "Neznámý S-výraz"
+
+msgid "Unsupported protection"
+msgstr "Nepodporovaná ochrana"
+
+msgid "Corrupted protection"
+msgstr "Poškozená ochrana"
+
+msgid "Ambiguous name"
+msgstr "Nejednoznačné jméno"
+
+msgid "Card error"
+msgstr "Chyba karty"
+
+msgid "Card reset required"
+msgstr "Vyžadován reset karty"
+
+msgid "Card removed"
+msgstr "Karta odstraněna"
+
+msgid "Invalid card"
+msgstr "Neplatná karta"
+
+msgid "Card not present"
+msgstr "Karta není přítomna"
+
+msgid "No PKCS15 application"
+msgstr "Žádná aplikace PKCS15"
+
+msgid "Not confirmed"
+msgstr "Nepotvrzeno"
+
+# Nastavení nebo nastavování?
+msgid "Configuration error"
+msgstr "Chyba konfigurace"
+
+msgid "No policy match"
+msgstr "Politika se neshoduje"
+
+msgid "Invalid index"
+msgstr "Neplatný index"
+
+msgid "Invalid ID"
+msgstr "Neplatné ID"
+
+msgid "No SmartCard daemon"
+msgstr "Žádný démon pro čipové karty"
+
+msgid "SmartCard daemon error"
+msgstr "Chyba démona pro čipové karty"
+
+msgid "Unsupported protocol"
+msgstr "Nepodporovaný protokol"
+
+msgid "Bad PIN method"
+msgstr "Chybná metoda PINu"
+
+msgid "Card not initialized"
+msgstr "Karta neinicializovaná"
+
+msgid "Unsupported operation"
+msgstr "Nepodporovaná operace"
+
+msgid "Wrong key usage"
+msgstr "Špatné použití karty"
+
+msgid "Nothing found"
+msgstr "Nic nenalezeno"
+
+msgid "Wrong blob type"
+msgstr "Špatný typ blobu"
+
+msgid "Missing value"
+msgstr "Chybí hodnota"
+
+msgid "Hardware problem"
+msgstr "Hardwarový problém"
+
+msgid "PIN blocked"
+msgstr "PIN blokován"
+
+msgid "Conditions of use not satisfied"
+msgstr "Podmínky použití nesplněny"
+
+msgid "PINs are not synced"
+msgstr "PINy nejsou synchronizovány"
+
+msgid "Invalid CRL"
+msgstr "Neplatný CRL"
+
+msgid "BER error"
+msgstr "Chyba BER"
+
+msgid "Invalid BER"
+msgstr "Neplatné BER"
+
+msgid "Element not found"
+msgstr "Prvek nenalezen"
+
+msgid "Identifier not found"
+msgstr "Identifikátor nenalezen"
+
+msgid "Invalid tag"
+msgstr "Neplatná značka"
+
+msgid "Invalid length"
+msgstr "Neplatná délka"
+
+msgid "Invalid key info"
+msgstr "Neplatné informace o klíči"
+
+msgid "Unexpected tag"
+msgstr "Neočekávaná značka"
+
+msgid "Not DER encoded"
+msgstr "Nekódováno v DER"
+
+msgid "No CMS object"
+msgstr "Žádný objekt CMS"
+
+msgid "Invalid CMS object"
+msgstr "Neplatný objekt CMS"
+
+msgid "Unknown CMS object"
+msgstr "Neznámý objekt CMS"
+
+msgid "Unsupported CMS object"
+msgstr "Nepodporovaný objekty CMS"
+
+msgid "Unsupported encoding"
+msgstr "Nepodporované kódování"
+
+msgid "Unsupported CMS version"
+msgstr "Nepodporovaná verze CMS"
+
+msgid "Unknown algorithm"
+msgstr "Neznámý algoritmus"
+
+msgid "Invalid crypto engine"
+msgstr "Neplatná kryptografická jednotka"
+
+msgid "Public key not trusted"
+msgstr "Veřejnému klíči se nedůvěřuje"
+
+msgid "Decryption failed"
+msgstr "Dešifrování selhalo"
+
+msgid "Key expired"
+msgstr "Klíči vypršela platnost"
+
+msgid "Signature expired"
+msgstr "Podpisu vypršela platnost"
+
+msgid "Encoding problem"
+msgstr "Chyba kódování"
+
+msgid "Invalid state"
+msgstr "Neplatná stav"
+
+msgid "Duplicated value"
+msgstr "Zdvojená hodnota"
+
+msgid "Missing action"
+msgstr "Chybí akce"
+
+msgid "ASN.1 module not found"
+msgstr "Modul ASN.1 nenalezen"
+
+msgid "Invalid OID string"
+msgstr "Neplatný řetězec OID"
+
+msgid "Invalid time"
+msgstr "Neplatný čas"
+
+msgid "Invalid CRL object"
+msgstr "Neplatný objekt CRL"
+
+msgid "Unsupported CRL version"
+msgstr "Nepodporovaná verze CRL"
+
+msgid "Invalid certificate object"
+msgstr "Neplatný objekt certifikátu"
+
+msgid "Unknown name"
+msgstr "Neznámé jméno"
+
+msgid "A locale function failed"
+msgstr "Funkce locale selhala"
+
+msgid "Not locked"
+msgstr "Neuzamčeno"
+
+msgid "Protocol violation"
+msgstr "Narušení protokolu"
+
+msgid "Invalid MAC"
+msgstr "Neplatný MAC"
+
+msgid "Invalid request"
+msgstr "Neplatný požadavek"
+
+msgid "Unknown extension"
+msgstr "Neznámé rozšíření"
+
+msgid "Unknown critical extension"
+msgstr "Neznámé kritické rozšíření"
+
+msgid "Locked"
+msgstr "Zamčeno"
+
+msgid "Unknown option"
+msgstr "Neznámý parametr"
+
+msgid "Unknown command"
+msgstr "Neznámý příkaz"
+
+msgid "Not operational"
+msgstr "Nefunkční"
+
+msgid "No passphrase given"
+msgstr "Heslo nezadáno"
+
+msgid "No PIN given"
+msgstr "PIN nezadán"
+
+msgid "Not enabled"
+msgstr "Nezapnuto"
+
+msgid "No crypto engine"
+msgstr "Chybí kryptografická jednotka"
+
+msgid "Missing key"
+msgstr "Chybí klíč"
+
+msgid "Too many objects"
+msgstr "Příliš mnoho objektů"
+
+msgid "Limit reached"
+msgstr "Dosažen limit"
+
+msgid "Not initialized"
+msgstr "Neinicializováno"
+
+msgid "Missing issuer certificate"
+msgstr "Chybí certifikát vydavatele"
+
+msgid "No keyserver available"
+msgstr "Není dostupný žádný server klíčů"
+
+msgid "Invalid elliptic curve"
+msgstr "Neplatná eliptická křivka"
+
+msgid "Unknown elliptic curve"
+msgstr "Neznámá eliptická křivka"
+
+msgid "Duplicated key"
+msgstr "Zdvojený klíč"
+
+msgid "Ambiguous result"
+msgstr "Nejednoznačný výsledek"
+
+msgid "No crypto context"
+msgstr "Chybí kryptografický kontext"
+
+msgid "Wrong crypto context"
+msgstr "Chybný kryptografický kontext"
+
+msgid "Bad crypto context"
+msgstr "Špatný kryptografický kontext"
+
+msgid "Conflict in the crypto context"
+msgstr "Rozpor v kryptografickém kontextu"
+
+msgid "Broken public key"
+msgstr "Rozbitý veřejný klíč"
+
+msgid "Broken secret key"
+msgstr "Rozbitý tajný klíč"
+
+msgid "Invalid MAC algorithm"
+msgstr "Neplatný algoritmus MAC"
+
+msgid "Operation fully cancelled"
+msgstr "Operace zcela zrušena"
+
+msgid "Operation not yet finished"
+msgstr "Operace ještě neskončila"
+
+msgid "Buffer too short"
+msgstr "Vyrovnávací paměť je příliš malá"
+
+msgid "Invalid length specifier in S-expression"
+msgstr "Neplatné určení délky v S-výrazu"
+
+msgid "String too long in S-expression"
+msgstr "Řetězec v S-výrazu je příliš dlouhý"
+
+msgid "Unmatched parentheses in S-expression"
+msgstr "Nepárové závorky v S-výrazu"
+
+msgid "S-expression not canonical"
+msgstr "S-výraz není kanonický"
+
+msgid "Bad character in S-expression"
+msgstr "Chybný znak v S-výrazu"
+
+msgid "Bad quotation in S-expression"
+msgstr "Chybné uzavření do uvozovek v S-výrazu"
+
+msgid "Zero prefix in S-expression"
+msgstr "Nulová předpona v S-výrazu"
+
+msgid "Nested display hints in S-expression"
+msgstr "Vnořené pokyny pro zobrazení v S-výrazu"
+
+msgid "Unmatched display hints"
+msgstr "Neodpovídající pokyny pro zobrazení"
+
+msgid "Unexpected reserved punctuation in S-expression"
+msgstr "Neočekávaná vyhrazená interpunkce v S-výrazu"
+
+msgid "Bad hexadecimal character in S-expression"
+msgstr "Chybný šestnáctkový znak v S-výrazu"
+
+msgid "Odd hexadecimal numbers in S-expression"
+msgstr "Lichá šestnáctková čísla v S-výrazu"
+
+msgid "Bad octal character in S-expression"
+msgstr "Chybný osmičkový znak v S-výrazu"
+
+msgid "All subkeys are expired or revoked"
+msgstr ""
+
+#, fuzzy
+#| msgid "Data not encrypted"
+msgid "Database is corrupted"
+msgstr "Data nešifrována"
+
+msgid "Server indicated a failure"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "No name"
+msgstr "Neznámé jméno"
+
+#, fuzzy
+#| msgid "No public key"
+msgid "No key"
+msgstr "Žádný veřejný klíč"
+
+msgid "Legacy key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Buffer too short"
+msgid "Request too short"
+msgstr "Vyrovnávací paměť je příliš malá"
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "Request too long"
+msgstr "Příliš dlouhý řádek"
+
+msgid "Object is in termination state"
+msgstr ""
+
+msgid "No certificate chain"
+msgstr "Chybí řetězec certifikátů"
+
+msgid "Certificate is too large"
+msgstr "Certifikát je příliš velký"
+
+msgid "Invalid record"
+msgstr "Neplatný záznam"
+
+msgid "The MAC does not verify"
+msgstr "Ověření MAC selhalo"
+
+msgid "Unexpected message"
+msgstr "Neočekávaná zpráva"
+
+msgid "Compression or decompression failed"
+msgstr "Komprese nebo dekomprese selhala"
+
+msgid "A counter would wrap"
+msgstr "Počítadlo by přeteklo"
+
+msgid "Fatal alert message received"
+msgstr "Přijata nepřekonatelná chybová zpráva"
+
+msgid "No cipher algorithm"
+msgstr "Žádný šifrovací algoritmus"
+
+msgid "Missing client certificate"
+msgstr "Chybí certifikát klienta"
+
+msgid "Close notification received"
+msgstr "Přijato oznámení o uzavření"
+
+msgid "Ticket expired"
+msgstr "Lístku vypršela platnost"
+
+msgid "Bad ticket"
+msgstr "Chybný lístek"
+
+msgid "Unknown identity"
+msgstr "Neznámá totožnost"
+
+msgid "Bad certificate message in handshake"
+msgstr "Chybná zpráva s certifikátem v zahájení"
+
+msgid "Bad certificate request message in handshake"
+msgstr "Chybná zpráva s požadavkem na certifikát v zahájení"
+
+msgid "Bad certificate verify message in handshake"
+msgstr "Chybná zpráva o ověření certifikátu v zahájení"
+
+msgid "Bad change cipher message in handshake"
+msgstr "Chybná zpráva se změnou šifry v zahájení"
+
+msgid "Bad client hello message in handshake"
+msgstr "Chybná zpráva s pozdravem klienta v zahájení"
+
+msgid "Bad server hello message in handshake"
+msgstr "Chybná zpráva s pozdravem serveru v zahájení"
+
+msgid "Bad server hello done message in handshake"
+msgstr "Chybná zpráva o dokončení pozdravu serveru v zahájení"
+
+msgid "Bad finished message in handshake"
+msgstr "Chybná zpráva o dokončení v zahájení"
+
+msgid "Bad server key exchange message in handshake"
+msgstr "Chybná zpráva o výměně klíče serveru v zahájení"
+
+msgid "Bad client key exchange message in handshake"
+msgstr "Chybná zpráva o výměně klíče klienta v zahájení"
+
+msgid "Bogus string"
+msgstr "Chybný řetězec"
+
+msgid "Forbidden"
+msgstr ""
+
+msgid "Key disabled"
+msgstr "Klíč zakázán"
+
+msgid "Not possible with a card based key"
+msgstr "Nelze provést s klíčem na kartě"
+
+msgid "Invalid lock object"
+msgstr "Neplatný objekt"
+
+msgid "True"
+msgstr ""
+
+msgid "False"
+msgstr ""
+
+msgid "General IPC error"
+msgstr "Obecná chyba IPC"
+
+msgid "IPC accept call failed"
+msgstr "IPC volání accept (přijmout) selhalo"
+
+msgid "IPC connect call failed"
+msgstr "IPC volání connect (připojit) selhalo"
+
+msgid "Invalid IPC response"
+msgstr "Neplatná odpověď IPC"
+
+msgid "Invalid value passed to IPC"
+msgstr "Neplatná hodnota předaná do IPC"
+
+msgid "Incomplete line passed to IPC"
+msgstr "Neúplný řádek předán do IPC"
+
+msgid "Line passed to IPC too long"
+msgstr "Řádek předaný do IPC je příliš dlouhý"
+
+msgid "Nested IPC commands"
+msgstr "Vnořené příkazy IPC"
+
+msgid "No data callback in IPC"
+msgstr "Žádná data zpětného volání v IPC"
+
+msgid "No inquire callback in IPC"
+msgstr "Žádné dotazovací zpětné volání v IPC"
+
+msgid "Not an IPC server"
+msgstr "Není serverem IPC"
+
+msgid "Not an IPC client"
+msgstr "Není klientem IPC"
+
+msgid "Problem starting IPC server"
+msgstr "Problém se spuštěním serveru IPC"
+
+msgid "IPC read error"
+msgstr "Chyba čtení IPC"
+
+msgid "IPC write error"
+msgstr "Chyba zápisu IPC"
+
+msgid "Too much data for IPC layer"
+msgstr "Příliš mnoho data pro vrstvu IPC"
+
+msgid "Unexpected IPC command"
+msgstr "Neočekávaný příkaz IPC"
+
+msgid "Unknown IPC command"
+msgstr "Neznámý příkaz IPC"
+
+msgid "IPC syntax error"
+msgstr "Chyba syntaxe IPC"
+
+msgid "IPC call has been cancelled"
+msgstr "Volání IPC bylo zrušeno"
+
+msgid "No input source for IPC"
+msgstr "Žádný zdroj vstupu pro IPC"
+
+msgid "No output source for IPC"
+msgstr "Žádný zdroj výstupu pro IPC"
+
+msgid "IPC parameter error"
+msgstr "Chyba parametru IPC"
+
+msgid "Unknown IPC inquire"
+msgstr "Neznámý dotaz IPC"
+
+#, fuzzy
+#| msgid "No crypto engine"
+msgid "Crypto engine too old"
+msgstr "Chybí kryptografická jednotka"
+
+msgid "Screen or window too small"
+msgstr ""
+
+msgid "Screen or window too large"
+msgstr ""
+
+msgid "Required environment variable not set"
+msgstr ""
+
+msgid "User ID already exists"
+msgstr ""
+
+msgid "Name already exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated name"
+msgstr "Zdvojená hodnota"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Object is too young"
+msgstr "Certifikát je příliš mladý"
+
+#, fuzzy
+#| msgid "Provided object is too short"
+msgid "Object is too old"
+msgstr "Dodaný objekt je příliš krátký"
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Unknown flag"
+msgstr "Neznámé jméno"
+
+#, fuzzy
+#| msgid "Invalid operation code"
+msgid "Invalid execution order"
+msgstr "Neplatný kód operace"
+
+msgid "Already fetched"
+msgstr ""
+
+msgid "Try again later"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Wrong name"
+msgstr "Neznámé jméno"
+
+msgid "System bug detected"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown system error"
+msgid "Unknown DNS error"
+msgstr "Neznámá chyba systému"
+
+#, fuzzy
+#| msgid "Invalid OID string"
+msgid "Invalid DNS section"
+msgstr "Neplatný řetězec OID"
+
+#, fuzzy
+#| msgid "Invalid S-expression"
+msgid "Invalid textual address form"
+msgstr "Neplatný S-výraz"
+
+#, fuzzy
+#| msgid "Missing issuer certificate"
+msgid "Missing DNS query packet"
+msgstr "Chybí certifikát vydavatele"
+
+msgid "Missing DNS answer packet"
+msgstr ""
+
+msgid "Connection closed in DNS"
+msgstr ""
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "Verification failed in DNS"
+msgstr "Dešifrování selhalo"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "DNS Timeout"
+msgstr "Čas vypršel"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "General LDAP error"
+msgstr "Obecná chyba IPC"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP attribute error"
+msgstr "Obecná chyba"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP name error"
+msgstr "Obecná chyba"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP security error"
+msgstr "Obecná chyba Assuanu"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP service error"
+msgstr "Obecná chyba"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP update error"
+msgstr "Obecná chyba Assuanu"
+
+msgid "Experimental LDAP error code"
+msgstr ""
+
+#, fuzzy
+#| msgid "IPC write error"
+msgid "Private LDAP error code"
+msgstr "Chyba zápisu IPC"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other general LDAP error"
+msgstr "Obecná chyba IPC"
+
+#, fuzzy
+#| msgid "IPC connect call failed"
+msgid "LDAP connecting failed (X)"
+msgstr "IPC volání connect (připojit) selhalo"
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral limit exceeded"
+msgstr "Obecná chyba"
+
+msgid "LDAP client loop"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "No LDAP results returned"
+msgstr "Vyžadován reset karty"
+
+#, fuzzy
+#| msgid "Element not found"
+msgid "LDAP control not found"
+msgstr "Prvek nenalezen"
+
+#, fuzzy
+#| msgid "Not supported"
+msgid "Not supported by LDAP"
+msgstr "Nepodporováno"
+
+#, fuzzy
+#| msgid "Unexpected error"
+msgid "LDAP connect error"
+msgstr "Neočekávaná chyba"
+
+msgid "Out of memory in LDAP"
+msgstr ""
+
+msgid "Bad parameter to an LDAP routine"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported operation"
+msgid "User cancelled LDAP operation"
+msgstr "Nepodporovaná operace"
+
+#, fuzzy
+#| msgid "Bad certificate"
+msgid "Bad LDAP search filter"
+msgstr "Chybný certifikát"
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "Unknown LDAP authentication method"
+msgstr "Neznámé rozšíření"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "Timeout in LDAP"
+msgstr "Čas vypršel"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP decoding error"
+msgstr "chyba dirmngr"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP encoding error"
+msgstr "chyba dirmngr"
+
+#, fuzzy
+#| msgid "IPC read error"
+msgid "LDAP local error"
+msgstr "Chyba čtení IPC"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot contact LDAP server"
+msgstr "Není serverem IPC"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP success"
+msgstr "Úspěch"
+
+# Nastavení nebo nastavování?
+#, fuzzy
+#| msgid "Configuration error"
+msgid "LDAP operations error"
+msgstr "Chyba konfigurace"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP protocol error"
+msgstr "Narušení protokolu"
+
+msgid "Time limit exceeded in LDAP"
+msgstr ""
+
+msgid "Size limit exceeded in LDAP"
+msgstr ""
+
+msgid "LDAP compare false"
+msgstr ""
+
+msgid "LDAP compare true"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "LDAP authentication method not supported"
+msgstr "Neznámé rozšíření"
+
+msgid "Strong(er) LDAP authentication required"
+msgstr ""
+
+#, fuzzy
+#| msgid "Fatal alert message received"
+msgid "Partial LDAP results+referral received"
+msgstr "Přijata nepřekonatelná chybová zpráva"
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral"
+msgstr "Obecná chyba"
+
+msgid "Administrative LDAP limit exceeded"
+msgstr ""
+
+msgid "Critical LDAP extension is unavailable"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Confidentiality required by LDAP"
+msgstr "Vyžadován reset karty"
+
+msgid "LDAP SASL bind in progress"
+msgstr ""
+
+msgid "No such LDAP attribute"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid attribute"
+msgid "Undefined LDAP attribute type"
+msgstr "Neplatný atribut"
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate matching in LDAP"
+msgstr "Nepodporovaná ochrana"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Constraint violation in LDAP"
+msgstr "Narušení protokolu"
+
+msgid "LDAP type or value exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid syntax in LDAP"
+msgstr "Neplatná stav"
+
+#, fuzzy
+#| msgid "No CMS object"
+msgid "No such LDAP object"
+msgstr "Žádný objekt CMS"
+
+#, fuzzy
+#| msgid "Hardware problem"
+msgid "LDAP alias problem"
+msgstr "Hardwarový problém"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid DN syntax in LDAP"
+msgstr "Neplatná stav"
+
+msgid "LDAP entry is a leaf"
+msgstr ""
+
+#, fuzzy
+#| msgid "Encoding problem"
+msgid "LDAP alias dereferencing problem"
+msgstr "Chyba kódování"
+
+msgid "LDAP proxy authorization failure (X)"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate LDAP authentication"
+msgstr "Nepodporovaná ochrana"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid LDAP credentials"
+msgstr "Neplatná karta"
+
+msgid "Insufficient access for LDAP"
+msgstr ""
+
+msgid "LDAP server is busy"
+msgstr ""
+
+#, fuzzy
+#| msgid "No keyserver available"
+msgid "LDAP server is unavailable"
+msgstr "Není dostupný žádný server klíčů"
+
+msgid "LDAP server is unwilling to perform"
+msgstr ""
+
+msgid "Loop detected by LDAP"
+msgstr ""
+
+#, fuzzy
+#| msgid "Missing action"
+msgid "LDAP naming violation"
+msgstr "Chybí akce"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP object class violation"
+msgstr "Narušení protokolu"
+
+#, fuzzy
+#| msgid "Operation not yet finished"
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "Operace ještě neskončila"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation not allowed on RDN"
+msgstr "Operace zrušena"
+
+msgid "Already exists (LDAP)"
+msgstr ""
+
+msgid "Cannot modify LDAP object class"
+msgstr ""
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "LDAP results too large"
+msgstr "Příliš dlouhý řádek"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation affects multiple DSAs"
+msgstr "Operace zrušena"
+
+msgid "Virtual LDAP list view error"
+msgstr ""
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other LDAP error"
+msgstr "Obecná chyba IPC"
+
+#, fuzzy
+#| msgid "Resources exhausted"
+msgid "Resources exhausted in LCUP"
+msgstr "Zdroje vyčerpány"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Security violation in LCUP"
+msgstr "Narušení protokolu"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid data in LCUP"
+msgstr "Neplatná stav"
+
+#, fuzzy
+#| msgid "Unsupported certificate"
+msgid "Unsupported scheme in LCUP"
+msgstr "Nepodporovaný certifikát"
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Reload required in LCUP"
+msgstr "Vyžadován reset karty"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP cancelled"
+msgstr "Úspěch"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "No LDAP operation to cancel"
+msgstr "Nefunkční"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "Too late to cancel LDAP"
+msgstr "Nefunkční"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot cancel LDAP"
+msgstr "Není serverem IPC"
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "LDAP assertion failed"
+msgstr "Dešifrování selhalo"
+
+msgid "Proxied authorization denied by LDAP"
+msgstr ""
+
+msgid "User defined error code 1"
+msgstr "Uživatelem definovaný chybový kód 1"
+
+msgid "User defined error code 2"
+msgstr "Uživatelem definovaný chybový kód 2"
+
+msgid "User defined error code 3"
+msgstr "Uživatelem definovaný chybový kód 3"
+
+msgid "User defined error code 4"
+msgstr "Uživatelem definovaný chybový kód 4"
+
+msgid "User defined error code 5"
+msgstr "Uživatelem definovaný chybový kód 5"
+
+msgid "User defined error code 6"
+msgstr "Uživatelem definovaný chybový kód 6"
+
+msgid "User defined error code 7"
+msgstr "Uživatelem definovaný chybový kód 7"
+
+msgid "User defined error code 8"
+msgstr "Uživatelem definovaný chybový kód 8"
+
+msgid "User defined error code 9"
+msgstr "Uživatelem definovaný chybový kód 9"
+
+msgid "User defined error code 10"
+msgstr "Uživatelem definovaný chybový kód 10"
+
+msgid "User defined error code 11"
+msgstr "Uživatelem definovaný chybový kód 11"
+
+msgid "User defined error code 12"
+msgstr "Uživatelem definovaný chybový kód 12"
+
+msgid "User defined error code 13"
+msgstr "Uživatelem definovaný chybový kód 13"
+
+msgid "User defined error code 14"
+msgstr "Uživatelem definovaný chybový kód 14"
+
+msgid "User defined error code 15"
+msgstr "Uživatelem definovaný chybový kód 15"
+
+msgid "User defined error code 16"
+msgstr "Uživatelem definovaný chybový kód 16"
+
+msgid "System error w/o errno"
+msgstr "Chyba systému bez čísla chyby (errno)"
+
+msgid "Unknown system error"
+msgstr "Neznámá chyba systému"
+
+msgid "End of file"
+msgstr "Konec souboru"
+
+msgid "Unknown error code"
+msgstr "Neznámý kód chyby"
+
+#, c-format
+msgid "Usage: %s GPG-ERROR [...]\n"
+msgstr "Použití: %s CHYBA_GPG […]\n"
+
+#, c-format
+msgid "%s: warning: could not recognize %s\n"
+msgstr "%s: pozor: %s nebylo možné rozpoznat\n"
+
+#, fuzzy
+#~| msgid "Resources exhausted"
+#~ msgid "LCUP Resources exhausted"
+#~ msgstr "Zdroje vyčerpány"
+
+#, fuzzy
+#~| msgid "Invalid data"
+#~ msgid "LCUP Invalid data"
+#~ msgstr "Neplatná data"
+
+#, fuzzy
+#~| msgid "General error"
+#~ msgid "LDAP Other general error"
+#~ msgstr "Obecná chyba"
+
+#, fuzzy
+#~| msgid "dirmngr error"
+#~ msgid "Encoding error"
+#~ msgstr "chyba dirmngr"
diff --git a/po/da.po b/po/da.po
new file mode 100644
index 0000000..c685ea2
--- /dev/null
+++ b/po/da.po
@@ -0,0 +1,1475 @@
+# Danish translation libgpg-error.
+# Copyright (C) 2014 g10 Code GmbH og nedenstående oversættere.
+# This file is distributed under the same license as the libgpg-error package.
+# Joe Hansen <[email protected]>, 2012, 2014.
+#
+# invalid -> ugyldig
+# bad -> ødelagt
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: libgpg-error 1.10\n"
+"Report-Msgid-Bugs-To: [email protected]\n"
+"PO-Revision-Date: 2014-11-17 20:08+0100\n"
+"Last-Translator: Joe Hansen <[email protected]>\n"
+"Language-Team: Danish <[email protected]>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "Unspecified source"
+msgstr "Uspecificeret kilde"
+
+msgid "gcrypt"
+msgstr "gcrypt"
+
+msgid "GnuPG"
+msgstr "GnuPG"
+
+msgid "GpgSM"
+msgstr "GpgSM"
+
+msgid "GPG Agent"
+msgstr "GPG-agent"
+
+# pinentry is a small collection of dialog programs that allow GnuPG to read passphrases and PIN numbers in a secure manner. There are versions for the common GTK and Qt toolkits as well as for the text terminal (Curses).
+msgid "Pinentry"
+msgstr "Pinentry"
+
+msgid "SCD"
+msgstr "SCD"
+
+msgid "GPGME"
+msgstr "GPGME"
+
+msgid "Keybox"
+msgstr "Keybox"
+
+msgid "KSBA"
+msgstr "KSBA"
+
+msgid "Dirmngr"
+msgstr "Dirmngr"
+
+msgid "GSTI"
+msgstr "GSTI"
+
+msgid "GPA"
+msgstr "GPA"
+
+msgid "Kleopatra"
+msgstr "Kleopatra"
+
+msgid "G13"
+msgstr "G13"
+
+msgid "Assuan"
+msgstr "Assuan"
+
+msgid "TLS"
+msgstr "TLS"
+
+msgid "Any source"
+msgstr "Enhver kilde"
+
+msgid "User defined source 1"
+msgstr "Brugerdefineret kilde 1"
+
+msgid "User defined source 2"
+msgstr "Brugerdefineret kilde 2"
+
+msgid "User defined source 3"
+msgstr "Brugerdefineret kilde 3"
+
+msgid "User defined source 4"
+msgstr "Brugerdefineret kilde 4"
+
+msgid "Unknown source"
+msgstr "Ukendt kilde"
+
+msgid "Success"
+msgstr "Lykkedes"
+
+msgid "General error"
+msgstr "Generel fejl"
+
+msgid "Unknown packet"
+msgstr "Ukendt pakke"
+
+msgid "Unknown version in packet"
+msgstr "Ukendt version i pakke"
+
+msgid "Invalid public key algorithm"
+msgstr "Ugyldig offentlig nøglealgoritme"
+
+msgid "Invalid digest algorithm"
+msgstr "Ugyldig sammendragsalgoritme"
+
+msgid "Bad public key"
+msgstr "Ødelagt offentlig nøgle"
+
+msgid "Bad secret key"
+msgstr "Ødelagt hemmelig nøgle"
+
+msgid "Bad signature"
+msgstr "Ødelagt underskrift"
+
+msgid "No public key"
+msgstr "Ingen offentlig nøgle"
+
+msgid "Checksum error"
+msgstr "Kontrolsumsfejl"
+
+msgid "Bad passphrase"
+msgstr "Ødelagt adgangsfrase"
+
+msgid "Invalid cipher algorithm"
+msgstr "Ugyldig chifferalgoritme"
+
+msgid "Cannot open keyring"
+msgstr "Nøglering åben"
+
+msgid "Invalid packet"
+msgstr "Ugyldig pakke"
+
+# armering eller pansring?
+msgid "Invalid armor"
+msgstr "Ugyldig pansring"
+
+msgid "No user ID"
+msgstr "Ingen bruger-id"
+
+msgid "No secret key"
+msgstr "Ingen hemmelig nøgle"
+
+msgid "Wrong secret key used"
+msgstr "Der blev brugt forkert hemmelig nøgle"
+
+msgid "Bad session key"
+msgstr "Ødelagt sessionnøgle"
+
+msgid "Unknown compression algorithm"
+msgstr "Ukendt komprimeringsalgoritme"
+
+msgid "Number is not prime"
+msgstr "Tal er ikke et primtal"
+
+msgid "Invalid encoding method"
+msgstr "Ugyldig kodningsmetode"
+
+msgid "Invalid encryption scheme"
+msgstr "Ugyldig krypteringsskema"
+
+msgid "Invalid signature scheme"
+msgstr "Ugyldig underskriftsskema"
+
+msgid "Invalid attribute"
+msgstr "Ugyldig attribut"
+
+msgid "No value"
+msgstr "Ingen værdi"
+
+msgid "Not found"
+msgstr "Ikke fundet"
+
+msgid "Value not found"
+msgstr "Værdi blev ikke fundet"
+
+msgid "Syntax error"
+msgstr "Syntaksfejl"
+
+msgid "Bad MPI value"
+msgstr "Ugyldig MPI-værdi"
+
+msgid "Invalid passphrase"
+msgstr "Ugyldig adgangsfrase"
+
+msgid "Invalid signature class"
+msgstr "Ugyldig underskriftklasse"
+
+msgid "Resources exhausted"
+msgstr "Ressourcer opbrugt"
+
+msgid "Invalid keyring"
+msgstr "Ugyldig nøglering"
+
+msgid "Trust DB error"
+msgstr "Trust DB-fejl"
+
+msgid "Bad certificate"
+msgstr "Ødelagt certifikat"
+
+msgid "Invalid user ID"
+msgstr "Ugyldig bruger-id"
+
+msgid "Unexpected error"
+msgstr "Uventet fejl"
+
+msgid "Time conflict"
+msgstr "Tidskonflikt"
+
+msgid "Keyserver error"
+msgstr "Nøgleserverfejl"
+
+msgid "Wrong public key algorithm"
+msgstr "Forkert offentlig nøglealgoritme"
+
+msgid "Tribute to D. A."
+msgstr "Tribut til D. A."
+
+msgid "Weak encryption key"
+msgstr "Svag krypteringsnøgle"
+
+msgid "Invalid key length"
+msgstr "Ugyldig nøglelængde"
+
+msgid "Invalid argument"
+msgstr "Ugyldigt argument"
+
+msgid "Syntax error in URI"
+msgstr "Syntaksfejl i URI"
+
+msgid "Invalid URI"
+msgstr "Ugyldig URI"
+
+msgid "Network error"
+msgstr "Netværksfejl"
+
+msgid "Unknown host"
+msgstr "Ukendt vært"
+
+msgid "Selftest failed"
+msgstr "Egentest mislykkedes"
+
+msgid "Data not encrypted"
+msgstr "Data er ikke krypteret"
+
+msgid "Data not processed"
+msgstr "Data er ikke behandlet"
+
+msgid "Unusable public key"
+msgstr "Ubrugelig offentlig nøgle"
+
+msgid "Unusable secret key"
+msgstr "Ubrugelig hemmelig nøgle"
+
+msgid "Invalid value"
+msgstr "Ugyldig værdi"
+
+msgid "Bad certificate chain"
+msgstr "Ødelagt certifikatkæde"
+
+msgid "Missing certificate"
+msgstr "Manglende certifikat"
+
+msgid "No data"
+msgstr "Ingen data"
+
+msgid "Bug"
+msgstr "Fejl"
+
+msgid "Not supported"
+msgstr "Ikke understøttet"
+
+msgid "Invalid operation code"
+msgstr "Ugyldig handlingskode"
+
+msgid "Timeout"
+msgstr "Tidsudløb"
+
+msgid "Internal error"
+msgstr "Intern fejl"
+
+msgid "EOF (gcrypt)"
+msgstr "EOF (gcrypt)"
+
+msgid "Invalid object"
+msgstr "Ugyldigt objekt"
+
+msgid "Provided object is too short"
+msgstr "Angivet objekt er for kort"
+
+msgid "Provided object is too large"
+msgstr "Angivet objekt er for stort"
+
+msgid "Missing item in object"
+msgstr "Manglende punkt i objekt"
+
+msgid "Not implemented"
+msgstr "Ikke implementeret"
+
+msgid "Conflicting use"
+msgstr "Konfliktende brug"
+
+msgid "Invalid cipher mode"
+msgstr "Ugyldig ciffertilstand"
+
+msgid "Invalid flag"
+msgstr "Ugyldigt flag"
+
+msgid "Invalid handle"
+msgstr "Ugyldigt håndtag"
+
+msgid "Result truncated"
+msgstr "Resultat afkortet"
+
+msgid "Incomplete line"
+msgstr "Ufuldstændig linje"
+
+msgid "Invalid response"
+msgstr "Ugyldigt svar"
+
+msgid "No agent running"
+msgstr "Ingen agent kører"
+
+msgid "Agent error"
+msgstr "Agentfejl"
+
+msgid "Invalid data"
+msgstr "Ugyldige data"
+
+msgid "Unspecific Assuan server fault"
+msgstr "Uspecificeret Assuan-serverfejl"
+
+msgid "General Assuan error"
+msgstr "Generel Assuanfejl"
+
+msgid "Invalid session key"
+msgstr "Ugyldig sessionsnøgle"
+
+msgid "Invalid S-expression"
+msgstr "Ugyldigt S-udtryk"
+
+msgid "Unsupported algorithm"
+msgstr "Ej understøttet algoritme"
+
+msgid "No pinentry"
+msgstr "Ingen pinentry"
+
+msgid "pinentry error"
+msgstr "pinentry-fejl"
+
+msgid "Bad PIN"
+msgstr "Ødelagt PIN"
+
+msgid "Invalid name"
+msgstr "Ugyldigt navn"
+
+msgid "Bad data"
+msgstr "Ødelagte data"
+
+msgid "Invalid parameter"
+msgstr "Ugyldig parameter"
+
+msgid "Wrong card"
+msgstr "Forkert kort"
+
+msgid "No dirmngr"
+msgstr "Ingen dirmngr"
+
+msgid "dirmngr error"
+msgstr "dirmngr-fejl"
+
+msgid "Certificate revoked"
+msgstr "Certifikat tilbagekaldt"
+
+msgid "No CRL known"
+msgstr "Ingen kendt CRL"
+
+msgid "CRL too old"
+msgstr "CRL er for gammel"
+
+msgid "Line too long"
+msgstr "Linje er for lang"
+
+msgid "Not trusted"
+msgstr "Ikke troværdig"
+
+msgid "Operation cancelled"
+msgstr "Handling afbrudt"
+
+msgid "Bad CA certificate"
+msgstr "Ødelagt CA-certifikat"
+
+msgid "Certificate expired"
+msgstr "Certifikat udløbet"
+
+msgid "Certificate too young"
+msgstr "Certifikat for ungt"
+
+msgid "Unsupported certificate"
+msgstr "Ej understøttet certifikat"
+
+msgid "Unknown S-expression"
+msgstr "Ukendt S-udtryk"
+
+msgid "Unsupported protection"
+msgstr "Ej understøttet beskyttelse"
+
+msgid "Corrupted protection"
+msgstr "Ødelagt beskyttelse"
+
+msgid "Ambiguous name"
+msgstr "Tvetydigt navn"
+
+msgid "Card error"
+msgstr "Kortfejl"
+
+msgid "Card reset required"
+msgstr "Kortnulstilling krævet"
+
+msgid "Card removed"
+msgstr "Kort fjernet"
+
+msgid "Invalid card"
+msgstr "Ugyldigt kort"
+
+msgid "Card not present"
+msgstr "Kort er ikke til stede"
+
+msgid "No PKCS15 application"
+msgstr "Intet PKCS15-program"
+
+msgid "Not confirmed"
+msgstr "Ikke bekræftet"
+
+msgid "Configuration error"
+msgstr "Konfigurationsfejl"
+
+msgid "No policy match"
+msgstr "Ingen politikmatch"
+
+msgid "Invalid index"
+msgstr "Ugyldigt indeks"
+
+msgid "Invalid ID"
+msgstr "Ugyldigt id"
+
+msgid "No SmartCard daemon"
+msgstr "Ingen SmartCard-dæmon"
+
+msgid "SmartCard daemon error"
+msgstr "SmartCard-dæmonfejl"
+
+msgid "Unsupported protocol"
+msgstr "Ej understøttet protokol"
+
+msgid "Bad PIN method"
+msgstr "Ødelagt PIN-metode"
+
+msgid "Card not initialized"
+msgstr "Kort er ikke initialiseret"
+
+msgid "Unsupported operation"
+msgstr "Ej understøttet handling"
+
+msgid "Wrong key usage"
+msgstr "Forkert nøglebrug"
+
+msgid "Nothing found"
+msgstr "Intet fundet"
+
+msgid "Wrong blob type"
+msgstr "Forkert blobtype"
+
+msgid "Missing value"
+msgstr "Manglende værdi"
+
+msgid "Hardware problem"
+msgstr "Maskinelt problem"
+
+msgid "PIN blocked"
+msgstr "PIN blokeret"
+
+msgid "Conditions of use not satisfied"
+msgstr "Betingelser for brug er ikke overholdt"
+
+msgid "PINs are not synced"
+msgstr "PIN'er er ikke synkroniserede"
+
+msgid "Invalid CRL"
+msgstr "Ugyldig CRL"
+
+msgid "BER error"
+msgstr "BER-fejl"
+
+msgid "Invalid BER"
+msgstr "Ugyldig BER"
+
+msgid "Element not found"
+msgstr "Element er ikke fundet"
+
+msgid "Identifier not found"
+msgstr "Identifikator er ikke fundet"
+
+msgid "Invalid tag"
+msgstr "Ugyldigt mærke"
+
+msgid "Invalid length"
+msgstr "Ugyldig længde"
+
+msgid "Invalid key info"
+msgstr "Ugyldig nøgleinformation"
+
+msgid "Unexpected tag"
+msgstr "Uventet mærke"
+
+msgid "Not DER encoded"
+msgstr "Ikke DER-kodet"
+
+msgid "No CMS object"
+msgstr "Intet CMS-objekt"
+
+msgid "Invalid CMS object"
+msgstr "Ugyldigt CMS-objekt"
+
+msgid "Unknown CMS object"
+msgstr "Ukendt CMS-objekt"
+
+msgid "Unsupported CMS object"
+msgstr "Ej understøttet CMS-objekt"
+
+msgid "Unsupported encoding"
+msgstr "Ej understøttet kodning"
+
+msgid "Unsupported CMS version"
+msgstr "Ej understøttet CMS-version"
+
+msgid "Unknown algorithm"
+msgstr "Ukendt algoritme"
+
+msgid "Invalid crypto engine"
+msgstr "Ugyldig cryptomotor"
+
+msgid "Public key not trusted"
+msgstr "Offentlig nøgle er ikke troværdig"
+
+msgid "Decryption failed"
+msgstr "Afkryptering mislykkedes"
+
+msgid "Key expired"
+msgstr "Nøgle udløbet"
+
+msgid "Signature expired"
+msgstr "Underskrift udløbet"
+
+msgid "Encoding problem"
+msgstr "Kodningsproblem"
+
+msgid "Invalid state"
+msgstr "Ugyldig tilstand"
+
+msgid "Duplicated value"
+msgstr "Duplikeret værdi"
+
+msgid "Missing action"
+msgstr "Manglende handling"
+
+msgid "ASN.1 module not found"
+msgstr "ASN.1-modul er ikke fundet"
+
+msgid "Invalid OID string"
+msgstr "Ugyldig OID-streng"
+
+msgid "Invalid time"
+msgstr "Ugyldig tid"
+
+msgid "Invalid CRL object"
+msgstr "Ugyldigt CRL-objekt"
+
+msgid "Unsupported CRL version"
+msgstr "Ej understøttet CRL-version"
+
+msgid "Invalid certificate object"
+msgstr "Ugyldigt certifikatobjekt"
+
+msgid "Unknown name"
+msgstr "Ukendt navn"
+
+msgid "A locale function failed"
+msgstr "En lokal funktion mislykkedes"
+
+msgid "Not locked"
+msgstr "Ikke låst"
+
+msgid "Protocol violation"
+msgstr "Protokolovertrædelse"
+
+msgid "Invalid MAC"
+msgstr "Ugyldig MAC"
+
+msgid "Invalid request"
+msgstr "Ugyldig forespørgsel"
+
+msgid "Unknown extension"
+msgstr "Ukendt udvidelse"
+
+msgid "Unknown critical extension"
+msgstr "Ukendt kritisk udvidelse"
+
+msgid "Locked"
+msgstr "Låst"
+
+msgid "Unknown option"
+msgstr "Ukendt indstilling"
+
+msgid "Unknown command"
+msgstr "Ukendt kommando"
+
+msgid "Not operational"
+msgstr "Ikke funktionsdygtig"
+
+msgid "No passphrase given"
+msgstr "Ingen adgangsfrase angivet"
+
+msgid "No PIN given"
+msgstr "Ingen PIN angivet"
+
+msgid "Not enabled"
+msgstr "Ikke aktiveret"
+
+msgid "No crypto engine"
+msgstr "Ingen cryptomotor"
+
+msgid "Missing key"
+msgstr "Manglende nøgle"
+
+msgid "Too many objects"
+msgstr "For mange objekter"
+
+msgid "Limit reached"
+msgstr "Begrænsning nået"
+
+msgid "Not initialized"
+msgstr "Ikke initialiseret"
+
+msgid "Missing issuer certificate"
+msgstr "Manglende udstedercertfikat"
+
+msgid "No keyserver available"
+msgstr "Ingen nøgleserver tilgængelig"
+
+msgid "Invalid elliptic curve"
+msgstr "Ugyldig elliptisk kurve"
+
+msgid "Unknown elliptic curve"
+msgstr "Ukendt elliptisk kurve"
+
+msgid "Duplicated key"
+msgstr "Duplikeret nøgle"
+
+msgid "Ambiguous result"
+msgstr "Tvetydigt resultat"
+
+msgid "No crypto context"
+msgstr "Ingen cryptokontekst"
+
+msgid "Wrong crypto context"
+msgstr "Forkert cryptokontekst"
+
+msgid "Bad crypto context"
+msgstr "Ugyldig cryptokontekst"
+
+msgid "Conflict in the crypto context"
+msgstr "Konflikt i cryptokonteksten"
+
+msgid "Broken public key"
+msgstr "Ødelagt offentlig nøgle"
+
+msgid "Broken secret key"
+msgstr "Ødelagt hemmelig nøgle"
+
+msgid "Invalid MAC algorithm"
+msgstr "Ugyldig MAC-algoritme"
+
+msgid "Operation fully cancelled"
+msgstr "Handling fuldt afbrudt"
+
+msgid "Operation not yet finished"
+msgstr "Handling ikke færdig endnu"
+
+msgid "Buffer too short"
+msgstr "Buffer for kort"
+
+msgid "Invalid length specifier in S-expression"
+msgstr "Ugyldig længdeangiver i S-udtryk"
+
+msgid "String too long in S-expression"
+msgstr "Streng for kort i S-udtryk"
+
+msgid "Unmatched parentheses in S-expression"
+msgstr "Ej matchende parenteser i S-udtryk"
+
+msgid "S-expression not canonical"
+msgstr "S-udtryk er ikke kanonisk"
+
+msgid "Bad character in S-expression"
+msgstr "Ødelagt tegn i S-udtryk"
+
+msgid "Bad quotation in S-expression"
+msgstr "Ødelagt citation i S-udtryk"
+
+msgid "Zero prefix in S-expression"
+msgstr "Nulpræfiks i S-udtryk"
+
+msgid "Nested display hints in S-expression"
+msgstr "Indlejrede visningsfif i S-udtryk"
+
+msgid "Unmatched display hints"
+msgstr "Ej matchende visningsfif"
+
+msgid "Unexpected reserved punctuation in S-expression"
+msgstr "Uventet reserveret punktum i S-udtryk"
+
+msgid "Bad hexadecimal character in S-expression"
+msgstr "Ødelagt hexadecimalt tegn i S-udtryk"
+
+msgid "Odd hexadecimal numbers in S-expression"
+msgstr "Ulige hexadecimalt tal i S-udtryk"
+
+msgid "Bad octal character in S-expression"
+msgstr "Ødelagt oktalt tegn i S-udtryk"
+
+msgid "All subkeys are expired or revoked"
+msgstr ""
+
+#, fuzzy
+#| msgid "Data not encrypted"
+msgid "Database is corrupted"
+msgstr "Data er ikke krypteret"
+
+msgid "Server indicated a failure"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "No name"
+msgstr "Ukendt navn"
+
+#, fuzzy
+#| msgid "No public key"
+msgid "No key"
+msgstr "Ingen offentlig nøgle"
+
+msgid "Legacy key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Buffer too short"
+msgid "Request too short"
+msgstr "Buffer for kort"
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "Request too long"
+msgstr "Linje er for lang"
+
+msgid "Object is in termination state"
+msgstr ""
+
+msgid "No certificate chain"
+msgstr "Ingen certifikatkæde"
+
+msgid "Certificate is too large"
+msgstr "Certifikatet er for stort"
+
+msgid "Invalid record"
+msgstr "Ugyldig post"
+
+msgid "The MAC does not verify"
+msgstr "MAC'en verificerer ikke"
+
+msgid "Unexpected message"
+msgstr "Uventet besked"
+
+msgid "Compression or decompression failed"
+msgstr "Pakning eller udpakning mislykkedes"
+
+msgid "A counter would wrap"
+msgstr "En tæller ville pakke ind"
+
+msgid "Fatal alert message received"
+msgstr "Modtog »fatal alarm«-besked"
+
+msgid "No cipher algorithm"
+msgstr "Ingen chifferalgoritme"
+
+msgid "Missing client certificate"
+msgstr "Manglende klientcertfikat"
+
+msgid "Close notification received"
+msgstr "Luk modtaget påmindelse"
+
+msgid "Ticket expired"
+msgstr "Billetten udløbet"
+
+msgid "Bad ticket"
+msgstr "Ødelagt billet"
+
+msgid "Unknown identity"
+msgstr "Ukendt identitet"
+
+msgid "Bad certificate message in handshake"
+msgstr "Besked om ødelagt certifikat i håndtrykket"
+
+msgid "Bad certificate request message in handshake"
+msgstr "Besked om ødelagt certifikatforespørgsel i håndtrykket"
+
+msgid "Bad certificate verify message in handshake"
+msgstr "Besked om ødelagt certifikatforespørgsel i håndtrykket"
+
+msgid "Bad change cipher message in handshake"
+msgstr "Ødelagt »ændr chiffer«-besked i håndtrykket"
+
+msgid "Bad client hello message in handshake"
+msgstr "Besked om ødelagt klienthilsen i håndtrykket"
+
+msgid "Bad server hello message in handshake"
+msgstr "Besked om ødelagt serverhilsen i håndtrykket"
+
+# engelsk fejl
+msgid "Bad server hello done message in handshake"
+msgstr "Ødelagt »afsluttet serverhilsen«-besked i håndtrykket"
+
+msgid "Bad finished message in handshake"
+msgstr "Ødelagt »afsluttet«-besked i håndtrykket"
+
+msgid "Bad server key exchange message in handshake"
+msgstr "Besked om ødelagt udveksling af servernøgle i håndtrykket"
+
+msgid "Bad client key exchange message in handshake"
+msgstr "Besked om ødelagt udveksling af klientnøgle i håndtrykket"
+
+msgid "Bogus string"
+msgstr "Fejlbehæftet streng"
+
+msgid "Forbidden"
+msgstr ""
+
+msgid "Key disabled"
+msgstr "Nøglen er deaktiveret"
+
+msgid "Not possible with a card based key"
+msgstr "Ikke muligt med en kortbaseret nøgle"
+
+msgid "Invalid lock object"
+msgstr "Ugyldigt låseobjekt"
+
+msgid "True"
+msgstr ""
+
+msgid "False"
+msgstr ""
+
+msgid "General IPC error"
+msgstr "Generel IPC-fejl"
+
+msgid "IPC accept call failed"
+msgstr "IPC-acceptkald mislykkedes"
+
+msgid "IPC connect call failed"
+msgstr "IPC-forbindelseskald mislykkedes"
+
+msgid "Invalid IPC response"
+msgstr "Ugyldigt IPC-svar"
+
+msgid "Invalid value passed to IPC"
+msgstr "Ugyldig værdi sendt til IPC"
+
+msgid "Incomplete line passed to IPC"
+msgstr "Ufuldstændig linje sendt til IPC"
+
+msgid "Line passed to IPC too long"
+msgstr "Linje sendt til IPC er for lang"
+
+msgid "Nested IPC commands"
+msgstr "Indlejrede IPC-kommandoer"
+
+msgid "No data callback in IPC"
+msgstr "Ingen datatilbagekald i IPC"
+
+msgid "No inquire callback in IPC"
+msgstr "Ingen inquire-tilbagekald i IPC"
+
+msgid "Not an IPC server"
+msgstr "Ikke en IPC-server"
+
+msgid "Not an IPC client"
+msgstr "Ikke en IPC-klient"
+
+msgid "Problem starting IPC server"
+msgstr "Problem med at starte IPC-server"
+
+msgid "IPC read error"
+msgstr "IPC-læsefejl"
+
+msgid "IPC write error"
+msgstr "IPC-skrivefejl"
+
+msgid "Too much data for IPC layer"
+msgstr "For mange data for IPC-lag"
+
+msgid "Unexpected IPC command"
+msgstr "Uventet IPC-kommando"
+
+msgid "Unknown IPC command"
+msgstr "Ukendt IPC-kommando"
+
+msgid "IPC syntax error"
+msgstr "IPC-syntaksfejl"
+
+msgid "IPC call has been cancelled"
+msgstr "IPC-kald er blevet afbrudt"
+
+msgid "No input source for IPC"
+msgstr "Ingen inddatakilde for IPC"
+
+msgid "No output source for IPC"
+msgstr "Ingen uddatakilde for IPC"
+
+msgid "IPC parameter error"
+msgstr "IPC-parameterfejl"
+
+msgid "Unknown IPC inquire"
+msgstr "Ukendt IPC-inquire"
+
+#, fuzzy
+#| msgid "No crypto engine"
+msgid "Crypto engine too old"
+msgstr "Ingen cryptomotor"
+
+msgid "Screen or window too small"
+msgstr ""
+
+msgid "Screen or window too large"
+msgstr ""
+
+msgid "Required environment variable not set"
+msgstr ""
+
+msgid "User ID already exists"
+msgstr ""
+
+msgid "Name already exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated name"
+msgstr "Duplikeret værdi"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Object is too young"
+msgstr "Certifikat for ungt"
+
+#, fuzzy
+#| msgid "Provided object is too short"
+msgid "Object is too old"
+msgstr "Angivet objekt er for kort"
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Unknown flag"
+msgstr "Ukendt navn"
+
+#, fuzzy
+#| msgid "Invalid operation code"
+msgid "Invalid execution order"
+msgstr "Ugyldig handlingskode"
+
+msgid "Already fetched"
+msgstr ""
+
+msgid "Try again later"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Wrong name"
+msgstr "Ukendt navn"
+
+msgid "System bug detected"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown system error"
+msgid "Unknown DNS error"
+msgstr "Ukendt systemfejl"
+
+#, fuzzy
+#| msgid "Invalid OID string"
+msgid "Invalid DNS section"
+msgstr "Ugyldig OID-streng"
+
+#, fuzzy
+#| msgid "Invalid S-expression"
+msgid "Invalid textual address form"
+msgstr "Ugyldigt S-udtryk"
+
+#, fuzzy
+#| msgid "Missing issuer certificate"
+msgid "Missing DNS query packet"
+msgstr "Manglende udstedercertfikat"
+
+msgid "Missing DNS answer packet"
+msgstr ""
+
+msgid "Connection closed in DNS"
+msgstr ""
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "Verification failed in DNS"
+msgstr "Afkryptering mislykkedes"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "DNS Timeout"
+msgstr "Tidsudløb"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "General LDAP error"
+msgstr "Generel IPC-fejl"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP attribute error"
+msgstr "Generel fejl"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP name error"
+msgstr "Generel fejl"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP security error"
+msgstr "Generel Assuanfejl"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP service error"
+msgstr "Generel fejl"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP update error"
+msgstr "Generel Assuanfejl"
+
+msgid "Experimental LDAP error code"
+msgstr ""
+
+#, fuzzy
+#| msgid "IPC write error"
+msgid "Private LDAP error code"
+msgstr "IPC-skrivefejl"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other general LDAP error"
+msgstr "Generel IPC-fejl"
+
+#, fuzzy
+#| msgid "IPC connect call failed"
+msgid "LDAP connecting failed (X)"
+msgstr "IPC-forbindelseskald mislykkedes"
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral limit exceeded"
+msgstr "Generel fejl"
+
+msgid "LDAP client loop"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "No LDAP results returned"
+msgstr "Kortnulstilling krævet"
+
+#, fuzzy
+#| msgid "Element not found"
+msgid "LDAP control not found"
+msgstr "Element er ikke fundet"
+
+#, fuzzy
+#| msgid "Not supported"
+msgid "Not supported by LDAP"
+msgstr "Ikke understøttet"
+
+#, fuzzy
+#| msgid "Unexpected error"
+msgid "LDAP connect error"
+msgstr "Uventet fejl"
+
+msgid "Out of memory in LDAP"
+msgstr ""
+
+msgid "Bad parameter to an LDAP routine"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported operation"
+msgid "User cancelled LDAP operation"
+msgstr "Ej understøttet handling"
+
+#, fuzzy
+#| msgid "Bad certificate"
+msgid "Bad LDAP search filter"
+msgstr "Ødelagt certifikat"
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "Unknown LDAP authentication method"
+msgstr "Ukendt udvidelse"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "Timeout in LDAP"
+msgstr "Tidsudløb"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP decoding error"
+msgstr "dirmngr-fejl"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP encoding error"
+msgstr "dirmngr-fejl"
+
+#, fuzzy
+#| msgid "IPC read error"
+msgid "LDAP local error"
+msgstr "IPC-læsefejl"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot contact LDAP server"
+msgstr "Ikke en IPC-server"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP success"
+msgstr "Lykkedes"
+
+#, fuzzy
+#| msgid "Configuration error"
+msgid "LDAP operations error"
+msgstr "Konfigurationsfejl"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP protocol error"
+msgstr "Protokolovertrædelse"
+
+msgid "Time limit exceeded in LDAP"
+msgstr ""
+
+msgid "Size limit exceeded in LDAP"
+msgstr ""
+
+msgid "LDAP compare false"
+msgstr ""
+
+msgid "LDAP compare true"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "LDAP authentication method not supported"
+msgstr "Ukendt udvidelse"
+
+msgid "Strong(er) LDAP authentication required"
+msgstr ""
+
+#, fuzzy
+#| msgid "Fatal alert message received"
+msgid "Partial LDAP results+referral received"
+msgstr "Modtog »fatal alarm«-besked"
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral"
+msgstr "Generel fejl"
+
+msgid "Administrative LDAP limit exceeded"
+msgstr ""
+
+msgid "Critical LDAP extension is unavailable"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Confidentiality required by LDAP"
+msgstr "Kortnulstilling krævet"
+
+msgid "LDAP SASL bind in progress"
+msgstr ""
+
+msgid "No such LDAP attribute"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid attribute"
+msgid "Undefined LDAP attribute type"
+msgstr "Ugyldig attribut"
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate matching in LDAP"
+msgstr "Ej understøttet beskyttelse"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Constraint violation in LDAP"
+msgstr "Protokolovertrædelse"
+
+msgid "LDAP type or value exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid syntax in LDAP"
+msgstr "Ugyldig tilstand"
+
+#, fuzzy
+#| msgid "No CMS object"
+msgid "No such LDAP object"
+msgstr "Intet CMS-objekt"
+
+#, fuzzy
+#| msgid "Hardware problem"
+msgid "LDAP alias problem"
+msgstr "Maskinelt problem"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid DN syntax in LDAP"
+msgstr "Ugyldig tilstand"
+
+msgid "LDAP entry is a leaf"
+msgstr ""
+
+#, fuzzy
+#| msgid "Encoding problem"
+msgid "LDAP alias dereferencing problem"
+msgstr "Kodningsproblem"
+
+msgid "LDAP proxy authorization failure (X)"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate LDAP authentication"
+msgstr "Ej understøttet beskyttelse"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid LDAP credentials"
+msgstr "Ugyldigt kort"
+
+msgid "Insufficient access for LDAP"
+msgstr ""
+
+msgid "LDAP server is busy"
+msgstr ""
+
+#, fuzzy
+#| msgid "No keyserver available"
+msgid "LDAP server is unavailable"
+msgstr "Ingen nøgleserver tilgængelig"
+
+msgid "LDAP server is unwilling to perform"
+msgstr ""
+
+msgid "Loop detected by LDAP"
+msgstr ""
+
+#, fuzzy
+#| msgid "Missing action"
+msgid "LDAP naming violation"
+msgstr "Manglende handling"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP object class violation"
+msgstr "Protokolovertrædelse"
+
+#, fuzzy
+#| msgid "Operation not yet finished"
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "Handling ikke færdig endnu"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation not allowed on RDN"
+msgstr "Handling afbrudt"
+
+msgid "Already exists (LDAP)"
+msgstr ""
+
+msgid "Cannot modify LDAP object class"
+msgstr ""
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "LDAP results too large"
+msgstr "Linje er for lang"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation affects multiple DSAs"
+msgstr "Handling afbrudt"
+
+msgid "Virtual LDAP list view error"
+msgstr ""
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other LDAP error"
+msgstr "Generel IPC-fejl"
+
+#, fuzzy
+#| msgid "Resources exhausted"
+msgid "Resources exhausted in LCUP"
+msgstr "Ressourcer opbrugt"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Security violation in LCUP"
+msgstr "Protokolovertrædelse"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid data in LCUP"
+msgstr "Ugyldig tilstand"
+
+#, fuzzy
+#| msgid "Unsupported certificate"
+msgid "Unsupported scheme in LCUP"
+msgstr "Ej understøttet certifikat"
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Reload required in LCUP"
+msgstr "Kortnulstilling krævet"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP cancelled"
+msgstr "Lykkedes"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "No LDAP operation to cancel"
+msgstr "Ikke funktionsdygtig"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "Too late to cancel LDAP"
+msgstr "Ikke funktionsdygtig"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot cancel LDAP"
+msgstr "Ikke en IPC-server"
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "LDAP assertion failed"
+msgstr "Afkryptering mislykkedes"
+
+msgid "Proxied authorization denied by LDAP"
+msgstr ""
+
+msgid "User defined error code 1"
+msgstr "Brugerdefineret fejlkode 1"
+
+msgid "User defined error code 2"
+msgstr "Brugerdefineret fejlkode 2"
+
+msgid "User defined error code 3"
+msgstr "Brugerdefineret fejlkode 3"
+
+msgid "User defined error code 4"
+msgstr "Brugerdefineret fejlkode 4"
+
+msgid "User defined error code 5"
+msgstr "Brugerdefineret fejlkode 5"
+
+msgid "User defined error code 6"
+msgstr "Brugerdefineret fejlkode 6"
+
+msgid "User defined error code 7"
+msgstr "Brugerdefineret fejlkode 7"
+
+msgid "User defined error code 8"
+msgstr "Brugerdefineret fejlkode 8"
+
+msgid "User defined error code 9"
+msgstr "Brugerdefineret fejlkode 9"
+
+msgid "User defined error code 10"
+msgstr "Brugerdefineret fejlkode 10"
+
+msgid "User defined error code 11"
+msgstr "Brugerdefineret fejlkode 11"
+
+msgid "User defined error code 12"
+msgstr "Brugerdefineret fejlkode 12"
+
+msgid "User defined error code 13"
+msgstr "Brugerdefineret fejlkode 13"
+
+msgid "User defined error code 14"
+msgstr "Brugerdefineret fejlkode 14"
+
+msgid "User defined error code 15"
+msgstr "Brugerdefineret fejlkode 15"
+
+msgid "User defined error code 16"
+msgstr "Brugerdefineret fejlkode 16"
+
+msgid "System error w/o errno"
+msgstr "Systemfejl w/o errno"
+
+msgid "Unknown system error"
+msgstr "Ukendt systemfejl"
+
+msgid "End of file"
+msgstr "Slutning på fil"
+
+msgid "Unknown error code"
+msgstr "Ukendt fejlkode"
+
+#, c-format
+msgid "Usage: %s GPG-ERROR [...]\n"
+msgstr "Brug: %s GPG-ERROR [...]\n"
+
+#, c-format
+msgid "%s: warning: could not recognize %s\n"
+msgstr "%s: advarsel: kunne ikke genkende %s\n"
+
+#, fuzzy
+#~| msgid "Resources exhausted"
+#~ msgid "LCUP Resources exhausted"
+#~ msgstr "Ressourcer opbrugt"
+
+#, fuzzy
+#~| msgid "Invalid data"
+#~ msgid "LCUP Invalid data"
+#~ msgstr "Ugyldige data"
+
+#, fuzzy
+#~| msgid "General error"
+#~ msgid "LDAP Other general error"
+#~ msgstr "Generel fejl"
+
+#, fuzzy
+#~| msgid "dirmngr error"
+#~ msgid "Encoding error"
+#~ msgstr "dirmngr-fejl"
diff --git a/po/de.po b/po/de.po
new file mode 100644
index 0000000..b2b1e9a
--- /dev/null
+++ b/po/de.po
@@ -0,0 +1,1320 @@
+# de.po - German strings for libgpg-error
+# Copyright (C) 2003 g10 Code GmbH
+# This file is distributed under the terms of the GNU LGPL v2.1 or later.
+# Werner Koch <[email protected]>, 2003.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: libgpg-error-1.19\n"
+"Report-Msgid-Bugs-To: [email protected]\n"
+"PO-Revision-Date: 2017-02-28 12:47+0100\n"
+"Last-Translator: Werner Koch <[email protected]>\n"
+"Language-Team: none\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "Unspecified source"
+msgstr "Quelle nicht angegeben"
+
+msgid "gcrypt"
+msgstr "gcrypt"
+
+msgid "GnuPG"
+msgstr "GPG"
+
+msgid "GpgSM"
+msgstr "GPGSM"
+
+msgid "GPG Agent"
+msgstr "GPG Agent"
+
+msgid "Pinentry"
+msgstr "Pinentry"
+
+msgid "SCD"
+msgstr "SCD"
+
+msgid "GPGME"
+msgstr "GPGME"
+
+msgid "Keybox"
+msgstr "Keybox"
+
+msgid "KSBA"
+msgstr "KSBA"
+
+msgid "Dirmngr"
+msgstr "Dirmngr"
+
+msgid "GSTI"
+msgstr "GSTI"
+
+msgid "GPA"
+msgstr "GPA"
+
+msgid "Kleopatra"
+msgstr "Kleopatra"
+
+msgid "G13"
+msgstr "G13"
+
+msgid "Assuan"
+msgstr "Assuan"
+
+msgid "TLS"
+msgstr "TLS"
+
+msgid "Any source"
+msgstr "Unspezifische Quelle"
+
+msgid "User defined source 1"
+msgstr "Benutzerdefinierte Quelle 1"
+
+msgid "User defined source 2"
+msgstr "Benutzerdefinierte Quelle 2"
+
+msgid "User defined source 3"
+msgstr "Benutzerdefinierte Quelle 3"
+
+msgid "User defined source 4"
+msgstr "Benutzerdefinierte Quelle 4"
+
+msgid "Unknown source"
+msgstr "Unbekannte Quelle"
+
+msgid "Success"
+msgstr "Erfolg"
+
+msgid "General error"
+msgstr "Allgemeiner Fehler"
+
+msgid "Unknown packet"
+msgstr "Unbekanntes Paket"
+
+msgid "Unknown version in packet"
+msgstr "Unbekannte Version im Paket"
+
+msgid "Invalid public key algorithm"
+msgstr "Ungültiges Public-Key-Verfahren"
+
+msgid "Invalid digest algorithm"
+msgstr "Ungültige Hashmethode"
+
+msgid "Bad public key"
+msgstr "Fehlerhafter öffentlicher Schlüssel"
+
+msgid "Bad secret key"
+msgstr "Fehlerhafter geheimer Schlüssel"
+
+msgid "Bad signature"
+msgstr "Falsche Unterschrift"
+
+msgid "No public key"
+msgstr "Kein öffentlicher Schlüssel"
+
+msgid "Checksum error"
+msgstr "Prüfsummenfehler"
+
+msgid "Bad passphrase"
+msgstr "Falsche Passphrase"
+
+msgid "Invalid cipher algorithm"
+msgstr "Ungültiges Verschlüsselungsverfahren"
+
+msgid "Cannot open keyring"
+msgstr "Schlüsselbund kann nicht geöffnet werden"
+
+msgid "Invalid packet"
+msgstr "Ungültiges Paket"
+
+msgid "Invalid armor"
+msgstr "Ungültige ASCII-Hülle"
+
+msgid "No user ID"
+msgstr "Keine User-ID"
+
+msgid "No secret key"
+msgstr "Kein geheimer Schlüssel"
+
+msgid "Wrong secret key used"
+msgstr "Falscher geheimer Schlüssel benutzt"
+
+msgid "Bad session key"
+msgstr "Fehlerhafte Sitzungsschlüssel"
+
+msgid "Unknown compression algorithm"
+msgstr "Unbekanntes Komprimierungsverfahren"
+
+msgid "Number is not prime"
+msgstr "Zahl ist nicht prim"
+
+msgid "Invalid encoding method"
+msgstr "Ungültiges Kodierungsverfahren"
+
+msgid "Invalid encryption scheme"
+msgstr "Ungültiges Verschlüsselungsschema"
+
+msgid "Invalid signature scheme"
+msgstr "Ungültiges Signaturschema"
+
+msgid "Invalid attribute"
+msgstr "Ungültiges Attribut"
+
+msgid "No value"
+msgstr "Kein Wert"
+
+msgid "Not found"
+msgstr "Nicht gefunden"
+
+msgid "Value not found"
+msgstr "Wert nicht gefunden"
+
+msgid "Syntax error"
+msgstr "Syntaxfehler"
+
+msgid "Bad MPI value"
+msgstr "Fehlerhafter MPI Wert"
+
+msgid "Invalid passphrase"
+msgstr "Ungültige Passphrase"
+
+msgid "Invalid signature class"
+msgstr "Ungültige Signaturklasse"
+
+msgid "Resources exhausted"
+msgstr "Ressourcen erschöpft"
+
+msgid "Invalid keyring"
+msgstr "Ungültiger Schlüsselbund"
+
+msgid "Trust DB error"
+msgstr "Fehler in der 'Trust'-Datenbank"
+
+msgid "Bad certificate"
+msgstr "Fehlerhaftes Zertifikat"
+
+msgid "Invalid user ID"
+msgstr "Ungültige User-ID"
+
+msgid "Unexpected error"
+msgstr "Unerwarteter Fehler"
+
+msgid "Time conflict"
+msgstr "Zeitangaben differieren"
+
+msgid "Keyserver error"
+msgstr "Schlüsselserverfehler"
+
+msgid "Wrong public key algorithm"
+msgstr "Falsches Public-Key-Verfahren"
+
+msgid "Tribute to D. A."
+msgstr "Tribut an D. A."
+
+msgid "Weak encryption key"
+msgstr "Unsicherer Schlüssel"
+
+msgid "Invalid key length"
+msgstr "Ungültige Schlüssellänge"
+
+msgid "Invalid argument"
+msgstr "Ungültiges Argument"
+
+msgid "Syntax error in URI"
+msgstr "Syntaxfehler im URI"
+
+msgid "Invalid URI"
+msgstr "Ungültiger URI"
+
+msgid "Network error"
+msgstr "Netzwerkfehler"
+
+msgid "Unknown host"
+msgstr "Unbekannter Rechner"
+
+msgid "Selftest failed"
+msgstr "Selbstprüfung fehlgeschlagen"
+
+msgid "Data not encrypted"
+msgstr "Daten sind nicht verschlüsselt"
+
+msgid "Data not processed"
+msgstr "Daten wurden nicht verarbeitet"
+
+msgid "Unusable public key"
+msgstr "Unbrauchbarer öffentlicher Schlüssel"
+
+msgid "Unusable secret key"
+msgstr "Unbrauchbarer geheimer Schlüssel"
+
+msgid "Invalid value"
+msgstr "Ungültiger Wert"
+
+msgid "Bad certificate chain"
+msgstr "Fehlerhafte Zertifikatkette"
+
+msgid "Missing certificate"
+msgstr "Fehlendes Zertifikat"
+
+msgid "No data"
+msgstr "Keine Daten"
+
+msgid "Bug"
+msgstr "Bug (Programmfehler)"
+
+msgid "Not supported"
+msgstr "Nicht unterstützt"
+
+msgid "Invalid operation code"
+msgstr "Ungültiger Verarbeitungscode"
+
+msgid "Timeout"
+msgstr "Zeitüberschreitung"
+
+msgid "Internal error"
+msgstr "Interner Fehler"
+
+msgid "EOF (gcrypt)"
+msgstr "EOF (in gcrypt)"
+
+msgid "Invalid object"
+msgstr "Ungültiges Objekt"
+
+msgid "Provided object is too short"
+msgstr "Objekt ist zu kurz"
+
+msgid "Provided object is too large"
+msgstr "Objekt ist zu groß"
+
+msgid "Missing item in object"
+msgstr "Fehlendes Feld im Objekt"
+
+msgid "Not implemented"
+msgstr "Nich implementiert"
+
+msgid "Conflicting use"
+msgstr "Zwiespältige Benutzung"
+
+msgid "Invalid cipher mode"
+msgstr "Ungültiger Verschlüsselungsmodus"
+
+msgid "Invalid flag"
+msgstr "Ungültige Flagge"
+
+msgid "Invalid handle"
+msgstr "Ungültiger Handle"
+
+msgid "Result truncated"
+msgstr "Ausgabe abgeschnitten"
+
+msgid "Incomplete line"
+msgstr "Unvollständige Zeile"
+
+msgid "Invalid response"
+msgstr "Ungültige Antwort"
+
+msgid "No agent running"
+msgstr "Agent läuft nicht"
+
+msgid "Agent error"
+msgstr "Fehler beim Agenten"
+
+msgid "Invalid data"
+msgstr "Ungültige Daten"
+
+msgid "Unspecific Assuan server fault"
+msgstr "Unspezifischer Assuan Serverfehler"
+
+msgid "General Assuan error"
+msgstr "Allgemeiner Assuan Fehler"
+
+msgid "Invalid session key"
+msgstr "Ungültiger Sitzungsschlüssel"
+
+msgid "Invalid S-expression"
+msgstr "Ungültige S-expression"
+
+msgid "Unsupported algorithm"
+msgstr "Nicht unterstütztes Verfahren"
+
+msgid "No pinentry"
+msgstr "Kein Pinentry"
+
+msgid "pinentry error"
+msgstr "Fehler in der Pinentry"
+
+msgid "Bad PIN"
+msgstr "Falsche PIN"
+
+msgid "Invalid name"
+msgstr "Ungültiger Name"
+
+msgid "Bad data"
+msgstr "Fehlerhafte Daten"
+
+msgid "Invalid parameter"
+msgstr "Ungültiger Parameter"
+
+msgid "Wrong card"
+msgstr "Falsche Karte"
+
+msgid "No dirmngr"
+msgstr "Kein Dirmngr"
+
+msgid "dirmngr error"
+msgstr "Fehler im Dirmngr"
+
+msgid "Certificate revoked"
+msgstr "Zertifikat ist widerrufen"
+
+msgid "No CRL known"
+msgstr "Keine CRL bekannt"
+
+msgid "CRL too old"
+msgstr "CRL ist zu alt"
+
+msgid "Line too long"
+msgstr "Zeile ist zu lang"
+
+msgid "Not trusted"
+msgstr "Nicht vertrauenswürdig"
+
+msgid "Operation cancelled"
+msgstr "Verarbeitung wurde abgebrochen"
+
+msgid "Bad CA certificate"
+msgstr "Fehlerhaftes CA-Zertifikat"
+
+msgid "Certificate expired"
+msgstr "Zertifikat abgelaufen"
+
+msgid "Certificate too young"
+msgstr "Zertifikat ist noch nicht gültig"
+
+msgid "Unsupported certificate"
+msgstr "Nicht unterstütztes Zertifikat"
+
+msgid "Unknown S-expression"
+msgstr "Unbekannte S-expression"
+
+msgid "Unsupported protection"
+msgstr "Nicht unterstütztes Schutzverfahren"
+
+msgid "Corrupted protection"
+msgstr "Beschädigter Schutz"
+
+msgid "Ambiguous name"
+msgstr "Mehrdeutiger Name"
+
+msgid "Card error"
+msgstr "Kartenfehler"
+
+msgid "Card reset required"
+msgstr "Karte wurde zurückgesetzt"
+
+msgid "Card removed"
+msgstr "Karte wurde entfernt"
+
+msgid "Invalid card"
+msgstr "Ungültige Karte"
+
+msgid "Card not present"
+msgstr "Karte nicht vorhanden"
+
+msgid "No PKCS15 application"
+msgstr "Kein PKCS#15 Anwendung"
+
+msgid "Not confirmed"
+msgstr "Nicht bestätigt"
+
+msgid "Configuration error"
+msgstr "Konfigurationsfehler"
+
+msgid "No policy match"
+msgstr "Richtlinien stimmen nicht überein"
+
+msgid "Invalid index"
+msgstr "Ungültiger Index"
+
+msgid "Invalid ID"
+msgstr "Ungültige ID"
+
+msgid "No SmartCard daemon"
+msgstr "Kein Karten-Daemon"
+
+msgid "SmartCard daemon error"
+msgstr "Fehler im Karten-Daemon"
+
+msgid "Unsupported protocol"
+msgstr "Nicht unterstütztes Protokoll"
+
+msgid "Bad PIN method"
+msgstr "Falsche PIN Methode"
+
+msgid "Card not initialized"
+msgstr "Karte ist nicht initialisiert"
+
+msgid "Unsupported operation"
+msgstr "Nicht unterstützte Verarbeitungsaufgabe"
+
+msgid "Wrong key usage"
+msgstr "Falsche Schlüsselnutzung"
+
+msgid "Nothing found"
+msgstr "Nichts gefunden"
+
+msgid "Wrong blob type"
+msgstr "Falscher BLOB-Typ"
+
+msgid "Missing value"
+msgstr "Fehlender Wert"
+
+msgid "Hardware problem"
+msgstr "Problem mit der Hardware"
+
+msgid "PIN blocked"
+msgstr "PIN ist blockiert"
+
+msgid "Conditions of use not satisfied"
+msgstr "Nutzungsvorraussetzungen nicht erfüllt"
+
+msgid "PINs are not synced"
+msgstr "PINs sind nicht syncronsiert"
+
+msgid "Invalid CRL"
+msgstr "Ungültige CRL"
+
+msgid "BER error"
+msgstr "BER Fehler"
+
+msgid "Invalid BER"
+msgstr "Ungültige BER"
+
+msgid "Element not found"
+msgstr "Element nicht gefunden"
+
+msgid "Identifier not found"
+msgstr "Indentifier nicht gefunden"
+
+msgid "Invalid tag"
+msgstr "Ungültiges \"Tag\""
+
+msgid "Invalid length"
+msgstr "Ungültige Länge"
+
+msgid "Invalid key info"
+msgstr "Ungültige Key-Info"
+
+msgid "Unexpected tag"
+msgstr "Unerwartetes \"Tag\""
+
+msgid "Not DER encoded"
+msgstr "Nicht DER kodiert"
+
+msgid "No CMS object"
+msgstr "Kein CMS Objekt"
+
+msgid "Invalid CMS object"
+msgstr "Ungültiges CMS Objekt"
+
+msgid "Unknown CMS object"
+msgstr "Unbekanntes CMS Objekt"
+
+msgid "Unsupported CMS object"
+msgstr "Nicht unterstütztes CMS Objekt"
+
+msgid "Unsupported encoding"
+msgstr "Nicht unterstützte Kodierung"
+
+msgid "Unsupported CMS version"
+msgstr "Nicht unterstützte CMS Version"
+
+msgid "Unknown algorithm"
+msgstr "Unbekanntes Verfahren"
+
+msgid "Invalid crypto engine"
+msgstr "Ungültige Krypto-Engine"
+
+msgid "Public key not trusted"
+msgstr "Öffentlicher Schlüssel ist nicht vertrauenswürdig"
+
+msgid "Decryption failed"
+msgstr "Entschlüsselung fehlgeschlagen"
+
+msgid "Key expired"
+msgstr "Schlüssel abgelaufen"
+
+msgid "Signature expired"
+msgstr "Unterschrift abgelaufen"
+
+msgid "Encoding problem"
+msgstr "Kodierungsproblem"
+
+msgid "Invalid state"
+msgstr "Ungültiger Status"
+
+msgid "Duplicated value"
+msgstr "Doppelter Wert"
+
+msgid "Missing action"
+msgstr "Aktion fehlt"
+
+msgid "ASN.1 module not found"
+msgstr "ASN.1 Modul nicht gefunden"
+
+msgid "Invalid OID string"
+msgstr "Ungültige OID Zeichenkette"
+
+msgid "Invalid time"
+msgstr "Ungültige Zeit"
+
+msgid "Invalid CRL object"
+msgstr "Ungültiges CRL Objekt"
+
+msgid "Unsupported CRL version"
+msgstr "Nicht unterstützte CRL Version"
+
+msgid "Invalid certificate object"
+msgstr "Ungültiges Zertifikatsobjekt"
+
+msgid "Unknown name"
+msgstr "Unbekannter Name"
+
+msgid "A locale function failed"
+msgstr "Eine \"locale\" Funktion ist fehlgeschlagen"
+
+msgid "Not locked"
+msgstr "Nicht gesperrt"
+
+msgid "Protocol violation"
+msgstr "Protokollverletzung"
+
+msgid "Invalid MAC"
+msgstr "Ungültiger MAC"
+
+msgid "Invalid request"
+msgstr "Ungültiger Request"
+
+msgid "Unknown extension"
+msgstr "Unbekannte Erweiterung"
+
+msgid "Unknown critical extension"
+msgstr "Unbekannte kritische Erweiterung"
+
+msgid "Locked"
+msgstr "Gesperrt"
+
+msgid "Unknown option"
+msgstr "Unbekannte Option"
+
+msgid "Unknown command"
+msgstr "Unbekanntes Kommando"
+
+msgid "Not operational"
+msgstr "Nicht betriebsbereit"
+
+msgid "No passphrase given"
+msgstr "Keine Passphrase angegeben"
+
+msgid "No PIN given"
+msgstr "Keine PIN angegeben"
+
+msgid "Not enabled"
+msgstr "Nicht engeschaltet"
+
+msgid "No crypto engine"
+msgstr "Keine Krypto-Engine"
+
+msgid "Missing key"
+msgstr "Fehlender Schlüssel"
+
+msgid "Too many objects"
+msgstr "Zu viele Objekte"
+
+msgid "Limit reached"
+msgstr "Limit erreicht"
+
+msgid "Not initialized"
+msgstr "Initialisierung nicht durchgeführt"
+
+# "in der Kette" ist part of the message because many users know about
+# certificate chains and thus that keyword might give them a good hint
+# what might be wrong.
+msgid "Missing issuer certificate"
+msgstr "Fehlendes Herausgeberzertifikat in der Kette"
+
+msgid "No keyserver available"
+msgstr "Kein Schlüsselserver verfügbar"
+
+msgid "Invalid elliptic curve"
+msgstr "Ungültige elliptische Kurve"
+
+msgid "Unknown elliptic curve"
+msgstr "Unbekannte elliptische Kurve"
+
+msgid "Duplicated key"
+msgstr "Doppelter Schlüssel"
+
+msgid "Ambiguous result"
+msgstr "Uneindeutiges Ergebiss"
+
+msgid "No crypto context"
+msgstr "Fehlender Crypto Context"
+
+msgid "Wrong crypto context"
+msgstr "Falscher Crypto Context"
+
+msgid "Bad crypto context"
+msgstr "Fehlerhafter Crypto Context"
+
+msgid "Conflict in the crypto context"
+msgstr "Zwiespältige Benutzung des Crypto Context"
+
+msgid "Broken public key"
+msgstr "Defekter öffentlicher Schlüssel"
+
+msgid "Broken secret key"
+msgstr "Defekter geheimer Schlüssel"
+
+msgid "Invalid MAC algorithm"
+msgstr "Ungültige MAC-Methode"
+
+msgid "Operation fully cancelled"
+msgstr "Verarbeitung wurde vollständig abgebrochen"
+
+msgid "Operation not yet finished"
+msgstr "Verarbeitung ist noch nicht beendet"
+
+msgid "Buffer too short"
+msgstr "Datenpuffer zu kurz"
+
+msgid "Invalid length specifier in S-expression"
+msgstr "Ungültige Längeangabe in der S-expression"
+
+msgid "String too long in S-expression"
+msgstr "Zeichenkette in S-expression zu lang"
+
+msgid "Unmatched parentheses in S-expression"
+msgstr "Nich übereinstimmende Klammern in S-expression"
+
+msgid "S-expression not canonical"
+msgstr "S-expression ist nicht kanonisch"
+
+msgid "Bad character in S-expression"
+msgstr "Fehlerhaftes Zeichen in S-expression"
+
+msgid "Bad quotation in S-expression"
+msgstr "Fehlerhafte Zitierung in S-expression"
+
+msgid "Zero prefix in S-expression"
+msgstr "Null-Präfix in S-expression"
+
+msgid "Nested display hints in S-expression"
+msgstr "Verschachtelte \"Hints\" in S-expression"
+
+msgid "Unmatched display hints"
+msgstr "Nicht übereinstimmende \"Hints\""
+
+msgid "Unexpected reserved punctuation in S-expression"
+msgstr "Unerwartetes reserviertes Zeichen in S-expression"
+
+msgid "Bad hexadecimal character in S-expression"
+msgstr "Falsches Hex-Zeichen in S-expression"
+
+msgid "Odd hexadecimal numbers in S-expression"
+msgstr "Ungerade Anzahl von Hex-Zeichen in S-expression"
+
+msgid "Bad octal character in S-expression"
+msgstr "Falsches Oktal-Zeichen in S-expression"
+
+msgid "All subkeys are expired or revoked"
+msgstr "Alle Unterschlüssel sind abgelaufen oder widerrufen"
+
+msgid "Database is corrupted"
+msgstr "Beschädigte Datenbank"
+
+msgid "Server indicated a failure"
+msgstr "Server zeigt einen unbestimmten Fehler an"
+
+msgid "No name"
+msgstr "Kein Name"
+
+msgid "No key"
+msgstr "Kein Schlüssel"
+
+msgid "Legacy key"
+msgstr "Veralteter Schlüssel"
+
+msgid "Request too short"
+msgstr "Anfrage zu kurz"
+
+msgid "Request too long"
+msgstr "Zeile ist zu lang"
+
+msgid "Object is in termination state"
+msgstr "Objekt befindet sich im \"Termination\" Status"
+
+msgid "No certificate chain"
+msgstr "Fehlende Zertifikatkette"
+
+msgid "Certificate is too large"
+msgstr "Zertifikat ist zu gross"
+
+msgid "Invalid record"
+msgstr "Ungültiger Datensatz"
+
+msgid "The MAC does not verify"
+msgstr "Der MAC ist nicht gültig"
+
+msgid "Unexpected message"
+msgstr "Unerwartete Nachricht"
+
+msgid "Compression or decompression failed"
+msgstr "(De-)Komprimierung fehlgeschlagen"
+
+msgid "A counter would wrap"
+msgstr "Ein Zähler würde überlaufen"
+
+msgid "Fatal alert message received"
+msgstr "Fatale \"Alert\" Nachricht erhalten"
+
+msgid "No cipher algorithm"
+msgstr "Kein Verschlüsselungsverfahren"
+
+# "in der Kette" ist part of the message because many users know about
+# certificate chains and thus that keyword might give them a good hint
+# what might be wrong.
+msgid "Missing client certificate"
+msgstr "Fehlendes Benutzerzertifikat"
+
+msgid "Close notification received"
+msgstr "\"Close\" Benachrichtigung erhalten"
+
+msgid "Ticket expired"
+msgstr "Ticket abgelaufen"
+
+msgid "Bad ticket"
+msgstr "Fehlerhaftes Ticket"
+
+msgid "Unknown identity"
+msgstr "Unbekannte Indentität"
+
+msgid "Bad certificate message in handshake"
+msgstr "Fehlerhafte Zertifikatnachricht im Handshake"
+
+msgid "Bad certificate request message in handshake"
+msgstr "Fehlerhafte Zertifikatsanforderungsnachricht im Handshake"
+
+msgid "Bad certificate verify message in handshake"
+msgstr "Fehlerhafte Zertifikatsüberprüfungsnachricht im Handshake"
+
+msgid "Bad change cipher message in handshake"
+msgstr "Fehlerhafte Verschlüsselungsalgorithmuswechselnachricht im Handshake"
+
+msgid "Bad client hello message in handshake"
+msgstr "Fehlerhafte \"Client Hello\" Nachricht im Handshake"
+
+msgid "Bad server hello message in handshake"
+msgstr "Fehlerhafte \"Server Hello\" Nachricht im Handshake"
+
+msgid "Bad server hello done message in handshake"
+msgstr "Fehlerhafte \"Server Hello Done\" Nachricht im Handshake"
+
+msgid "Bad finished message in handshake"
+msgstr "Fehlerhafte \"Finished\" Nachricht im Handshake"
+
+msgid "Bad server key exchange message in handshake"
+msgstr "Fehlerhafte \"Server Key Exchange\" Nachricht im Handshake"
+
+msgid "Bad client key exchange message in handshake"
+msgstr "Fehlerhafte \"Client Key Exchange\" Nachricht im Handshake"
+
+msgid "Bogus string"
+msgstr "Fehlerhafter String"
+
+msgid "Forbidden"
+msgstr "Verboten"
+
+msgid "Key disabled"
+msgstr "Schlüssel abgeschaltet"
+
+msgid "Not possible with a card based key"
+msgstr "Nicht möglich mit einem kartenbasierten Schlüssel"
+
+msgid "Invalid lock object"
+msgstr "Ungültiges Sperr-Objekt"
+
+msgid "True"
+msgstr "Wahr"
+
+msgid "False"
+msgstr "Falsch"
+
+msgid "General IPC error"
+msgstr "Allgemeiner IPC Fehler"
+
+msgid "IPC accept call failed"
+msgstr "IPC \"accept\" Aufruf fehlgeschlagen"
+
+msgid "IPC connect call failed"
+msgstr "IPC \"connect\" Aufruf fehlgeschlagen"
+
+msgid "Invalid IPC response"
+msgstr "Ungültige IPC Antwort"
+
+msgid "Invalid value passed to IPC"
+msgstr "Ungültiger Wert an IPC übergeben"
+
+msgid "Incomplete line passed to IPC"
+msgstr "Unvollständige Zeile an IPC übergeben"
+
+msgid "Line passed to IPC too long"
+msgstr "An die IPC übergebene Zeile ist zu lang"
+
+msgid "Nested IPC commands"
+msgstr "Verschachtelte IPC Kommandos"
+
+msgid "No data callback in IPC"
+msgstr "Kein Daten vom IPC \"Callback\""
+
+msgid "No inquire callback in IPC"
+msgstr "Kein \"Inquire\" \"Callback\" für IPC gesetzt"
+
+msgid "Not an IPC server"
+msgstr "Kein IPC Server"
+
+msgid "Not an IPC client"
+msgstr "Kein IPC Client"
+
+msgid "Problem starting IPC server"
+msgstr "Problem beim Starten des IPC Servers"
+
+msgid "IPC read error"
+msgstr "IPC Lesefehler"
+
+msgid "IPC write error"
+msgstr "IPC Schreibfehler"
+
+msgid "Too much data for IPC layer"
+msgstr "Zu viele Daten für das IPC Ebene"
+
+msgid "Unexpected IPC command"
+msgstr "Unerwartetes IPC Kommando"
+
+msgid "Unknown IPC command"
+msgstr "Unbekanntes IPC Kommando"
+
+msgid "IPC syntax error"
+msgstr "IPC Syntaxfehler"
+
+msgid "IPC call has been cancelled"
+msgstr "Der IPC Aufruf wurde abgebrochen"
+
+msgid "No input source for IPC"
+msgstr "Eingabequelle für IPC fehlt"
+
+msgid "No output source for IPC"
+msgstr "Ausgabesenke für IPC fehlt"
+
+msgid "IPC parameter error"
+msgstr "IPC Parameterfehler"
+
+msgid "Unknown IPC inquire"
+msgstr "Unbekanntes IPC \"Inquire\""
+
+msgid "Crypto engine too old"
+msgstr "Die Krypto-Engine ist zu alt"
+
+msgid "Screen or window too small"
+msgstr "Bildschirmfenster ist zu klein"
+
+msgid "Screen or window too large"
+msgstr "Bildschirmfenster ist zu groß"
+
+msgid "Required environment variable not set"
+msgstr "Eine notwendige Umgebungsvariable ist nicht gesetzt"
+
+msgid "User ID already exists"
+msgstr "Die User-ID existiert bereits"
+
+msgid "Name already exists"
+msgstr "Der Name existiert bereits"
+
+msgid "Duplicated name"
+msgstr "Doppelter Name"
+
+msgid "Object is too young"
+msgstr "Objekt zu jung"
+
+msgid "Object is too old"
+msgstr "Objekt zu alt"
+
+msgid "Unknown flag"
+msgstr "Unbekannte Flagge"
+
+msgid "Invalid execution order"
+msgstr "Ungültige Verarbeitungsreihenfolge"
+
+msgid "Already fetched"
+msgstr "Bereits geholt"
+
+msgid "Try again later"
+msgstr "Später erneut versuchen"
+
+msgid "Wrong name"
+msgstr "Falscher Name"
+
+msgid "System bug detected"
+msgstr "Fehler im System entdeckt"
+
+msgid "Unknown DNS error"
+msgstr "Unbekannter DNS Fehler"
+
+msgid "Invalid DNS section"
+msgstr "Ungültige DNS \"Section\""
+
+msgid "Invalid textual address form"
+msgstr "Ungültige Textadressenformat"
+
+# "in der Kette" ist part of the message because many users know about
+# certificate chains and thus that keyword might give them a good hint
+# what might be wrong.
+msgid "Missing DNS query packet"
+msgstr "Fehlendes DNS Anfragepaket"
+
+msgid "Missing DNS answer packet"
+msgstr "Fehlendes DNS Antwortpaket"
+
+msgid "Connection closed in DNS"
+msgstr "Verbindung im DNS geschlossen"
+
+msgid "Verification failed in DNS"
+msgstr "Prüfung im DNS fehlgeschlagen"
+
+msgid "DNS Timeout"
+msgstr "DNS Zeitüberschreitung"
+
+msgid "General LDAP error"
+msgstr "Allgemeiner LDAP Fehler"
+
+msgid "General LDAP attribute error"
+msgstr "Allgemeiner LDAP Attributfehler"
+
+msgid "General LDAP name error"
+msgstr "Allgemeiner LDAP Namensfehler"
+
+msgid "General LDAP security error"
+msgstr "Allgemeiner LDAP Sicherheitsfehler"
+
+msgid "General LDAP service error"
+msgstr "Allgemeiner LDAP Servicefehler"
+
+msgid "General LDAP update error"
+msgstr "Allgemeiner LDAP \"Update\" Fehler"
+
+msgid "Experimental LDAP error code"
+msgstr "Experimenteller LDAP Fehlercode"
+
+msgid "Private LDAP error code"
+msgstr "Privater LDAP Fehlercode"
+
+msgid "Other general LDAP error"
+msgstr "Sonstiger allgemeiner LDAP Fehler"
+
+msgid "LDAP connecting failed (X)"
+msgstr "Fehler beim LDAP Verbindungsaufbau (X)"
+
+msgid "LDAP referral limit exceeded"
+msgstr "Grenze für LDAP Verweise überschritten"
+
+msgid "LDAP client loop"
+msgstr "Schleife im LDAP Client entdeckt"
+
+msgid "No LDAP results returned"
+msgstr "Keine LDAP Ergebnisse"
+
+msgid "LDAP control not found"
+msgstr "LDAP \"Control\" nicht gefunden"
+
+msgid "Not supported by LDAP"
+msgstr "Von LDAP nicht unterstützt"
+
+msgid "LDAP connect error"
+msgstr "LDAP Verbindungsfehler"
+
+msgid "Out of memory in LDAP"
+msgstr "Nicht genügend Speicher für LDAP Operation"
+
+msgid "Bad parameter to an LDAP routine"
+msgstr "Ungültiger Parameter an LDAP Funktion übergeben"
+
+msgid "User cancelled LDAP operation"
+msgstr "LDAP Verarbeitung durch Benutzer abgebrochen"
+
+msgid "Bad LDAP search filter"
+msgstr "Fehlerhaftes LDAP Suchfilter"
+
+msgid "Unknown LDAP authentication method"
+msgstr "Unbekanntes LDAP Authentifizierungsverfahren"
+
+msgid "Timeout in LDAP"
+msgstr "Zeitüberschreitung (LDAP)"
+
+msgid "LDAP decoding error"
+msgstr "LDAP Dekodierungsfehler"
+
+msgid "LDAP encoding error"
+msgstr "LDAP Kodierungsfehler"
+
+msgid "LDAP local error"
+msgstr "Lokaler LDAP Fehler"
+
+msgid "Cannot contact LDAP server"
+msgstr "Verbindung zum LDAP Server nicht möglich"
+
+msgid "LDAP success"
+msgstr "LDAP erfolgreich"
+
+msgid "LDAP operations error"
+msgstr "LDAP Konfigurationsfehler"
+
+msgid "LDAP protocol error"
+msgstr "LDAP Protokollverletzung"
+
+msgid "Time limit exceeded in LDAP"
+msgstr "Zeitgrenze von LDAP überschritten"
+
+msgid "Size limit exceeded in LDAP"
+msgstr "Größengrenze von LDAP überschritten"
+
+msgid "LDAP compare false"
+msgstr "LDAP Vergleich falsch"
+
+msgid "LDAP compare true"
+msgstr "LDAP Vergleich richtig"
+
+msgid "LDAP authentication method not supported"
+msgstr "LDAP Authentifizierungsverfahren nicht unterstützt"
+
+msgid "Strong(er) LDAP authentication required"
+msgstr "Starke LDAP Authentifizierung benötigt"
+
+msgid "Partial LDAP results+referral received"
+msgstr "Partielle LDAP Ergebnisse und Verweise erhalten"
+
+msgid "LDAP referral"
+msgstr "LDAP Verweise"
+
+msgid "Administrative LDAP limit exceeded"
+msgstr "Administrative LDAP Grenze überschritten"
+
+msgid "Critical LDAP extension is unavailable"
+msgstr "Kritische LDAP Erweiterung nicht vorhanden"
+
+msgid "Confidentiality required by LDAP"
+msgstr "Vertraulichkeit von LDAP angefordert"
+
+msgid "LDAP SASL bind in progress"
+msgstr "LDAP SALS \"bind\" wird durchgeführt"
+
+msgid "No such LDAP attribute"
+msgstr "Kein solches LDAP Attribut"
+
+msgid "Undefined LDAP attribute type"
+msgstr "Ungültiger LDAP Attributtyp"
+
+msgid "Inappropriate matching in LDAP"
+msgstr "Unpassende Zusammenstellung in LDAP"
+
+msgid "Constraint violation in LDAP"
+msgstr "Bedingung nicht eingehalten in LDAP"
+
+msgid "LDAP type or value exists"
+msgstr "LDAP Typ oder Wert existiert"
+
+msgid "Invalid syntax in LDAP"
+msgstr "Ungültiger Status in LDAP"
+
+msgid "No such LDAP object"
+msgstr "Kein solches LDAP Objekt"
+
+msgid "LDAP alias problem"
+msgstr "Problem mit LDAP Alias"
+
+msgid "Invalid DN syntax in LDAP"
+msgstr "Ungültiger DN Synatx in LDAP"
+
+msgid "LDAP entry is a leaf"
+msgstr "LDAP Element ist ein \"leaf\""
+
+msgid "LDAP alias dereferencing problem"
+msgstr "Problem bei der Auflösung eines LDAP Aliases"
+
+msgid "LDAP proxy authorization failure (X)"
+msgstr "LDAP Proxy Authentifizierung fehlgeschlagen (X)"
+
+msgid "Inappropriate LDAP authentication"
+msgstr "Unpassende LDAP Authentifizierung"
+
+msgid "Invalid LDAP credentials"
+msgstr "Ungültige LDAP Credentials"
+
+msgid "Insufficient access for LDAP"
+msgstr "Ungenügende Zugriffsrechte für LDAP"
+
+msgid "LDAP server is busy"
+msgstr "LDAP Server ist beschäftigt"
+
+msgid "LDAP server is unavailable"
+msgstr "LDAP Server nicht verfügbar"
+
+msgid "LDAP server is unwilling to perform"
+msgstr "LDAP Server weigert sich etwas durchzuführen"
+
+msgid "Loop detected by LDAP"
+msgstr "LDAP hat eine Schleife erkannt"
+
+msgid "LDAP naming violation"
+msgstr "LDAP Benennungsverletzung"
+
+msgid "LDAP object class violation"
+msgstr "Verletzung der LDAP Objektklasse"
+
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "LDAP Operation auf einem Nicht-\"Leaf\" ist nicht erlaubt"
+
+msgid "LDAP operation not allowed on RDN"
+msgstr "LDAP Operation nicht erlaubt auf einem RDN"
+
+msgid "Already exists (LDAP)"
+msgstr "Existiert bereits (LDAP)"
+
+msgid "Cannot modify LDAP object class"
+msgstr "Die LDAP Objektklasse kann nicht geändert werden"
+
+msgid "LDAP results too large"
+msgstr "LDAP Ergebnisse sind zu lang"
+
+msgid "LDAP operation affects multiple DSAs"
+msgstr "LDAP Operation betrifft mehrere DSAs"
+
+msgid "Virtual LDAP list view error"
+msgstr "Fehler in virtueller LDAP \"list view\""
+
+msgid "Other LDAP error"
+msgstr "Sonstiger allgemeiner LDAP Fehler"
+
+msgid "Resources exhausted in LCUP"
+msgstr "Ressourcen erschöpft in LCUP"
+
+msgid "Security violation in LCUP"
+msgstr "Sicherheitsverletzung in LCUP"
+
+msgid "Invalid data in LCUP"
+msgstr "Ungültige Daten in LDAP"
+
+msgid "Unsupported scheme in LCUP"
+msgstr "Nicht unterstütztes Schema in LCUP"
+
+msgid "Reload required in LCUP"
+msgstr "\"Reload\" notwendig in LCUP"
+
+msgid "LDAP cancelled"
+msgstr "LDAP wurde abgebrochen"
+
+msgid "No LDAP operation to cancel"
+msgstr "Fehlende LDAP Operation zum abbrechen"
+
+msgid "Too late to cancel LDAP"
+msgstr "Zu spät um LDAP Operation abzubrechen"
+
+msgid "Cannot cancel LDAP"
+msgstr "LDAP Operation kann nicht abgebrochen werden"
+
+msgid "LDAP assertion failed"
+msgstr "LDAP \"Assertion\" fehlgeschlagen"
+
+msgid "Proxied authorization denied by LDAP"
+msgstr "LDAP Authentifizierung via Proxy wurde verweigert"
+
+msgid "User defined error code 1"
+msgstr "Benutzerdefinierter Fehlercode 1"
+
+msgid "User defined error code 2"
+msgstr "Benutzerdefinierter Fehlercode 2"
+
+msgid "User defined error code 3"
+msgstr "Benutzerdefinierter Fehlercode 3"
+
+msgid "User defined error code 4"
+msgstr "Benutzerdefinierter Fehlercode 4"
+
+msgid "User defined error code 5"
+msgstr "Benutzerdefinierter Fehlercode 5"
+
+msgid "User defined error code 6"
+msgstr "Benutzerdefinierter Fehlercode 6"
+
+msgid "User defined error code 7"
+msgstr "Benutzerdefinierter Fehlercode 7"
+
+msgid "User defined error code 8"
+msgstr "Benutzerdefinierter Fehlercode 8"
+
+msgid "User defined error code 9"
+msgstr "Benutzerdefinierter Fehlercode 9"
+
+msgid "User defined error code 10"
+msgstr "Benutzerdefinierter Fehlercode 10"
+
+msgid "User defined error code 11"
+msgstr "Benutzerdefinierter Fehlercode 11"
+
+msgid "User defined error code 12"
+msgstr "Benutzerdefinierter Fehlercode 12"
+
+msgid "User defined error code 13"
+msgstr "Benutzerdefinierter Fehlercode 13"
+
+msgid "User defined error code 14"
+msgstr "Benutzerdefinierter Fehlercode 14"
+
+msgid "User defined error code 15"
+msgstr "Benutzerdefinierter Fehlercode 15"
+
+msgid "User defined error code 16"
+msgstr "Benutzerdefinierter Fehlercode 16"
+
+msgid "System error w/o errno"
+msgstr "Systemfehler ohne gesetzten Systemfehlercode"
+
+msgid "Unknown system error"
+msgstr "Unbekannter Systemfehler"
+
+msgid "End of file"
+msgstr "Dateiende"
+
+msgid "Unknown error code"
+msgstr "Unbekannter Fehlercode"
+
+#, c-format
+msgid "Usage: %s GPG-ERROR [...]\n"
+msgstr "Aufruf: %s GPG-FEHLER [...]\n"
+
+#, c-format
+msgid "%s: warning: could not recognize %s\n"
+msgstr "%s: Warnung: %s konnte nicht erkannt werden\n"
+
+#~ msgid "LCUP Resources exhausted"
+#~ msgstr "LCUP Ressourcen erschöpft"
+
+#~ msgid "LCUP Invalid data"
+#~ msgstr "LCUP Ungültige Daten"
+
+#~ msgid "LDAP Other general error"
+#~ msgstr "Sonstiger allgemeiner LDAP Fehler"
+
+#~ msgid "Encoding error"
+#~ msgstr "Kodierungsfehler"
diff --git a/po/[email protected] b/po/[email protected]
new file mode 100644
index 0000000..506ca9e
--- /dev/null
+++ b/po/[email protected]
@@ -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
+# https://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/[email protected] b/po/[email protected]
new file mode 100644
index 0000000..6522f0c
--- /dev/null
+++ b/po/[email protected]
@@ -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
+# https://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/eo.po b/po/eo.po
new file mode 100644
index 0000000..bc3e987
--- /dev/null
+++ b/po/eo.po
@@ -0,0 +1,1529 @@
+# Esperanto translation of Libgpg-error
+# Copyright (C) 2013 Free Software Foundation, Inc.
+# This file is distributed under the same license as the libgpg-error package.
+# Felipe Castro <[email protected]>, 2013.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: libgpg-error 1.7\n"
+"Report-Msgid-Bugs-To: [email protected]\n"
+"PO-Revision-Date: 2013-02-23 20:22+0100\n"
+"Last-Translator: Felipe Castro <[email protected]>\n"
+"Language-Team: Esperanto <[email protected]>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "Unspecified source"
+msgstr "Neindikita fonto"
+
+msgid "gcrypt"
+msgstr "gcrypt"
+
+msgid "GnuPG"
+msgstr "GnuPG"
+
+msgid "GpgSM"
+msgstr "GpgSM"
+
+msgid "GPG Agent"
+msgstr "GPG Agento"
+
+msgid "Pinentry"
+msgstr "Pinentry"
+
+msgid "SCD"
+msgstr "SCD"
+
+msgid "GPGME"
+msgstr "GPGME"
+
+msgid "Keybox"
+msgstr "Keybox"
+
+msgid "KSBA"
+msgstr "KSBA"
+
+msgid "Dirmngr"
+msgstr "Dirmngr"
+
+msgid "GSTI"
+msgstr "GSTI"
+
+msgid "GPA"
+msgstr "GPA"
+
+msgid "Kleopatra"
+msgstr "Kleopatra"
+
+msgid "G13"
+msgstr "G13"
+
+msgid "Assuan"
+msgstr "Assuan"
+
+msgid "TLS"
+msgstr ""
+
+msgid "Any source"
+msgstr "Iu ajn fonto"
+
+msgid "User defined source 1"
+msgstr "Uzant-difinita fonto 1"
+
+msgid "User defined source 2"
+msgstr "Uzant-difinita fonto 2"
+
+msgid "User defined source 3"
+msgstr "Uzant-difinita fonto 3"
+
+msgid "User defined source 4"
+msgstr "Uzant-difinita fonto 4"
+
+msgid "Unknown source"
+msgstr "Nekonata fonto"
+
+msgid "Success"
+msgstr "Sukceso"
+
+msgid "General error"
+msgstr "Ĝenerala eraro"
+
+msgid "Unknown packet"
+msgstr "Nekonata paketo"
+
+msgid "Unknown version in packet"
+msgstr "Nekonata versio en paketo"
+
+msgid "Invalid public key algorithm"
+msgstr "Malvalida publika ŝlosila algoritmo"
+
+msgid "Invalid digest algorithm"
+msgstr "Malvalida resuma algoritmo"
+
+msgid "Bad public key"
+msgstr "Malĝusta publika ŝlosilo"
+
+msgid "Bad secret key"
+msgstr "Malĝusta sekreta ŝlosilo"
+
+msgid "Bad signature"
+msgstr "malĝusta subskribo"
+
+msgid "No public key"
+msgstr "Neniu publika ŝlosilo"
+
+msgid "Checksum error"
+msgstr "Eraro en kontrolsumo"
+
+msgid "Bad passphrase"
+msgstr "Malĝusta pasfrazo"
+
+msgid "Invalid cipher algorithm"
+msgstr "Malvalida ĉifra algoritmo"
+
+msgid "Cannot open keyring"
+msgstr "Malfermo de ŝlosilringo"
+
+msgid "Invalid packet"
+msgstr "Malvalida paketo"
+
+msgid "Invalid armor"
+msgstr "Malvalida kiraso"
+
+msgid "No user ID"
+msgstr "Neniu ID de uzanto"
+
+msgid "No secret key"
+msgstr "Neniu sekreta ŝlosilo"
+
+msgid "Wrong secret key used"
+msgstr "Malĝusta sekreta ŝlosilo uzata"
+
+msgid "Bad session key"
+msgstr "Malĝusta seanca ŝlosilo"
+
+msgid "Unknown compression algorithm"
+msgstr "Nekonata densiga algoritmo"
+
+msgid "Number is not prime"
+msgstr "Numero ne estas primo"
+
+msgid "Invalid encoding method"
+msgstr "Malvalida enkodiga metodo"
+
+msgid "Invalid encryption scheme"
+msgstr "Malvalida ĉifriga skemo"
+
+msgid "Invalid signature scheme"
+msgstr "Malvalida subskriba skemo"
+
+msgid "Invalid attribute"
+msgstr "Malvalida atributo"
+
+msgid "No value"
+msgstr "Neniu valoro"
+
+msgid "Not found"
+msgstr "Ne trovita"
+
+msgid "Value not found"
+msgstr "Valoro ne estas trovita"
+
+msgid "Syntax error"
+msgstr "Sintaks-eraro"
+
+msgid "Bad MPI value"
+msgstr "Malĝusta valoro MPI"
+
+msgid "Invalid passphrase"
+msgstr "Malvalida pasfrazo"
+
+msgid "Invalid signature class"
+msgstr "Malvalida subskriba klaso"
+
+msgid "Resources exhausted"
+msgstr "Rimedoj estas plenuzitaj"
+
+msgid "Invalid keyring"
+msgstr "Malvalida ŝlosilringo"
+
+msgid "Trust DB error"
+msgstr "Eraro de fidinda DB"
+
+msgid "Bad certificate"
+msgstr "Malĝusta atestilo"
+
+msgid "Invalid user ID"
+msgstr "Malvalida ID de uzanto"
+
+msgid "Unexpected error"
+msgstr "Neatendita eraro"
+
+msgid "Time conflict"
+msgstr "Konflikto de tempo"
+
+msgid "Keyserver error"
+msgstr "Ŝlosilservila eraro"
+
+msgid "Wrong public key algorithm"
+msgstr "Malkorekta publika ŝlosila algoritmo"
+
+msgid "Tribute to D. A."
+msgstr "Omaĝo al D. A."
+
+msgid "Weak encryption key"
+msgstr "Malforta ĉifra ŝlosilo"
+
+msgid "Invalid key length"
+msgstr "Malvalida ŝlosila longo"
+
+msgid "Invalid argument"
+msgstr "Malvalida argumento"
+
+msgid "Syntax error in URI"
+msgstr "Sintaks-eraro en URI"
+
+msgid "Invalid URI"
+msgstr "Malvalida URI"
+
+msgid "Network error"
+msgstr "Ret-eraro"
+
+msgid "Unknown host"
+msgstr "Nekonata retnodo"
+
+msgid "Selftest failed"
+msgstr "Memtesto fiaskis"
+
+msgid "Data not encrypted"
+msgstr "Datumaro ne ĉifrita"
+
+msgid "Data not processed"
+msgstr "Datumaro ne procezita"
+
+msgid "Unusable public key"
+msgstr "Neuzebla publika ŝlosilo"
+
+msgid "Unusable secret key"
+msgstr "Neuzebla sekreta ŝlosilo"
+
+msgid "Invalid value"
+msgstr "Malvalida valoro"
+
+msgid "Bad certificate chain"
+msgstr "Malĝusta atestila ĉeno"
+
+msgid "Missing certificate"
+msgstr "Mankas atestilo"
+
+msgid "No data"
+msgstr "Neniu datumaro"
+
+msgid "Bug"
+msgstr "Program-miso"
+
+msgid "Not supported"
+msgstr "Ne subtenata"
+
+msgid "Invalid operation code"
+msgstr "Malvalida operacia kodo"
+
+msgid "Timeout"
+msgstr "Tempofino"
+
+msgid "Internal error"
+msgstr "Interna eraro"
+
+msgid "EOF (gcrypt)"
+msgstr "EOF (gcrypt)"
+
+msgid "Invalid object"
+msgstr "Malvalida objekto"
+
+msgid "Provided object is too short"
+msgstr "Provizita objekto tro mallongas"
+
+msgid "Provided object is too large"
+msgstr "Provizita objekto tro larĝas"
+
+msgid "Missing item in object"
+msgstr "Mankas ero en objekto"
+
+msgid "Not implemented"
+msgstr "Ne realigita"
+
+msgid "Conflicting use"
+msgstr "Konflikta uzo"
+
+msgid "Invalid cipher mode"
+msgstr "Malvalida ĉifra reĝimo"
+
+msgid "Invalid flag"
+msgstr "Malvalida flago"
+
+msgid "Invalid handle"
+msgstr "Malvalida traktilo"
+
+msgid "Result truncated"
+msgstr "Rezulto estas tranĉita"
+
+msgid "Incomplete line"
+msgstr "Malkompleta linio"
+
+msgid "Invalid response"
+msgstr "Malvalida respondo"
+
+msgid "No agent running"
+msgstr "Neniu agento rulas"
+
+#, fuzzy
+#| msgid "agent error"
+msgid "Agent error"
+msgstr "agent-eraro"
+
+msgid "Invalid data"
+msgstr "Malvalida datumaro"
+
+msgid "Unspecific Assuan server fault"
+msgstr "Nespecifa paneo de servilo Assuan"
+
+msgid "General Assuan error"
+msgstr "Ĝenerala eraro de Assuan"
+
+msgid "Invalid session key"
+msgstr "Malvalida seanca ŝlosilo"
+
+msgid "Invalid S-expression"
+msgstr "Malvalida S-esprimo"
+
+msgid "Unsupported algorithm"
+msgstr "Nesubtenata algoritmo"
+
+msgid "No pinentry"
+msgstr "Neniu pinentry"
+
+msgid "pinentry error"
+msgstr "Eraro de pinentry"
+
+msgid "Bad PIN"
+msgstr "Malĝusta PIN"
+
+msgid "Invalid name"
+msgstr "Malvalida nomo"
+
+msgid "Bad data"
+msgstr "Malĝusta datumaro"
+
+msgid "Invalid parameter"
+msgstr "Malvalida parametro"
+
+msgid "Wrong card"
+msgstr "Malkorekta karto"
+
+msgid "No dirmngr"
+msgstr "Neniu dirmngr"
+
+msgid "dirmngr error"
+msgstr "eraro de dirmngr"
+
+msgid "Certificate revoked"
+msgstr "Atestilo estas senvalidita"
+
+msgid "No CRL known"
+msgstr "Neniu konata CRL"
+
+msgid "CRL too old"
+msgstr "CRL tro malnovas"
+
+msgid "Line too long"
+msgstr "Linio tro longas"
+
+msgid "Not trusted"
+msgstr "Ne fidinda"
+
+msgid "Operation cancelled"
+msgstr "Operacio estas nuligita"
+
+msgid "Bad CA certificate"
+msgstr "Malĝusta atestilo CA"
+
+msgid "Certificate expired"
+msgstr "Atestilo malvalidiĝis"
+
+msgid "Certificate too young"
+msgstr "Atestilo tro novas"
+
+msgid "Unsupported certificate"
+msgstr "Nesubtenata atestilo"
+
+msgid "Unknown S-expression"
+msgstr "Nekonata S-esprimo"
+
+msgid "Unsupported protection"
+msgstr "Nesubtenata protekto"
+
+msgid "Corrupted protection"
+msgstr "Rompita protekto"
+
+msgid "Ambiguous name"
+msgstr "Plursenca nomo"
+
+msgid "Card error"
+msgstr "Kart-eraro"
+
+msgid "Card reset required"
+msgstr "Kart-reekigo estas postulata"
+
+msgid "Card removed"
+msgstr "Karto estas demetita"
+
+msgid "Invalid card"
+msgstr "Malvalida karto"
+
+msgid "Card not present"
+msgstr "Karto ne ĉeestas"
+
+msgid "No PKCS15 application"
+msgstr "Neniu aplikaĵo PKCS15"
+
+msgid "Not confirmed"
+msgstr "Ne konfirmita"
+
+msgid "Configuration error"
+msgstr "Agord-eraro"
+
+msgid "No policy match"
+msgstr "Neniu kongruo de politiko"
+
+msgid "Invalid index"
+msgstr "Malvalida indekso"
+
+msgid "Invalid ID"
+msgstr "Malvalida ID"
+
+msgid "No SmartCard daemon"
+msgstr "Neniu demono SmartCard"
+
+msgid "SmartCard daemon error"
+msgstr "Eraro de la demono SmartCard"
+
+msgid "Unsupported protocol"
+msgstr "Nesubtenata protokolo"
+
+msgid "Bad PIN method"
+msgstr "Malĝusta PIN-metodo"
+
+msgid "Card not initialized"
+msgstr "Karto ne estas ekigita"
+
+msgid "Unsupported operation"
+msgstr "Nesubtenata operacio"
+
+msgid "Wrong key usage"
+msgstr "Malkorekta uzmaniero de ŝlosilo"
+
+msgid "Nothing found"
+msgstr "Nenio trovita"
+
+msgid "Wrong blob type"
+msgstr "Malkorekta tipo de blob"
+
+msgid "Missing value"
+msgstr "Mankas valoro"
+
+msgid "Hardware problem"
+msgstr "Problemo de aparataro"
+
+msgid "PIN blocked"
+msgstr "PIN estas blokita"
+
+msgid "Conditions of use not satisfied"
+msgstr "Uzkondiĉoj ne estas kontentigitaj"
+
+msgid "PINs are not synced"
+msgstr "PIN-oj ne estas sinkronigitaj"
+
+msgid "Invalid CRL"
+msgstr "Malvalida CRL"
+
+msgid "BER error"
+msgstr "Eraro de BER"
+
+msgid "Invalid BER"
+msgstr "Malvalida BER"
+
+msgid "Element not found"
+msgstr "Elemento ne estas trovita"
+
+msgid "Identifier not found"
+msgstr "Identiganto ne estas trovita"
+
+msgid "Invalid tag"
+msgstr "Malvalida marko"
+
+msgid "Invalid length"
+msgstr "Malvalida longo"
+
+msgid "Invalid key info"
+msgstr "Malvalida ŝlosil-informo"
+
+msgid "Unexpected tag"
+msgstr "Neatentida marko"
+
+msgid "Not DER encoded"
+msgstr "Neniu enkodita DER"
+
+msgid "No CMS object"
+msgstr "Neniu objekto CMS"
+
+msgid "Invalid CMS object"
+msgstr "Malvalida objekto CMS"
+
+msgid "Unknown CMS object"
+msgstr "Nekonata objekto CMS"
+
+msgid "Unsupported CMS object"
+msgstr "Nesubtenata objekto CMS"
+
+msgid "Unsupported encoding"
+msgstr "Nesubtenata enkodigo"
+
+msgid "Unsupported CMS version"
+msgstr "Nesubtenata versio CMS"
+
+msgid "Unknown algorithm"
+msgstr "Nekonata algoritmo"
+
+msgid "Invalid crypto engine"
+msgstr "Malvalida ĉifra maŝino"
+
+msgid "Public key not trusted"
+msgstr "Publika ŝlosilo ne estas fidinda"
+
+msgid "Decryption failed"
+msgstr "Malĉifro fiaskis"
+
+msgid "Key expired"
+msgstr "Ŝlosilo malvalidiĝis"
+
+msgid "Signature expired"
+msgstr "Subskribo malvalidiĝis"
+
+msgid "Encoding problem"
+msgstr "Ekodiga problemo"
+
+msgid "Invalid state"
+msgstr "Malvalida stato"
+
+msgid "Duplicated value"
+msgstr "Duobligita valoro"
+
+msgid "Missing action"
+msgstr "Mankas ago"
+
+msgid "ASN.1 module not found"
+msgstr "Modulo ASN.1 ne estas trovita"
+
+msgid "Invalid OID string"
+msgstr "Malvalida ĉeno OID"
+
+msgid "Invalid time"
+msgstr "Malvalida tempo"
+
+msgid "Invalid CRL object"
+msgstr "Malvalida objekto CRL"
+
+msgid "Unsupported CRL version"
+msgstr "Nesubtenata versio CRL"
+
+msgid "Invalid certificate object"
+msgstr "Malvalida atestila objekto"
+
+msgid "Unknown name"
+msgstr "Nekonata nomo"
+
+msgid "A locale function failed"
+msgstr "Lokaĵara funkcio fiaskis"
+
+msgid "Not locked"
+msgstr "Ne ŝlosita"
+
+msgid "Protocol violation"
+msgstr "Perforto de protokolo"
+
+msgid "Invalid MAC"
+msgstr "Malvalida MAC"
+
+msgid "Invalid request"
+msgstr "Malvalida peto"
+
+msgid "Unknown extension"
+msgstr "Nekonata aldono"
+
+msgid "Unknown critical extension"
+msgstr "Nekonata grava aldono"
+
+msgid "Locked"
+msgstr "Ŝlosita"
+
+msgid "Unknown option"
+msgstr "Nekonata modifilo"
+
+msgid "Unknown command"
+msgstr "Nekonata komando"
+
+msgid "Not operational"
+msgstr "Ne operaciebla"
+
+msgid "No passphrase given"
+msgstr "Neniu pasfrazo estis donata"
+
+msgid "No PIN given"
+msgstr "Neniu PIN estis donata"
+
+#, fuzzy
+#| msgid "Not locked"
+msgid "Not enabled"
+msgstr "Ne ŝlosita"
+
+#, fuzzy
+#| msgid "Invalid crypto engine"
+msgid "No crypto engine"
+msgstr "Malvalida ĉifra maŝino"
+
+#, fuzzy
+#| msgid "Missing value"
+msgid "Missing key"
+msgstr "Mankas valoro"
+
+#, fuzzy
+#| msgid "No CMS object"
+msgid "Too many objects"
+msgstr "Neniu objekto CMS"
+
+msgid "Limit reached"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card not initialized"
+msgid "Not initialized"
+msgstr "Karto ne estas ekigita"
+
+#, fuzzy
+#| msgid "Missing certificate"
+msgid "Missing issuer certificate"
+msgstr "Mankas atestilo"
+
+msgid "No keyserver available"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid time"
+msgid "Invalid elliptic curve"
+msgstr "Malvalida tempo"
+
+#, fuzzy
+#| msgid "Unknown source"
+msgid "Unknown elliptic curve"
+msgstr "Nekonata fonto"
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated key"
+msgstr "Duobligita valoro"
+
+#, fuzzy
+#| msgid "Ambiguous name"
+msgid "Ambiguous result"
+msgstr "Plursenca nomo"
+
+#, fuzzy
+#| msgid "Invalid crypto engine"
+msgid "No crypto context"
+msgstr "Malvalida ĉifra maŝino"
+
+#, fuzzy
+#| msgid "Invalid crypto engine"
+msgid "Wrong crypto context"
+msgstr "Malvalida ĉifra maŝino"
+
+#, fuzzy
+#| msgid "Invalid crypto engine"
+msgid "Bad crypto context"
+msgstr "Malvalida ĉifra maŝino"
+
+msgid "Conflict in the crypto context"
+msgstr ""
+
+#, fuzzy
+#| msgid "No public key"
+msgid "Broken public key"
+msgstr "Neniu publika ŝlosilo"
+
+#, fuzzy
+#| msgid "No secret key"
+msgid "Broken secret key"
+msgstr "Neniu sekreta ŝlosilo"
+
+#, fuzzy
+#| msgid "Invalid digest algorithm"
+msgid "Invalid MAC algorithm"
+msgstr "Malvalida resuma algoritmo"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "Operation fully cancelled"
+msgstr "Operacio estas nuligita"
+
+msgid "Operation not yet finished"
+msgstr "La operacio ankoraŭ ne finiĝis"
+
+msgid "Buffer too short"
+msgstr "Bufro tro mallongas"
+
+msgid "Invalid length specifier in S-expression"
+msgstr "Malvalida long-indikilo en S-esprimo"
+
+msgid "String too long in S-expression"
+msgstr "Ĉeno tro longa en S-esprimo"
+
+msgid "Unmatched parentheses in S-expression"
+msgstr "Senpara kurbkrampo en S-esprimo"
+
+msgid "S-expression not canonical"
+msgstr "S-esprimo ne estas kanona"
+
+msgid "Bad character in S-expression"
+msgstr "Malĝusta signo en S-esprimo"
+
+msgid "Bad quotation in S-expression"
+msgstr "Malĝusta citigo en S-esprimo"
+
+msgid "Zero prefix in S-expression"
+msgstr "Nul-prefikso en S-esprimo"
+
+msgid "Nested display hints in S-expression"
+msgstr "Nestitaj montraj konsiletoj en S-esprimo"
+
+msgid "Unmatched display hints"
+msgstr "Nekongruaj montraj konsiletoj"
+
+msgid "Unexpected reserved punctuation in S-expression"
+msgstr "Neatendita rezervita interpunkcio en S-esprimo"
+
+msgid "Bad hexadecimal character in S-expression"
+msgstr "Malĝusta deksesuma signo en S-esprimo"
+
+msgid "Odd hexadecimal numbers in S-expression"
+msgstr "Malparaj deksesumaj numeroj en S-esprimo"
+
+#, fuzzy
+#| msgid "Bad octadecimal character in S-expression"
+msgid "Bad octal character in S-expression"
+msgstr "Malĝusta okuma signo en S-esprimo"
+
+msgid "All subkeys are expired or revoked"
+msgstr ""
+
+#, fuzzy
+#| msgid "Data not encrypted"
+msgid "Database is corrupted"
+msgstr "Datumaro ne ĉifrita"
+
+msgid "Server indicated a failure"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "No name"
+msgstr "Nekonata nomo"
+
+#, fuzzy
+#| msgid "No public key"
+msgid "No key"
+msgstr "Neniu publika ŝlosilo"
+
+msgid "Legacy key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Buffer too short"
+msgid "Request too short"
+msgstr "Bufro tro mallongas"
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "Request too long"
+msgstr "Linio tro longas"
+
+msgid "Object is in termination state"
+msgstr ""
+
+#, fuzzy
+#| msgid "Bad certificate chain"
+msgid "No certificate chain"
+msgstr "Malĝusta atestila ĉeno"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Certificate is too large"
+msgstr "Atestilo tro novas"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid record"
+msgstr "Malvalida karto"
+
+msgid "The MAC does not verify"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unexpected tag"
+msgid "Unexpected message"
+msgstr "Neatentida marko"
+
+msgid "Compression or decompression failed"
+msgstr ""
+
+msgid "A counter would wrap"
+msgstr ""
+
+msgid "Fatal alert message received"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid cipher algorithm"
+msgid "No cipher algorithm"
+msgstr "Malvalida ĉifra algoritmo"
+
+#, fuzzy
+#| msgid "Missing certificate"
+msgid "Missing client certificate"
+msgstr "Mankas atestilo"
+
+#, fuzzy
+#| msgid "Certificate revoked"
+msgid "Close notification received"
+msgstr "Atestilo estas senvalidita"
+
+#, fuzzy
+#| msgid "Key expired"
+msgid "Ticket expired"
+msgstr "Ŝlosilo malvalidiĝis"
+
+#, fuzzy
+#| msgid "Bad public key"
+msgid "Bad ticket"
+msgstr "Malĝusta publika ŝlosilo"
+
+#, fuzzy
+#| msgid "Unknown packet"
+msgid "Unknown identity"
+msgstr "Nekonata paketo"
+
+#, fuzzy
+#| msgid "Bad certificate chain"
+msgid "Bad certificate message in handshake"
+msgstr "Malĝusta atestila ĉeno"
+
+msgid "Bad certificate request message in handshake"
+msgstr ""
+
+msgid "Bad certificate verify message in handshake"
+msgstr ""
+
+msgid "Bad change cipher message in handshake"
+msgstr ""
+
+msgid "Bad client hello message in handshake"
+msgstr ""
+
+msgid "Bad server hello message in handshake"
+msgstr ""
+
+msgid "Bad server hello done message in handshake"
+msgstr ""
+
+msgid "Bad finished message in handshake"
+msgstr ""
+
+msgid "Bad server key exchange message in handshake"
+msgstr ""
+
+msgid "Bad client key exchange message in handshake"
+msgstr ""
+
+msgid "Bogus string"
+msgstr ""
+
+msgid "Forbidden"
+msgstr ""
+
+#, fuzzy
+#| msgid "Key expired"
+msgid "Key disabled"
+msgstr "Ŝlosilo malvalidiĝis"
+
+msgid "Not possible with a card based key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid object"
+msgid "Invalid lock object"
+msgstr "Malvalida objekto"
+
+msgid "True"
+msgstr ""
+
+msgid "False"
+msgstr ""
+
+msgid "General IPC error"
+msgstr "Ĝenerala eraro de IPC"
+
+msgid "IPC accept call failed"
+msgstr "Akcepta voko de IPC fiaskis"
+
+msgid "IPC connect call failed"
+msgstr "Konekta voko de IPC fiaskis"
+
+msgid "Invalid IPC response"
+msgstr "Malvalida respondo de IPC"
+
+msgid "Invalid value passed to IPC"
+msgstr "Malvalida valoro estis pasata al IPC"
+
+msgid "Incomplete line passed to IPC"
+msgstr "Nekompleta linio estis pasata al IPC"
+
+msgid "Line passed to IPC too long"
+msgstr "Pasita linio al IPC tro longas"
+
+msgid "Nested IPC commands"
+msgstr "Nestitaj komandoj IPC"
+
+msgid "No data callback in IPC"
+msgstr "Neniu datumar funkcivoko en IPC"
+
+msgid "No inquire callback in IPC"
+msgstr "Neniu enketa funkcivoko en IPC"
+
+msgid "Not an IPC server"
+msgstr "Ne estas servilo IPC"
+
+msgid "Not an IPC client"
+msgstr "Ne estas kliento IPC"
+
+msgid "Problem starting IPC server"
+msgstr "Problemo dum ekigo de servilo IPC"
+
+msgid "IPC read error"
+msgstr "Leg-eraro de IPC"
+
+msgid "IPC write error"
+msgstr "Skrib-eraro de IPC"
+
+msgid "Too much data for IPC layer"
+msgstr "Tro multa datumaro por tavolo IPC"
+
+msgid "Unexpected IPC command"
+msgstr "Neatendita komando IPC"
+
+msgid "Unknown IPC command"
+msgstr "Nekonata komando IPC"
+
+msgid "IPC syntax error"
+msgstr "Sintaks-eraro de IPC"
+
+msgid "IPC call has been cancelled"
+msgstr "IPC-voko estas nuligita"
+
+msgid "No input source for IPC"
+msgstr "Neniu enig-fonto por IPC"
+
+msgid "No output source for IPC"
+msgstr "Neniu elig-fonto por IPC"
+
+msgid "IPC parameter error"
+msgstr "Parametra eraro de IPC"
+
+msgid "Unknown IPC inquire"
+msgstr "Nekonata enketo de IPC"
+
+#, fuzzy
+#| msgid "Invalid crypto engine"
+msgid "Crypto engine too old"
+msgstr "Malvalida ĉifra maŝino"
+
+msgid "Screen or window too small"
+msgstr ""
+
+msgid "Screen or window too large"
+msgstr ""
+
+msgid "Required environment variable not set"
+msgstr ""
+
+msgid "User ID already exists"
+msgstr ""
+
+msgid "Name already exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated name"
+msgstr "Duobligita valoro"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Object is too young"
+msgstr "Atestilo tro novas"
+
+#, fuzzy
+#| msgid "Provided object is too short"
+msgid "Object is too old"
+msgstr "Provizita objekto tro mallongas"
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Unknown flag"
+msgstr "Nekonata nomo"
+
+#, fuzzy
+#| msgid "Invalid operation code"
+msgid "Invalid execution order"
+msgstr "Malvalida operacia kodo"
+
+msgid "Already fetched"
+msgstr ""
+
+msgid "Try again later"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Wrong name"
+msgstr "Nekonata nomo"
+
+msgid "System bug detected"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown system error"
+msgid "Unknown DNS error"
+msgstr "Nekonata sistem-eraro"
+
+#, fuzzy
+#| msgid "Invalid OID string"
+msgid "Invalid DNS section"
+msgstr "Malvalida ĉeno OID"
+
+#, fuzzy
+#| msgid "Invalid S-expression"
+msgid "Invalid textual address form"
+msgstr "Malvalida S-esprimo"
+
+#, fuzzy
+#| msgid "Missing certificate"
+msgid "Missing DNS query packet"
+msgstr "Mankas atestilo"
+
+msgid "Missing DNS answer packet"
+msgstr ""
+
+msgid "Connection closed in DNS"
+msgstr ""
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "Verification failed in DNS"
+msgstr "Malĉifro fiaskis"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "DNS Timeout"
+msgstr "Tempofino"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "General LDAP error"
+msgstr "Ĝenerala eraro de IPC"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP attribute error"
+msgstr "Ĝenerala eraro"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP name error"
+msgstr "Ĝenerala eraro"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP security error"
+msgstr "Ĝenerala eraro de Assuan"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP service error"
+msgstr "Ĝenerala eraro"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP update error"
+msgstr "Ĝenerala eraro de Assuan"
+
+msgid "Experimental LDAP error code"
+msgstr ""
+
+#, fuzzy
+#| msgid "IPC write error"
+msgid "Private LDAP error code"
+msgstr "Skrib-eraro de IPC"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other general LDAP error"
+msgstr "Ĝenerala eraro de IPC"
+
+#, fuzzy
+#| msgid "IPC connect call failed"
+msgid "LDAP connecting failed (X)"
+msgstr "Konekta voko de IPC fiaskis"
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral limit exceeded"
+msgstr "Ĝenerala eraro"
+
+msgid "LDAP client loop"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "No LDAP results returned"
+msgstr "Kart-reekigo estas postulata"
+
+#, fuzzy
+#| msgid "Element not found"
+msgid "LDAP control not found"
+msgstr "Elemento ne estas trovita"
+
+#, fuzzy
+#| msgid "Not supported"
+msgid "Not supported by LDAP"
+msgstr "Ne subtenata"
+
+#, fuzzy
+#| msgid "Unexpected error"
+msgid "LDAP connect error"
+msgstr "Neatendita eraro"
+
+msgid "Out of memory in LDAP"
+msgstr ""
+
+msgid "Bad parameter to an LDAP routine"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported operation"
+msgid "User cancelled LDAP operation"
+msgstr "Nesubtenata operacio"
+
+#, fuzzy
+#| msgid "Bad certificate"
+msgid "Bad LDAP search filter"
+msgstr "Malĝusta atestilo"
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "Unknown LDAP authentication method"
+msgstr "Nekonata aldono"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "Timeout in LDAP"
+msgstr "Tempofino"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP decoding error"
+msgstr "eraro de dirmngr"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP encoding error"
+msgstr "eraro de dirmngr"
+
+#, fuzzy
+#| msgid "IPC read error"
+msgid "LDAP local error"
+msgstr "Leg-eraro de IPC"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot contact LDAP server"
+msgstr "Ne estas servilo IPC"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP success"
+msgstr "Sukceso"
+
+#, fuzzy
+#| msgid "Configuration error"
+msgid "LDAP operations error"
+msgstr "Agord-eraro"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP protocol error"
+msgstr "Perforto de protokolo"
+
+msgid "Time limit exceeded in LDAP"
+msgstr ""
+
+msgid "Size limit exceeded in LDAP"
+msgstr ""
+
+msgid "LDAP compare false"
+msgstr ""
+
+msgid "LDAP compare true"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "LDAP authentication method not supported"
+msgstr "Nekonata aldono"
+
+msgid "Strong(er) LDAP authentication required"
+msgstr ""
+
+msgid "Partial LDAP results+referral received"
+msgstr ""
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral"
+msgstr "Ĝenerala eraro"
+
+msgid "Administrative LDAP limit exceeded"
+msgstr ""
+
+msgid "Critical LDAP extension is unavailable"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Confidentiality required by LDAP"
+msgstr "Kart-reekigo estas postulata"
+
+msgid "LDAP SASL bind in progress"
+msgstr ""
+
+msgid "No such LDAP attribute"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid attribute"
+msgid "Undefined LDAP attribute type"
+msgstr "Malvalida atributo"
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate matching in LDAP"
+msgstr "Nesubtenata protekto"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Constraint violation in LDAP"
+msgstr "Perforto de protokolo"
+
+msgid "LDAP type or value exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid syntax in LDAP"
+msgstr "Malvalida stato"
+
+#, fuzzy
+#| msgid "No CMS object"
+msgid "No such LDAP object"
+msgstr "Neniu objekto CMS"
+
+#, fuzzy
+#| msgid "Hardware problem"
+msgid "LDAP alias problem"
+msgstr "Problemo de aparataro"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid DN syntax in LDAP"
+msgstr "Malvalida stato"
+
+msgid "LDAP entry is a leaf"
+msgstr ""
+
+#, fuzzy
+#| msgid "Encoding problem"
+msgid "LDAP alias dereferencing problem"
+msgstr "Ekodiga problemo"
+
+msgid "LDAP proxy authorization failure (X)"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate LDAP authentication"
+msgstr "Nesubtenata protekto"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid LDAP credentials"
+msgstr "Malvalida karto"
+
+msgid "Insufficient access for LDAP"
+msgstr ""
+
+msgid "LDAP server is busy"
+msgstr ""
+
+msgid "LDAP server is unavailable"
+msgstr ""
+
+msgid "LDAP server is unwilling to perform"
+msgstr ""
+
+msgid "Loop detected by LDAP"
+msgstr ""
+
+#, fuzzy
+#| msgid "Missing action"
+msgid "LDAP naming violation"
+msgstr "Mankas ago"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP object class violation"
+msgstr "Perforto de protokolo"
+
+#, fuzzy
+#| msgid "Operation not yet finished"
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "La operacio ankoraŭ ne finiĝis"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation not allowed on RDN"
+msgstr "Operacio estas nuligita"
+
+msgid "Already exists (LDAP)"
+msgstr ""
+
+msgid "Cannot modify LDAP object class"
+msgstr ""
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "LDAP results too large"
+msgstr "Linio tro longas"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation affects multiple DSAs"
+msgstr "Operacio estas nuligita"
+
+msgid "Virtual LDAP list view error"
+msgstr ""
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other LDAP error"
+msgstr "Ĝenerala eraro de IPC"
+
+#, fuzzy
+#| msgid "Resources exhausted"
+msgid "Resources exhausted in LCUP"
+msgstr "Rimedoj estas plenuzitaj"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Security violation in LCUP"
+msgstr "Perforto de protokolo"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid data in LCUP"
+msgstr "Malvalida stato"
+
+#, fuzzy
+#| msgid "Unsupported certificate"
+msgid "Unsupported scheme in LCUP"
+msgstr "Nesubtenata atestilo"
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Reload required in LCUP"
+msgstr "Kart-reekigo estas postulata"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP cancelled"
+msgstr "Sukceso"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "No LDAP operation to cancel"
+msgstr "Ne operaciebla"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "Too late to cancel LDAP"
+msgstr "Ne operaciebla"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot cancel LDAP"
+msgstr "Ne estas servilo IPC"
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "LDAP assertion failed"
+msgstr "Malĉifro fiaskis"
+
+msgid "Proxied authorization denied by LDAP"
+msgstr ""
+
+msgid "User defined error code 1"
+msgstr "Uzant-difinita erarkodo 1"
+
+msgid "User defined error code 2"
+msgstr "Uzant-difinita erarkodo 2"
+
+msgid "User defined error code 3"
+msgstr "Uzant-difinita erarkodo 3"
+
+msgid "User defined error code 4"
+msgstr "Uzant-difinita erarkodo 4"
+
+msgid "User defined error code 5"
+msgstr "Uzant-difinita erarkodo 5"
+
+msgid "User defined error code 6"
+msgstr "Uzant-difinita erarkodo 6"
+
+msgid "User defined error code 7"
+msgstr "Uzant-difinita erarkodo 7"
+
+msgid "User defined error code 8"
+msgstr "Uzant-difinita erarkodo 8"
+
+msgid "User defined error code 9"
+msgstr "Uzant-difinita erarkodo 9"
+
+msgid "User defined error code 10"
+msgstr "Uzant-difinita erarkodo 10"
+
+msgid "User defined error code 11"
+msgstr "Uzant-difinita erarkodo 11"
+
+msgid "User defined error code 12"
+msgstr "Uzant-difinita erarkodo 12"
+
+msgid "User defined error code 13"
+msgstr "Uzant-difinita erarkodo 13"
+
+msgid "User defined error code 14"
+msgstr "Uzant-difinita erarkodo 14"
+
+msgid "User defined error code 15"
+msgstr "Uzant-difinita erarkodo 15"
+
+msgid "User defined error code 16"
+msgstr "Uzant-difinita erarkodo 16"
+
+msgid "System error w/o errno"
+msgstr "Sistem-eraro sen errno"
+
+msgid "Unknown system error"
+msgstr "Nekonata sistem-eraro"
+
+msgid "End of file"
+msgstr "Fino de dosiero"
+
+msgid "Unknown error code"
+msgstr "Nekonata erar-kodo"
+
+#, c-format
+msgid "Usage: %s GPG-ERROR [...]\n"
+msgstr "Uzmaniero: %s GPG-ERARO [...]\n"
+
+#, c-format
+msgid "%s: warning: could not recognize %s\n"
+msgstr "%s: averto: ne eblis rekoni %s\n"
+
+#, fuzzy
+#~| msgid "Resources exhausted"
+#~ msgid "LCUP Resources exhausted"
+#~ msgstr "Rimedoj estas plenuzitaj"
+
+#, fuzzy
+#~| msgid "Invalid data"
+#~ msgid "LCUP Invalid data"
+#~ msgstr "Malvalida datumaro"
+
+#, fuzzy
+#~| msgid "General error"
+#~ msgid "LDAP Other general error"
+#~ msgstr "Ĝenerala eraro"
+
+#, fuzzy
+#~| msgid "dirmngr error"
+#~ msgid "Encoding error"
+#~ msgstr "eraro de dirmngr"
diff --git a/po/fr.po b/po/fr.po
new file mode 100644
index 0000000..3e7abba
--- /dev/null
+++ b/po/fr.po
@@ -0,0 +1,1472 @@
+# French translation of Libgpg-error
+# Copyright (C) 2005, 2011, 2012, 2014 Free Software Foundation, Inc.
+# This file is distributed under the same license as the libgpg-error package.
+#
+# Stephane Roy <[email protected]>, 2005.
+# David Prévot <[email protected]>, 2011, 2012, 2014.
+msgid ""
+msgstr ""
+"Project-Id-Version: libgpg-error-1.17\n"
+"Report-Msgid-Bugs-To: [email protected]\n"
+"PO-Revision-Date: 2014-11-01 22:07-0400\n"
+"Last-Translator: David Prévot <[email protected]>\n"
+"Language-Team: French <[email protected]>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Lokalize 1.5\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+msgid "Unspecified source"
+msgstr "Source non indiquée"
+
+msgid "gcrypt"
+msgstr "gcrypt"
+
+msgid "GnuPG"
+msgstr "GnuPG"
+
+msgid "GpgSM"
+msgstr "GpgSM"
+
+msgid "GPG Agent"
+msgstr "Agent GPG"
+
+msgid "Pinentry"
+msgstr "Pinentry"
+
+msgid "SCD"
+msgstr "SCD"
+
+msgid "GPGME"
+msgstr "GPGME"
+
+msgid "Keybox"
+msgstr "Keybox"
+
+msgid "KSBA"
+msgstr "KSBA"
+
+msgid "Dirmngr"
+msgstr "Dirmngr"
+
+msgid "GSTI"
+msgstr "GSTI"
+
+msgid "GPA"
+msgstr "GPA"
+
+msgid "Kleopatra"
+msgstr "Kleopatra"
+
+msgid "G13"
+msgstr "G13"
+
+msgid "Assuan"
+msgstr "Assuan"
+
+msgid "TLS"
+msgstr "TLS"
+
+msgid "Any source"
+msgstr "N'importe quelle source"
+
+msgid "User defined source 1"
+msgstr "Source 1 définie par l'utilisateur"
+
+msgid "User defined source 2"
+msgstr "Source 2 définie par l'utilisateur"
+
+msgid "User defined source 3"
+msgstr "Source 3 définie par l'utilisateur"
+
+msgid "User defined source 4"
+msgstr "Source 4 définie par l'utilisateur"
+
+msgid "Unknown source"
+msgstr "Source inconnue"
+
+msgid "Success"
+msgstr "Réussite"
+
+msgid "General error"
+msgstr "Erreur générale"
+
+msgid "Unknown packet"
+msgstr "Paquet inconnu"
+
+msgid "Unknown version in packet"
+msgstr "Version inconnue dans le paquet"
+
+msgid "Invalid public key algorithm"
+msgstr "Algorithme à clef publique incorrect"
+
+msgid "Invalid digest algorithm"
+msgstr "Algorithme de hachage incorrect"
+
+msgid "Bad public key"
+msgstr "Mauvaise clef publique"
+
+msgid "Bad secret key"
+msgstr "Mauvaise clef secrète"
+
+msgid "Bad signature"
+msgstr "Mauvaise signature"
+
+msgid "No public key"
+msgstr "Pas de clef publique"
+
+msgid "Checksum error"
+msgstr "Erreur de somme de contrôle"
+
+msgid "Bad passphrase"
+msgstr "Mauvaise phrase secrète"
+
+msgid "Invalid cipher algorithm"
+msgstr "Algorithme de chiffrement incorrect"
+
+msgid "Cannot open keyring"
+msgstr "Porte-clefs ouvert"
+
+msgid "Invalid packet"
+msgstr "Paquet incorrect"
+
+msgid "Invalid armor"
+msgstr "Armure incorrecte"
+
+msgid "No user ID"
+msgstr "Pas d'identité"
+
+msgid "No secret key"
+msgstr "Pas de clef secrète"
+
+msgid "Wrong secret key used"
+msgstr "Mauvaise clef secrète utilisée"
+
+msgid "Bad session key"
+msgstr "Mauvaise clef de session"
+
+msgid "Unknown compression algorithm"
+msgstr "Algorithme de compression inconnu"
+
+msgid "Number is not prime"
+msgstr "Ce nombre n'est pas premier"
+
+msgid "Invalid encoding method"
+msgstr "Méthode d'encodage incorrecte"
+
+msgid "Invalid encryption scheme"
+msgstr "Schéma de chiffrement incorrect"
+
+msgid "Invalid signature scheme"
+msgstr "Schéma de signature incorrect"
+
+msgid "Invalid attribute"
+msgstr "Attribut incorrect"
+
+msgid "No value"
+msgstr "Pas de valeur"
+
+msgid "Not found"
+msgstr "Non trouvé"
+
+msgid "Value not found"
+msgstr "Valeur non trouvée"
+
+msgid "Syntax error"
+msgstr "Erreur de syntaxe"
+
+msgid "Bad MPI value"
+msgstr "Mauvaise valeur MPI"
+
+msgid "Invalid passphrase"
+msgstr "Phrase secrète incorrecte"
+
+msgid "Invalid signature class"
+msgstr "Classe de signature incorrecte"
+
+msgid "Resources exhausted"
+msgstr "Ressources épuisées"
+
+msgid "Invalid keyring"
+msgstr "Porte-clefs incorrect"
+
+msgid "Trust DB error"
+msgstr "Erreur de la base de confiance"
+
+msgid "Bad certificate"
+msgstr "Mauvais certificat"
+
+msgid "Invalid user ID"
+msgstr "Identité incorrecte"
+
+msgid "Unexpected error"
+msgstr "Erreur inattendue"
+
+msgid "Time conflict"
+msgstr "Conflit temporel"
+
+msgid "Keyserver error"
+msgstr "Erreur du serveur de clefs"
+
+msgid "Wrong public key algorithm"
+msgstr "Mauvais algorithme à clef publique"
+
+msgid "Tribute to D. A."
+msgstr "Hommage à D. A."
+
+msgid "Weak encryption key"
+msgstr "Clef de chiffrement faible"
+
+msgid "Invalid key length"
+msgstr "Longueur de clef incorrecte"
+
+msgid "Invalid argument"
+msgstr "Argument incorrect"
+
+msgid "Syntax error in URI"
+msgstr "Erreur de syntaxe dans l'URI"
+
+msgid "Invalid URI"
+msgstr "URI incorrecte"
+
+msgid "Network error"
+msgstr "Erreur réseau"
+
+msgid "Unknown host"
+msgstr "Hôte inconnu"
+
+msgid "Selftest failed"
+msgstr "Échec de l'autotest"
+
+msgid "Data not encrypted"
+msgstr "Données non chiffrées"
+
+msgid "Data not processed"
+msgstr "Données non traitées"
+
+msgid "Unusable public key"
+msgstr "Clef publique inutilisable"
+
+msgid "Unusable secret key"
+msgstr "Clef privée inutilisable"
+
+msgid "Invalid value"
+msgstr "Valeur incorrecte"
+
+msgid "Bad certificate chain"
+msgstr "Mauvaise chaîne de certificat"
+
+msgid "Missing certificate"
+msgstr "Certificat manquant"
+
+msgid "No data"
+msgstr "Pas de données"
+
+msgid "Bug"
+msgstr "Bogue"
+
+msgid "Not supported"
+msgstr "Non pris en charge"
+
+msgid "Invalid operation code"
+msgstr "Code d'opération incorrect"
+
+msgid "Timeout"
+msgstr "Délai d'attente dépassé"
+
+msgid "Internal error"
+msgstr "Erreur interne"
+
+msgid "EOF (gcrypt)"
+msgstr "EOF (gcrypt)"
+
+msgid "Invalid object"
+msgstr "Objet incorrect"
+
+msgid "Provided object is too short"
+msgstr "L'objet fourni est trop petit"
+
+msgid "Provided object is too large"
+msgstr "L'objet fourni est trop grand"
+
+msgid "Missing item in object"
+msgstr "Élément manquant dans l'objet"
+
+msgid "Not implemented"
+msgstr "Non implémenté"
+
+msgid "Conflicting use"
+msgstr "Utilisation conflictuelle"
+
+msgid "Invalid cipher mode"
+msgstr "Mode de chiffrement incorrect"
+
+msgid "Invalid flag"
+msgstr "Option incorrecte"
+
+msgid "Invalid handle"
+msgstr "Gestion incorrecte"
+
+msgid "Result truncated"
+msgstr "Résultat tronqué"
+
+msgid "Incomplete line"
+msgstr "Ligne incomplète"
+
+msgid "Invalid response"
+msgstr "Réponse incorrecte"
+
+msgid "No agent running"
+msgstr "Pas d'agent en cours d'exécution"
+
+msgid "Agent error"
+msgstr "Erreur d'agent"
+
+msgid "Invalid data"
+msgstr "Données incorrectes"
+
+msgid "Unspecific Assuan server fault"
+msgstr "Erreur générale du serveur Assuan"
+
+msgid "General Assuan error"
+msgstr "Erreur générale Assuan"
+
+msgid "Invalid session key"
+msgstr "Clef de session incorrecte"
+
+msgid "Invalid S-expression"
+msgstr "Expression symbolique incorrecte"
+
+msgid "Unsupported algorithm"
+msgstr "Algorithme non pris en charge"
+
+msgid "No pinentry"
+msgstr "Pas de pinentry"
+
+msgid "pinentry error"
+msgstr "Erreur de pinentry"
+
+msgid "Bad PIN"
+msgstr "Mauvais code personnel"
+
+msgid "Invalid name"
+msgstr "Nom incorrect"
+
+msgid "Bad data"
+msgstr "Mauvaises données"
+
+msgid "Invalid parameter"
+msgstr "Paramètre incorrect"
+
+msgid "Wrong card"
+msgstr "Mauvaise carte"
+
+msgid "No dirmngr"
+msgstr "Pas de dirmngr"
+
+msgid "dirmngr error"
+msgstr "Erreur de dirmngr"
+
+msgid "Certificate revoked"
+msgstr "Certificat révoqué"
+
+msgid "No CRL known"
+msgstr "Pas de CRL connu"
+
+msgid "CRL too old"
+msgstr "CRL trop ancien"
+
+msgid "Line too long"
+msgstr "Ligne trop longue"
+
+msgid "Not trusted"
+msgstr "Pas de confiance"
+
+msgid "Operation cancelled"
+msgstr "Opération annulée"
+
+msgid "Bad CA certificate"
+msgstr "Mauvais certificat de l'autorité de certification"
+
+msgid "Certificate expired"
+msgstr "Certificat expiré"
+
+msgid "Certificate too young"
+msgstr "Certificat trop récent"
+
+msgid "Unsupported certificate"
+msgstr "Certificat non pris en charge"
+
+msgid "Unknown S-expression"
+msgstr "Expression symbolique inconnue"
+
+msgid "Unsupported protection"
+msgstr "Protection non prise en charge"
+
+msgid "Corrupted protection"
+msgstr "Protection corrompue"
+
+msgid "Ambiguous name"
+msgstr "Nom ambigu"
+
+msgid "Card error"
+msgstr "Erreur de carte"
+
+msgid "Card reset required"
+msgstr "Réinitialisation de la carte nécessaire"
+
+msgid "Card removed"
+msgstr "Carte enlevée"
+
+msgid "Invalid card"
+msgstr "Carte incorrecte"
+
+msgid "Card not present"
+msgstr "Carte absente"
+
+msgid "No PKCS15 application"
+msgstr "Application non PKCS15"
+
+msgid "Not confirmed"
+msgstr "Non confirmé"
+
+msgid "Configuration error"
+msgstr "Erreur de configuration"
+
+msgid "No policy match"
+msgstr "Aucune correspondance de politique"
+
+msgid "Invalid index"
+msgstr "Indice incorrect"
+
+msgid "Invalid ID"
+msgstr "Identifiant incorrect"
+
+msgid "No SmartCard daemon"
+msgstr "Pas de démon SmartCard"
+
+msgid "SmartCard daemon error"
+msgstr "Erreur de démon SmartCard"
+
+msgid "Unsupported protocol"
+msgstr "Protocole non pris en charge"
+
+msgid "Bad PIN method"
+msgstr "Mauvaise méthode de code personnel"
+
+msgid "Card not initialized"
+msgstr "Carte non initialisée"
+
+msgid "Unsupported operation"
+msgstr "Opération non prise en charge"
+
+msgid "Wrong key usage"
+msgstr "Mauvaise utilisation de la clef"
+
+msgid "Nothing found"
+msgstr "Rien de trouvé"
+
+msgid "Wrong blob type"
+msgstr "Mauvais type de blob"
+
+msgid "Missing value"
+msgstr "Valeur manquante"
+
+msgid "Hardware problem"
+msgstr "Problème matériel"
+
+msgid "PIN blocked"
+msgstr "Code personnel bloqué"
+
+msgid "Conditions of use not satisfied"
+msgstr "Conditions d'utilisation non satisfaites"
+
+msgid "PINs are not synced"
+msgstr "Les codes personnels ne sont pas synchrones"
+
+msgid "Invalid CRL"
+msgstr "CRL incorrect"
+
+msgid "BER error"
+msgstr "Erreur de BER"
+
+msgid "Invalid BER"
+msgstr "BER incorrect"
+
+msgid "Element not found"
+msgstr "Élément non trouvé"
+
+msgid "Identifier not found"
+msgstr "Identifiant non trouvé"
+
+msgid "Invalid tag"
+msgstr "Balise incorrecte"
+
+msgid "Invalid length"
+msgstr "Longueur incorrecte"
+
+msgid "Invalid key info"
+msgstr "Informations de clef incorrectes"
+
+msgid "Unexpected tag"
+msgstr "Balise inattendue"
+
+msgid "Not DER encoded"
+msgstr "Non encodé DER"
+
+msgid "No CMS object"
+msgstr "Pas d'objet CMS"
+
+msgid "Invalid CMS object"
+msgstr "Objet CMS incorrect"
+
+msgid "Unknown CMS object"
+msgstr "Objet CMS inconnu"
+
+msgid "Unsupported CMS object"
+msgstr "Objet CMS non pris en charge"
+
+msgid "Unsupported encoding"
+msgstr "Codage non pris en charge"
+
+msgid "Unsupported CMS version"
+msgstr "Version de CMS non prise en charge"
+
+msgid "Unknown algorithm"
+msgstr "Algorithme inconnu"
+
+msgid "Invalid crypto engine"
+msgstr "Moteur de chiffrement incorrect"
+
+msgid "Public key not trusted"
+msgstr "Pas de confiance dans la clef publique"
+
+msgid "Decryption failed"
+msgstr "Échec de déchiffrement"
+
+msgid "Key expired"
+msgstr "Clef expirée"
+
+msgid "Signature expired"
+msgstr "Signature expirée"
+
+msgid "Encoding problem"
+msgstr "Problème d'encodage"
+
+msgid "Invalid state"
+msgstr "État incorrect"
+
+msgid "Duplicated value"
+msgstr "Valeur dupliquée"
+
+msgid "Missing action"
+msgstr "Action manquante"
+
+msgid "ASN.1 module not found"
+msgstr "Module ASN.1 non trouvé"
+
+msgid "Invalid OID string"
+msgstr "Chaîne OID incorrecte"
+
+msgid "Invalid time"
+msgstr "Date incorrecte"
+
+msgid "Invalid CRL object"
+msgstr "Objet CRL incorrect"
+
+msgid "Unsupported CRL version"
+msgstr "Version de CRL non prise en charge"
+
+msgid "Invalid certificate object"
+msgstr "Objet de certificat incorrect"
+
+msgid "Unknown name"
+msgstr "Nom inconnu"
+
+msgid "A locale function failed"
+msgstr "Échec d'une fonction de paramètres régionaux (locale)"
+
+msgid "Not locked"
+msgstr "Non verrouillé"
+
+msgid "Protocol violation"
+msgstr "Violation de protocole"
+
+msgid "Invalid MAC"
+msgstr "MAC incorrect"
+
+msgid "Invalid request"
+msgstr "Requête incorrecte"
+
+msgid "Unknown extension"
+msgstr "Extension inconnue"
+
+msgid "Unknown critical extension"
+msgstr "Extension critique inconnue"
+
+msgid "Locked"
+msgstr "Verrouillé"
+
+msgid "Unknown option"
+msgstr "Option inconnue"
+
+msgid "Unknown command"
+msgstr "Commande inconnue"
+
+msgid "Not operational"
+msgstr "Non opérationnel"
+
+msgid "No passphrase given"
+msgstr "Aucune phrase secrète fournie"
+
+msgid "No PIN given"
+msgstr "Aucun code personnel fourni"
+
+msgid "Not enabled"
+msgstr "Non activé"
+
+msgid "No crypto engine"
+msgstr "Aucun moteur de chiffrement"
+
+msgid "Missing key"
+msgstr "Clef manquante"
+
+msgid "Too many objects"
+msgstr "Trop d'objets"
+
+msgid "Limit reached"
+msgstr "Limite atteinte"
+
+msgid "Not initialized"
+msgstr "Non initialisé"
+
+msgid "Missing issuer certificate"
+msgstr "Certificat de l'émetteur manquant"
+
+msgid "No keyserver available"
+msgstr "Aucun serveur de clefs disponible"
+
+msgid "Invalid elliptic curve"
+msgstr "Courbe elliptique incorrecte"
+
+msgid "Unknown elliptic curve"
+msgstr "Courbe elliptique inconnue"
+
+msgid "Duplicated key"
+msgstr "Clef dupliquée"
+
+msgid "Ambiguous result"
+msgstr "Résultat ambigu"
+
+msgid "No crypto context"
+msgstr "Aucun contexte de chiffrement"
+
+msgid "Wrong crypto context"
+msgstr "Contexte de chiffrement incorrect"
+
+msgid "Bad crypto context"
+msgstr "Mauvais contexte de chiffrement"
+
+msgid "Conflict in the crypto context"
+msgstr "Conflit dans le contexte de chiffrement"
+
+msgid "Broken public key"
+msgstr "Clef publique cassée"
+
+msgid "Broken secret key"
+msgstr "Clef secrète cassée"
+
+msgid "Invalid MAC algorithm"
+msgstr "Algorithme MAC incorrect"
+
+msgid "Operation fully cancelled"
+msgstr "Opération complètement annulée"
+
+msgid "Operation not yet finished"
+msgstr "L'opération n'est pas encore terminée"
+
+msgid "Buffer too short"
+msgstr "Tampon trop court"
+
+msgid "Invalid length specifier in S-expression"
+msgstr "Longueur de spécificateur incorrecte dans l'expression symbolique"
+
+msgid "String too long in S-expression"
+msgstr "Chaîne trop longue dans l'expression symbolique"
+
+msgid "Unmatched parentheses in S-expression"
+msgstr "Parenthèses non correspondantes dans l'expression symbolique"
+
+msgid "S-expression not canonical"
+msgstr "Expression symbolique non canonique"
+
+msgid "Bad character in S-expression"
+msgstr "Mauvais caractère dans l'expression symbolique"
+
+msgid "Bad quotation in S-expression"
+msgstr "Erreur de guillemets dans l'expression symbolique"
+
+msgid "Zero prefix in S-expression"
+msgstr "Préfixe nul dans l'expression symbolique"
+
+msgid "Nested display hints in S-expression"
+msgstr "Affichage imbriqué d'indications dans l'expression symbolique"
+
+msgid "Unmatched display hints"
+msgstr "Affichage d'indications non correspondantes"
+
+msgid "Unexpected reserved punctuation in S-expression"
+msgstr "Ponctuation réservée inattendue dans l'expression symbolique"
+
+msgid "Bad hexadecimal character in S-expression"
+msgstr "Mauvais caractère hexadécimal dans l'expression symbolique"
+
+msgid "Odd hexadecimal numbers in S-expression"
+msgstr "Nombre hexadécimal impair dans l'expression symbolique"
+
+msgid "Bad octal character in S-expression"
+msgstr "Mauvais caractère octal dans l'expression symbolique"
+
+msgid "All subkeys are expired or revoked"
+msgstr ""
+
+#, fuzzy
+#| msgid "Data not encrypted"
+msgid "Database is corrupted"
+msgstr "Données non chiffrées"
+
+msgid "Server indicated a failure"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "No name"
+msgstr "Nom inconnu"
+
+#, fuzzy
+#| msgid "No public key"
+msgid "No key"
+msgstr "Pas de clef publique"
+
+msgid "Legacy key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Buffer too short"
+msgid "Request too short"
+msgstr "Tampon trop court"
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "Request too long"
+msgstr "Ligne trop longue"
+
+msgid "Object is in termination state"
+msgstr ""
+
+msgid "No certificate chain"
+msgstr "Aucune chaîne de certificat"
+
+msgid "Certificate is too large"
+msgstr "Le certificat est trop grand"
+
+msgid "Invalid record"
+msgstr "Enregistrement incorrect"
+
+msgid "The MAC does not verify"
+msgstr "Le MAC ne peut pas être vérifié"
+
+msgid "Unexpected message"
+msgstr "Message inattendu"
+
+msgid "Compression or decompression failed"
+msgstr "Échec de compression ou décompression"
+
+msgid "A counter would wrap"
+msgstr "Un compteur devrait envelopper"
+
+msgid "Fatal alert message received"
+msgstr "Message d’alerte fatale reçu"
+
+msgid "No cipher algorithm"
+msgstr "Aucun algorithme de chiffrement"
+
+msgid "Missing client certificate"
+msgstr "Certificat de client manquant"
+
+msgid "Close notification received"
+msgstr "Notification de fermeture reçue"
+
+msgid "Ticket expired"
+msgstr "Ticket expiré"
+
+msgid "Bad ticket"
+msgstr "Mauvais ticket"
+
+msgid "Unknown identity"
+msgstr "Identité inconnue"
+
+msgid "Bad certificate message in handshake"
+msgstr "Mauvais message de certificat dans l’initialisation"
+
+msgid "Bad certificate request message in handshake"
+msgstr "Mauvais message de demande de certificat dans l’initialisation"
+
+msgid "Bad certificate verify message in handshake"
+msgstr "Mauvais message de vérification de certificat dans l’initialisation"
+
+msgid "Bad change cipher message in handshake"
+msgstr "Mauvais message de modification d’algorithme dans l’initialisation"
+
+msgid "Bad client hello message in handshake"
+msgstr "Mauvais message de salut du client dans l’initialisation"
+
+msgid "Bad server hello message in handshake"
+msgstr "Mauvais message de salut du serveur dans l’initialisation"
+
+msgid "Bad server hello done message in handshake"
+msgstr "Mauvais message de fin de salut du serveur dans l’initialisation"
+
+msgid "Bad finished message in handshake"
+msgstr "Mauvais message fini dans l’initialisation"
+
+msgid "Bad server key exchange message in handshake"
+msgstr "Mauvais message d’échange de clef du serveur dans l’initialisation"
+
+msgid "Bad client key exchange message in handshake"
+msgstr "Mauvais message d’échange de clef du client dans l’initialisation"
+
+msgid "Bogus string"
+msgstr "Chaîne erronée"
+
+msgid "Forbidden"
+msgstr ""
+
+msgid "Key disabled"
+msgstr "Clef désactivée"
+
+msgid "Not possible with a card based key"
+msgstr "Impossible avec une clef basée sur carte"
+
+msgid "Invalid lock object"
+msgstr "Objet de verrouillage incorrect"
+
+msgid "True"
+msgstr ""
+
+msgid "False"
+msgstr ""
+
+msgid "General IPC error"
+msgstr "Erreur générale IPC"
+
+msgid "IPC accept call failed"
+msgstr "Échec de l'appel IPC accept"
+
+msgid "IPC connect call failed"
+msgstr "Échec de l'appel IPC connect"
+
+msgid "Invalid IPC response"
+msgstr "Réponse IPC incorrecte"
+
+msgid "Invalid value passed to IPC"
+msgstr "Valeur incorrecte passée à IPC"
+
+msgid "Incomplete line passed to IPC"
+msgstr "Ligne incomplète transmise à IPC"
+
+msgid "Line passed to IPC too long"
+msgstr "Ligne trop longue transmise à IPC"
+
+msgid "Nested IPC commands"
+msgstr "Commandes IPC imbriquées"
+
+msgid "No data callback in IPC"
+msgstr "Aucune donnée de rappel dans IPC"
+
+msgid "No inquire callback in IPC"
+msgstr "Aucune requête de rappel dans IPC"
+
+msgid "Not an IPC server"
+msgstr "Pas un serveur IPC"
+
+msgid "Not an IPC client"
+msgstr "Pas un client IPC"
+
+msgid "Problem starting IPC server"
+msgstr "Problème au démarrage du serveur IPC"
+
+msgid "IPC read error"
+msgstr "Erreur de lecture IPC"
+
+msgid "IPC write error"
+msgstr "Erreur d'écriture IPC"
+
+msgid "Too much data for IPC layer"
+msgstr "Trop de données pour la couche IPC"
+
+msgid "Unexpected IPC command"
+msgstr "Commande IPC inattendue"
+
+msgid "Unknown IPC command"
+msgstr "Commande IPC inconnue"
+
+msgid "IPC syntax error"
+msgstr "Erreur de syntaxe IPC"
+
+msgid "IPC call has been cancelled"
+msgstr "L'appel IPC a été annulé"
+
+msgid "No input source for IPC"
+msgstr "Aucune source d'entrée pour IPC"
+
+msgid "No output source for IPC"
+msgstr "Aucune source de sortie pour IPC"
+
+msgid "IPC parameter error"
+msgstr "Erreur de paramètre IPC"
+
+msgid "Unknown IPC inquire"
+msgstr "Requête IPC inconnue"
+
+#, fuzzy
+#| msgid "No crypto engine"
+msgid "Crypto engine too old"
+msgstr "Aucun moteur de chiffrement"
+
+msgid "Screen or window too small"
+msgstr ""
+
+msgid "Screen or window too large"
+msgstr ""
+
+msgid "Required environment variable not set"
+msgstr ""
+
+msgid "User ID already exists"
+msgstr ""
+
+msgid "Name already exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated name"
+msgstr "Valeur dupliquée"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Object is too young"
+msgstr "Certificat trop récent"
+
+#, fuzzy
+#| msgid "Provided object is too short"
+msgid "Object is too old"
+msgstr "L'objet fourni est trop petit"
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Unknown flag"
+msgstr "Nom inconnu"
+
+#, fuzzy
+#| msgid "Invalid operation code"
+msgid "Invalid execution order"
+msgstr "Code d'opération incorrect"
+
+msgid "Already fetched"
+msgstr ""
+
+msgid "Try again later"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Wrong name"
+msgstr "Nom inconnu"
+
+msgid "System bug detected"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown system error"
+msgid "Unknown DNS error"
+msgstr "Erreur système inconnue"
+
+#, fuzzy
+#| msgid "Invalid OID string"
+msgid "Invalid DNS section"
+msgstr "Chaîne OID incorrecte"
+
+#, fuzzy
+#| msgid "Invalid S-expression"
+msgid "Invalid textual address form"
+msgstr "Expression symbolique incorrecte"
+
+#, fuzzy
+#| msgid "Missing issuer certificate"
+msgid "Missing DNS query packet"
+msgstr "Certificat de l'émetteur manquant"
+
+msgid "Missing DNS answer packet"
+msgstr ""
+
+msgid "Connection closed in DNS"
+msgstr ""
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "Verification failed in DNS"
+msgstr "Échec de déchiffrement"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "DNS Timeout"
+msgstr "Délai d'attente dépassé"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "General LDAP error"
+msgstr "Erreur générale IPC"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP attribute error"
+msgstr "Erreur générale"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP name error"
+msgstr "Erreur générale"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP security error"
+msgstr "Erreur générale Assuan"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP service error"
+msgstr "Erreur générale"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP update error"
+msgstr "Erreur générale Assuan"
+
+msgid "Experimental LDAP error code"
+msgstr ""
+
+#, fuzzy
+#| msgid "IPC write error"
+msgid "Private LDAP error code"
+msgstr "Erreur d'écriture IPC"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other general LDAP error"
+msgstr "Erreur générale IPC"
+
+#, fuzzy
+#| msgid "IPC connect call failed"
+msgid "LDAP connecting failed (X)"
+msgstr "Échec de l'appel IPC connect"
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral limit exceeded"
+msgstr "Erreur générale"
+
+msgid "LDAP client loop"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "No LDAP results returned"
+msgstr "Réinitialisation de la carte nécessaire"
+
+#, fuzzy
+#| msgid "Element not found"
+msgid "LDAP control not found"
+msgstr "Élément non trouvé"
+
+#, fuzzy
+#| msgid "Not supported"
+msgid "Not supported by LDAP"
+msgstr "Non pris en charge"
+
+#, fuzzy
+#| msgid "Unexpected error"
+msgid "LDAP connect error"
+msgstr "Erreur inattendue"
+
+msgid "Out of memory in LDAP"
+msgstr ""
+
+msgid "Bad parameter to an LDAP routine"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported operation"
+msgid "User cancelled LDAP operation"
+msgstr "Opération non prise en charge"
+
+#, fuzzy
+#| msgid "Bad certificate"
+msgid "Bad LDAP search filter"
+msgstr "Mauvais certificat"
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "Unknown LDAP authentication method"
+msgstr "Extension inconnue"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "Timeout in LDAP"
+msgstr "Délai d'attente dépassé"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP decoding error"
+msgstr "Erreur de dirmngr"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP encoding error"
+msgstr "Erreur de dirmngr"
+
+#, fuzzy
+#| msgid "IPC read error"
+msgid "LDAP local error"
+msgstr "Erreur de lecture IPC"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot contact LDAP server"
+msgstr "Pas un serveur IPC"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP success"
+msgstr "Réussite"
+
+#, fuzzy
+#| msgid "Configuration error"
+msgid "LDAP operations error"
+msgstr "Erreur de configuration"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP protocol error"
+msgstr "Violation de protocole"
+
+msgid "Time limit exceeded in LDAP"
+msgstr ""
+
+msgid "Size limit exceeded in LDAP"
+msgstr ""
+
+msgid "LDAP compare false"
+msgstr ""
+
+msgid "LDAP compare true"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "LDAP authentication method not supported"
+msgstr "Extension inconnue"
+
+msgid "Strong(er) LDAP authentication required"
+msgstr ""
+
+#, fuzzy
+#| msgid "Fatal alert message received"
+msgid "Partial LDAP results+referral received"
+msgstr "Message d’alerte fatale reçu"
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral"
+msgstr "Erreur générale"
+
+msgid "Administrative LDAP limit exceeded"
+msgstr ""
+
+msgid "Critical LDAP extension is unavailable"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Confidentiality required by LDAP"
+msgstr "Réinitialisation de la carte nécessaire"
+
+msgid "LDAP SASL bind in progress"
+msgstr ""
+
+msgid "No such LDAP attribute"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid attribute"
+msgid "Undefined LDAP attribute type"
+msgstr "Attribut incorrect"
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate matching in LDAP"
+msgstr "Protection non prise en charge"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Constraint violation in LDAP"
+msgstr "Violation de protocole"
+
+msgid "LDAP type or value exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid syntax in LDAP"
+msgstr "État incorrect"
+
+#, fuzzy
+#| msgid "No CMS object"
+msgid "No such LDAP object"
+msgstr "Pas d'objet CMS"
+
+#, fuzzy
+#| msgid "Hardware problem"
+msgid "LDAP alias problem"
+msgstr "Problème matériel"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid DN syntax in LDAP"
+msgstr "État incorrect"
+
+msgid "LDAP entry is a leaf"
+msgstr ""
+
+#, fuzzy
+#| msgid "Encoding problem"
+msgid "LDAP alias dereferencing problem"
+msgstr "Problème d'encodage"
+
+msgid "LDAP proxy authorization failure (X)"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate LDAP authentication"
+msgstr "Protection non prise en charge"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid LDAP credentials"
+msgstr "Carte incorrecte"
+
+msgid "Insufficient access for LDAP"
+msgstr ""
+
+msgid "LDAP server is busy"
+msgstr ""
+
+#, fuzzy
+#| msgid "No keyserver available"
+msgid "LDAP server is unavailable"
+msgstr "Aucun serveur de clefs disponible"
+
+msgid "LDAP server is unwilling to perform"
+msgstr ""
+
+msgid "Loop detected by LDAP"
+msgstr ""
+
+#, fuzzy
+#| msgid "Missing action"
+msgid "LDAP naming violation"
+msgstr "Action manquante"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP object class violation"
+msgstr "Violation de protocole"
+
+#, fuzzy
+#| msgid "Operation not yet finished"
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "L'opération n'est pas encore terminée"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation not allowed on RDN"
+msgstr "Opération annulée"
+
+msgid "Already exists (LDAP)"
+msgstr ""
+
+msgid "Cannot modify LDAP object class"
+msgstr ""
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "LDAP results too large"
+msgstr "Ligne trop longue"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation affects multiple DSAs"
+msgstr "Opération annulée"
+
+msgid "Virtual LDAP list view error"
+msgstr ""
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other LDAP error"
+msgstr "Erreur générale IPC"
+
+#, fuzzy
+#| msgid "Resources exhausted"
+msgid "Resources exhausted in LCUP"
+msgstr "Ressources épuisées"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Security violation in LCUP"
+msgstr "Violation de protocole"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid data in LCUP"
+msgstr "État incorrect"
+
+#, fuzzy
+#| msgid "Unsupported certificate"
+msgid "Unsupported scheme in LCUP"
+msgstr "Certificat non pris en charge"
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Reload required in LCUP"
+msgstr "Réinitialisation de la carte nécessaire"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP cancelled"
+msgstr "Réussite"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "No LDAP operation to cancel"
+msgstr "Non opérationnel"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "Too late to cancel LDAP"
+msgstr "Non opérationnel"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot cancel LDAP"
+msgstr "Pas un serveur IPC"
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "LDAP assertion failed"
+msgstr "Échec de déchiffrement"
+
+msgid "Proxied authorization denied by LDAP"
+msgstr ""
+
+msgid "User defined error code 1"
+msgstr "Code d'erreur 1 défini par l'utilisateur"
+
+msgid "User defined error code 2"
+msgstr "Code d'erreur 2 défini par l'utilisateur"
+
+msgid "User defined error code 3"
+msgstr "Code d'erreur 3 défini par l'utilisateur"
+
+msgid "User defined error code 4"
+msgstr "Code d'erreur 4 défini par l'utilisateur"
+
+msgid "User defined error code 5"
+msgstr "Code d'erreur 5 défini par l'utilisateur"
+
+msgid "User defined error code 6"
+msgstr "Code d'erreur 6 défini par l'utilisateur"
+
+msgid "User defined error code 7"
+msgstr "Code d'erreur 7 défini par l'utilisateur"
+
+msgid "User defined error code 8"
+msgstr "Code d'erreur 8 défini par l'utilisateur"
+
+msgid "User defined error code 9"
+msgstr "Code d'erreur 9 défini par l'utilisateur"
+
+msgid "User defined error code 10"
+msgstr "Code d'erreur 10 défini par l'utilisateur"
+
+msgid "User defined error code 11"
+msgstr "Code d'erreur 11 défini par l'utilisateur"
+
+msgid "User defined error code 12"
+msgstr "Code d'erreur 12 défini par l'utilisateur"
+
+msgid "User defined error code 13"
+msgstr "Code d'erreur 13 défini par l'utilisateur"
+
+msgid "User defined error code 14"
+msgstr "Code d'erreur 14 défini par l'utilisateur"
+
+msgid "User defined error code 15"
+msgstr "Code d'erreur 15 défini par l'utilisateur"
+
+msgid "User defined error code 16"
+msgstr "Code d'erreur 16 défini par l'utilisateur"
+
+msgid "System error w/o errno"
+msgstr "Erreur système sans numéro"
+
+msgid "Unknown system error"
+msgstr "Erreur système inconnue"
+
+msgid "End of file"
+msgstr "Fin de fichier"
+
+msgid "Unknown error code"
+msgstr "Code d'erreur inconnu"
+
+#, c-format
+msgid "Usage: %s GPG-ERROR [...]\n"
+msgstr "Utilisation : %s GPG-ERROR [...]\n"
+
+#, c-format
+msgid "%s: warning: could not recognize %s\n"
+msgstr "%s : attention : impossible de reconnaître %s\n"
+
+#, fuzzy
+#~| msgid "Resources exhausted"
+#~ msgid "LCUP Resources exhausted"
+#~ msgstr "Ressources épuisées"
+
+#, fuzzy
+#~| msgid "Invalid data"
+#~ msgid "LCUP Invalid data"
+#~ msgstr "Données incorrectes"
+
+#, fuzzy
+#~| msgid "General error"
+#~ msgid "LDAP Other general error"
+#~ msgstr "Erreur générale"
+
+#, fuzzy
+#~| msgid "dirmngr error"
+#~ msgid "Encoding error"
+#~ msgstr "Erreur de dirmngr"
diff --git a/po/hu.po b/po/hu.po
new file mode 100644
index 0000000..82f7098
--- /dev/null
+++ b/po/hu.po
@@ -0,0 +1,1527 @@
+# Hungarian translations of libgpg-error.
+# Copyright (C) 2015 Free Software Foundation, Inc.
+# This file is distributed under the same license as the libgpg-error package.
+#
+# Balázs Úr <[email protected]>, 2015.
+msgid ""
+msgstr ""
+"Project-Id-Version: libgpg-error-1.7\n"
+"Report-Msgid-Bugs-To: [email protected]\n"
+"PO-Revision-Date: 2015-01-09 10:00+0100\n"
+"Last-Translator: Balázs Úr <[email protected]>\n"
+"Language-Team: Hungarian <[email protected]>\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Lokalize 1.2\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgid "Unspecified source"
+msgstr "Meghatározatlan forrás"
+
+msgid "gcrypt"
+msgstr "gcrypt"
+
+msgid "GnuPG"
+msgstr "GnuPG"
+
+msgid "GpgSM"
+msgstr "GpgSM"
+
+msgid "GPG Agent"
+msgstr "GPG ügynök"
+
+msgid "Pinentry"
+msgstr "Pinentry"
+
+msgid "SCD"
+msgstr "SCD"
+
+msgid "GPGME"
+msgstr "GPGME"
+
+msgid "Keybox"
+msgstr "Keybox"
+
+msgid "KSBA"
+msgstr "KSBA"
+
+msgid "Dirmngr"
+msgstr "Dirmngr"
+
+msgid "GSTI"
+msgstr "GSTI"
+
+msgid "GPA"
+msgstr "GPA"
+
+msgid "Kleopatra"
+msgstr "Kleopatra"
+
+msgid "G13"
+msgstr ""
+
+msgid "Assuan"
+msgstr ""
+
+msgid "TLS"
+msgstr ""
+
+msgid "Any source"
+msgstr "Bármilyen forrás"
+
+msgid "User defined source 1"
+msgstr "1. felhasználó által megadott forrás"
+
+msgid "User defined source 2"
+msgstr "2. felhasználó által megadott forrás"
+
+msgid "User defined source 3"
+msgstr "3. felhasználó által megadott forrás"
+
+msgid "User defined source 4"
+msgstr "4. felhasználó által megadott forrás"
+
+msgid "Unknown source"
+msgstr "Ismeretlen forrás"
+
+msgid "Success"
+msgstr "Sikeres"
+
+msgid "General error"
+msgstr "Általános hiba"
+
+msgid "Unknown packet"
+msgstr "Ismeretlen csomag"
+
+msgid "Unknown version in packet"
+msgstr "Ismeretlen verzió a csomagban"
+
+msgid "Invalid public key algorithm"
+msgstr "Érvénytelen nyilvános kulcs algoritmus"
+
+msgid "Invalid digest algorithm"
+msgstr "Érvénytelen kivonat algoritmus"
+
+msgid "Bad public key"
+msgstr "Rossz nyilvános kulcs"
+
+msgid "Bad secret key"
+msgstr "Rossz titkos kulcs"
+
+msgid "Bad signature"
+msgstr "Rossz aláírás"
+
+msgid "No public key"
+msgstr "Nincs nyilvános kulcs"
+
+msgid "Checksum error"
+msgstr "Ellenőrzőösszeg hiba"
+
+msgid "Bad passphrase"
+msgstr "Rossz jelmondat"
+
+msgid "Invalid cipher algorithm"
+msgstr "Érvénytelen titkosító algoritmus"
+
+msgid "Cannot open keyring"
+msgstr "Kulcstartó nyitva"
+
+msgid "Invalid packet"
+msgstr "Érvénytelen csomag"
+
+msgid "Invalid armor"
+msgstr "Érvénytelen páncél"
+
+msgid "No user ID"
+msgstr "Nincs felhasználóazonosító"
+
+msgid "No secret key"
+msgstr "Nincs titkos kulcs"
+
+msgid "Wrong secret key used"
+msgstr "Hibás titkos kulcs lett használva"
+
+msgid "Bad session key"
+msgstr "Rossz munkamenet kulcs"
+
+msgid "Unknown compression algorithm"
+msgstr "Ismeretlen tömörítő algoritmus"
+
+msgid "Number is not prime"
+msgstr "A szám nem prím"
+
+msgid "Invalid encoding method"
+msgstr "Érvénytelen kódolási módszer"
+
+msgid "Invalid encryption scheme"
+msgstr "Érvénytelen titkosítás séma"
+
+msgid "Invalid signature scheme"
+msgstr "Érvénytelen aláírás séma"
+
+msgid "Invalid attribute"
+msgstr "Érvénytelen attribútum"
+
+msgid "No value"
+msgstr "Nincs érték"
+
+msgid "Not found"
+msgstr "Nem található"
+
+msgid "Value not found"
+msgstr "Nem található érték"
+
+msgid "Syntax error"
+msgstr "Szintaktikai hiba"
+
+msgid "Bad MPI value"
+msgstr "Rossz MPI érték"
+
+msgid "Invalid passphrase"
+msgstr "Érvénytelen jelmondat"
+
+msgid "Invalid signature class"
+msgstr "Érvénytelen aláírás osztály"
+
+msgid "Resources exhausted"
+msgstr "Az erőforrások kimerültek"
+
+msgid "Invalid keyring"
+msgstr "Érvénytelen kulcstartó"
+
+msgid "Trust DB error"
+msgstr "Megbízhatósági adatbázis hiba"
+
+msgid "Bad certificate"
+msgstr "Rossz tanúsítvány"
+
+msgid "Invalid user ID"
+msgstr "Érvénytelen felhasználóazonosító"
+
+msgid "Unexpected error"
+msgstr "Váratlan hiba"
+
+msgid "Time conflict"
+msgstr "Időütközés"
+
+msgid "Keyserver error"
+msgstr "Kulcskiszolgáló hiba"
+
+msgid "Wrong public key algorithm"
+msgstr "Hibás nyilvános kulcs algoritmus"
+
+msgid "Tribute to D. A."
+msgstr "Sarc a D. A. részére"
+
+msgid "Weak encryption key"
+msgstr "Gyenge titkosítási kulcs"
+
+msgid "Invalid key length"
+msgstr "Érvénytelen kulcshossz"
+
+msgid "Invalid argument"
+msgstr "Érvénytelen argumentum"
+
+msgid "Syntax error in URI"
+msgstr "Szintaktikai hiba az URI-ban"
+
+msgid "Invalid URI"
+msgstr "Érvénytelen URI"
+
+msgid "Network error"
+msgstr "Hálózati hiba"
+
+msgid "Unknown host"
+msgstr "Ismeretlen gép"
+
+msgid "Selftest failed"
+msgstr "Önellenőrzés sikertelen"
+
+msgid "Data not encrypted"
+msgstr "Az adatok nincsenek titkosítva"
+
+msgid "Data not processed"
+msgstr "Az adatok nincsenek feldolgozva"
+
+msgid "Unusable public key"
+msgstr "Használhatatlan nyilvános kulcs"
+
+msgid "Unusable secret key"
+msgstr "Használhatatlan titkos kulcs"
+
+msgid "Invalid value"
+msgstr "Érvénytelen érték"
+
+msgid "Bad certificate chain"
+msgstr "Rossz tanúsítványlánc"
+
+msgid "Missing certificate"
+msgstr "Hiányzó tanúsítvány"
+
+msgid "No data"
+msgstr "Nincsenek adatok"
+
+msgid "Bug"
+msgstr "Hiba"
+
+msgid "Not supported"
+msgstr "Nem támogatott"
+
+msgid "Invalid operation code"
+msgstr "Érvénytelen műveletkód"
+
+msgid "Timeout"
+msgstr "Időtúllépés"
+
+msgid "Internal error"
+msgstr "Belső hiba"
+
+msgid "EOF (gcrypt)"
+msgstr "EOF (gcrypt)"
+
+msgid "Invalid object"
+msgstr "Érvénytelen objektum"
+
+msgid "Provided object is too short"
+msgstr "A megadott objektum túl kicsi"
+
+msgid "Provided object is too large"
+msgstr "A megadott objektum túl nagy"
+
+msgid "Missing item in object"
+msgstr "Hiányzó elem az objektumban"
+
+msgid "Not implemented"
+msgstr "Nincs megvalósítva"
+
+msgid "Conflicting use"
+msgstr "Ütköző használat"
+
+msgid "Invalid cipher mode"
+msgstr "Érvénytelen titkosító mód"
+
+msgid "Invalid flag"
+msgstr "Érvénytelen jelző"
+
+msgid "Invalid handle"
+msgstr "Érvénytelen leíró"
+
+msgid "Result truncated"
+msgstr "Az eredmény csonkított"
+
+msgid "Incomplete line"
+msgstr "Befejezetlen sor"
+
+msgid "Invalid response"
+msgstr "Érvénytelen válasz"
+
+msgid "No agent running"
+msgstr "Nincs futó ügynök"
+
+#, fuzzy
+#| msgid "agent error"
+msgid "Agent error"
+msgstr "ügynökhiba"
+
+msgid "Invalid data"
+msgstr "Érvénytelen adatok"
+
+msgid "Unspecific Assuan server fault"
+msgstr "Nem specifikus Assuan kiszolgáló hiba"
+
+msgid "General Assuan error"
+msgstr "Általános Assuan hiba"
+
+msgid "Invalid session key"
+msgstr "Érvénytelen munkamenet kulcs"
+
+msgid "Invalid S-expression"
+msgstr "Érvénytelen S-kifejezés"
+
+msgid "Unsupported algorithm"
+msgstr "Nem támogatott algoritmus "
+
+msgid "No pinentry"
+msgstr "Nincs pinentry"
+
+msgid "pinentry error"
+msgstr "pinentry hiba"
+
+msgid "Bad PIN"
+msgstr "Rossz PIN-kód"
+
+msgid "Invalid name"
+msgstr "Érvénytelen név"
+
+msgid "Bad data"
+msgstr "Rossz adatok"
+
+msgid "Invalid parameter"
+msgstr "Érvénytelen paraméter"
+
+msgid "Wrong card"
+msgstr "Hibás kártya"
+
+msgid "No dirmngr"
+msgstr "Nincs dirmngr"
+
+msgid "dirmngr error"
+msgstr "dirmngr hiba"
+
+msgid "Certificate revoked"
+msgstr "Tanúsítvány visszavonva"
+
+msgid "No CRL known"
+msgstr "Nincs ismert CRL"
+
+msgid "CRL too old"
+msgstr "Túl régi CRL"
+
+msgid "Line too long"
+msgstr "Túl hosszú sor"
+
+msgid "Not trusted"
+msgstr "Nem megbízható"
+
+msgid "Operation cancelled"
+msgstr "A művelet megszakítva"
+
+msgid "Bad CA certificate"
+msgstr "Rossz CA tanúsítvány"
+
+msgid "Certificate expired"
+msgstr "A tanúsítvány lejárt"
+
+msgid "Certificate too young"
+msgstr "Túl fiatal tanúsítvány"
+
+msgid "Unsupported certificate"
+msgstr "Nem támogatott tanúsítvány"
+
+msgid "Unknown S-expression"
+msgstr "Ismeretlen S-kifejezés"
+
+msgid "Unsupported protection"
+msgstr "Nem támogatott védelem"
+
+msgid "Corrupted protection"
+msgstr "Sérült védelem"
+
+msgid "Ambiguous name"
+msgstr "Nem egyértelmű név"
+
+msgid "Card error"
+msgstr "Kártyahiba"
+
+msgid "Card reset required"
+msgstr "Kártya visszaállítás szükséges"
+
+msgid "Card removed"
+msgstr "Kártya eltávolítva"
+
+msgid "Invalid card"
+msgstr "Érvénytelen kártya"
+
+msgid "Card not present"
+msgstr "A kártya nincs jelen"
+
+msgid "No PKCS15 application"
+msgstr "Nincs PKCS15 alkalmazás"
+
+msgid "Not confirmed"
+msgstr "Nem megerősített"
+
+msgid "Configuration error"
+msgstr "Beállítási hiba"
+
+msgid "No policy match"
+msgstr "Nincs egyező házirend"
+
+msgid "Invalid index"
+msgstr "Érvénytelen index"
+
+msgid "Invalid ID"
+msgstr "Érvénytelen azonosító"
+
+msgid "No SmartCard daemon"
+msgstr "Nincs SmartCard démon"
+
+msgid "SmartCard daemon error"
+msgstr "SmartCard démon hiba"
+
+msgid "Unsupported protocol"
+msgstr "Nem támogatott protokoll"
+
+msgid "Bad PIN method"
+msgstr "Rossz PIN-kód módszer"
+
+msgid "Card not initialized"
+msgstr "A kártya nincs előkészítve"
+
+msgid "Unsupported operation"
+msgstr "Nem támogatott művelet"
+
+msgid "Wrong key usage"
+msgstr "Hibás kulcshasználat"
+
+msgid "Nothing found"
+msgstr "Semmi sem található"
+
+msgid "Wrong blob type"
+msgstr "Hibás blob típus"
+
+msgid "Missing value"
+msgstr "Hiányzó érték"
+
+msgid "Hardware problem"
+msgstr "Hardverprobléma"
+
+msgid "PIN blocked"
+msgstr "PIN-kód blokkolva"
+
+msgid "Conditions of use not satisfied"
+msgstr "A használati feltételek nem teljesülnek"
+
+msgid "PINs are not synced"
+msgstr "A PIN-kódok nincsenek szinkronizálva"
+
+msgid "Invalid CRL"
+msgstr "Érvénytelen CRL"
+
+msgid "BER error"
+msgstr "BER hiba"
+
+msgid "Invalid BER"
+msgstr "Érvénytelen BER"
+
+msgid "Element not found"
+msgstr "Az elem nem található"
+
+msgid "Identifier not found"
+msgstr "Az azonosító nem található"
+
+msgid "Invalid tag"
+msgstr "Érvénytelen címke"
+
+msgid "Invalid length"
+msgstr "Érvénytelen hossz"
+
+msgid "Invalid key info"
+msgstr "Érvénytelen kulcsinformációk"
+
+msgid "Unexpected tag"
+msgstr "Váratlan címke"
+
+msgid "Not DER encoded"
+msgstr "Nem DER kódolású"
+
+msgid "No CMS object"
+msgstr "Nincs CMS objektum"
+
+msgid "Invalid CMS object"
+msgstr "Érvénytelen CMS objektum"
+
+msgid "Unknown CMS object"
+msgstr "Ismeretlen CMS objektum"
+
+msgid "Unsupported CMS object"
+msgstr "Nem támogatott CMS objektum"
+
+msgid "Unsupported encoding"
+msgstr "Nem támogatott kódolás"
+
+msgid "Unsupported CMS version"
+msgstr "Nem támogatott CMS verzió"
+
+msgid "Unknown algorithm"
+msgstr "Ismeretlen algoritmus"
+
+msgid "Invalid crypto engine"
+msgstr "Érvénytelen titkosítási motor"
+
+msgid "Public key not trusted"
+msgstr "A nyilvános kulcs nem megbízható"
+
+msgid "Decryption failed"
+msgstr "Visszafejtés sikertelen"
+
+msgid "Key expired"
+msgstr "A kulcs lejárt"
+
+msgid "Signature expired"
+msgstr "Az aláírás lejárt"
+
+msgid "Encoding problem"
+msgstr "Kódolási probléma"
+
+msgid "Invalid state"
+msgstr "Érvénytelen állapot"
+
+msgid "Duplicated value"
+msgstr "Kettőzött érték"
+
+msgid "Missing action"
+msgstr "Hiányzó művelet"
+
+msgid "ASN.1 module not found"
+msgstr "Nem található ASN.1 modul"
+
+msgid "Invalid OID string"
+msgstr "Érvénytelen OID karakterlánc"
+
+msgid "Invalid time"
+msgstr "Érvénytelen időpont"
+
+msgid "Invalid CRL object"
+msgstr "Érvénytelen CRL objektum"
+
+msgid "Unsupported CRL version"
+msgstr "Nem támogatott CRL verzió"
+
+msgid "Invalid certificate object"
+msgstr "Érvénytelen tanúsítványobjektum"
+
+msgid "Unknown name"
+msgstr "Ismeretlen név"
+
+msgid "A locale function failed"
+msgstr "Egy területi beállítás függvény meghiúsult"
+
+msgid "Not locked"
+msgstr "Nincs zárolva"
+
+msgid "Protocol violation"
+msgstr "Protokollsértés"
+
+msgid "Invalid MAC"
+msgstr "Érvénytelen MAC"
+
+msgid "Invalid request"
+msgstr "Érvénytelen kérés"
+
+msgid "Unknown extension"
+msgstr "Ismeretlen kiterjesztés"
+
+msgid "Unknown critical extension"
+msgstr "Ismeretlen kritikus kiterjesztés"
+
+msgid "Locked"
+msgstr "Zárolva"
+
+msgid "Unknown option"
+msgstr "Ismeretlen kapcsoló"
+
+msgid "Unknown command"
+msgstr "Ismeretlen parancs"
+
+msgid "Not operational"
+msgstr "Nem működik"
+
+msgid "No passphrase given"
+msgstr "Nincs jelmondat megadva"
+
+msgid "No PIN given"
+msgstr "Nincs PIN-kód megadva"
+
+#, fuzzy
+#| msgid "Not locked"
+msgid "Not enabled"
+msgstr "Nincs zárolva"
+
+#, fuzzy
+#| msgid "Invalid crypto engine"
+msgid "No crypto engine"
+msgstr "Érvénytelen titkosítási motor"
+
+#, fuzzy
+#| msgid "Missing value"
+msgid "Missing key"
+msgstr "Hiányzó érték"
+
+#, fuzzy
+#| msgid "No CMS object"
+msgid "Too many objects"
+msgstr "Nincs CMS objektum"
+
+msgid "Limit reached"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card not initialized"
+msgid "Not initialized"
+msgstr "A kártya nincs előkészítve"
+
+#, fuzzy
+#| msgid "Missing certificate"
+msgid "Missing issuer certificate"
+msgstr "Hiányzó tanúsítvány"
+
+msgid "No keyserver available"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid time"
+msgid "Invalid elliptic curve"
+msgstr "Érvénytelen időpont"
+
+#, fuzzy
+#| msgid "Unknown source"
+msgid "Unknown elliptic curve"
+msgstr "Ismeretlen forrás"
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated key"
+msgstr "Kettőzött érték"
+
+#, fuzzy
+#| msgid "Ambiguous name"
+msgid "Ambiguous result"
+msgstr "Nem egyértelmű név"
+
+msgid "No crypto context"
+msgstr ""
+
+msgid "Wrong crypto context"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid crypto engine"
+msgid "Bad crypto context"
+msgstr "Érvénytelen titkosítási motor"
+
+msgid "Conflict in the crypto context"
+msgstr ""
+
+#, fuzzy
+#| msgid "No public key"
+msgid "Broken public key"
+msgstr "Nincs nyilvános kulcs"
+
+#, fuzzy
+#| msgid "No secret key"
+msgid "Broken secret key"
+msgstr "Nincs titkos kulcs"
+
+#, fuzzy
+#| msgid "Invalid digest algorithm"
+msgid "Invalid MAC algorithm"
+msgstr "Érvénytelen kivonat algoritmus"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "Operation fully cancelled"
+msgstr "A művelet megszakítva"
+
+msgid "Operation not yet finished"
+msgstr "A művelet még nem fejeződött be"
+
+msgid "Buffer too short"
+msgstr "Túl rövid puffer"
+
+msgid "Invalid length specifier in S-expression"
+msgstr "Érvénytelen hosszmegadó az S-kifejezésben"
+
+msgid "String too long in S-expression"
+msgstr "Túl hosszú karakterlánc az S-kifejezésben"
+
+msgid "Unmatched parentheses in S-expression"
+msgstr "Lezáratlan zárójelek az S-kifejezésben"
+
+msgid "S-expression not canonical"
+msgstr "Az S-kifejezés nem hitelesnek elismert"
+
+msgid "Bad character in S-expression"
+msgstr "Rossz karakter az S-kifejezésben"
+
+msgid "Bad quotation in S-expression"
+msgstr "Rossz idézés az S-kifejezésben"
+
+msgid "Zero prefix in S-expression"
+msgstr "Nulla előtag az S-kifejezésben"
+
+msgid "Nested display hints in S-expression"
+msgstr "Beágyazott megjelenítési tippek az S-kifejezésben"
+
+msgid "Unmatched display hints"
+msgstr "Nem egyező megjelenítési tippek"
+
+msgid "Unexpected reserved punctuation in S-expression"
+msgstr "Váratlan fenntartott központozás az S-kifejezésben"
+
+msgid "Bad hexadecimal character in S-expression"
+msgstr "Rossz hexadecimális karakter az S-kifejezésben"
+
+msgid "Odd hexadecimal numbers in S-expression"
+msgstr "Páratlan hexadecimális számok az S-kifejezésben"
+
+#, fuzzy
+#| msgid "Bad octadecimal character in S-expression"
+msgid "Bad octal character in S-expression"
+msgstr "Rossz oktadecimális karakter az S-kifejezésben"
+
+msgid "All subkeys are expired or revoked"
+msgstr ""
+
+#, fuzzy
+#| msgid "Data not encrypted"
+msgid "Database is corrupted"
+msgstr "Az adatok nincsenek titkosítva"
+
+msgid "Server indicated a failure"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "No name"
+msgstr "Ismeretlen név"
+
+#, fuzzy
+#| msgid "No public key"
+msgid "No key"
+msgstr "Nincs nyilvános kulcs"
+
+msgid "Legacy key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Buffer too short"
+msgid "Request too short"
+msgstr "Túl rövid puffer"
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "Request too long"
+msgstr "Túl hosszú sor"
+
+msgid "Object is in termination state"
+msgstr ""
+
+#, fuzzy
+#| msgid "Bad certificate chain"
+msgid "No certificate chain"
+msgstr "Rossz tanúsítványlánc"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Certificate is too large"
+msgstr "Túl fiatal tanúsítvány"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid record"
+msgstr "Érvénytelen kártya"
+
+msgid "The MAC does not verify"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unexpected tag"
+msgid "Unexpected message"
+msgstr "Váratlan címke"
+
+msgid "Compression or decompression failed"
+msgstr ""
+
+msgid "A counter would wrap"
+msgstr ""
+
+msgid "Fatal alert message received"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid cipher algorithm"
+msgid "No cipher algorithm"
+msgstr "Érvénytelen titkosító algoritmus"
+
+#, fuzzy
+#| msgid "Missing certificate"
+msgid "Missing client certificate"
+msgstr "Hiányzó tanúsítvány"
+
+#, fuzzy
+#| msgid "Certificate revoked"
+msgid "Close notification received"
+msgstr "Tanúsítvány visszavonva"
+
+#, fuzzy
+#| msgid "Key expired"
+msgid "Ticket expired"
+msgstr "A kulcs lejárt"
+
+#, fuzzy
+#| msgid "Bad public key"
+msgid "Bad ticket"
+msgstr "Rossz nyilvános kulcs"
+
+#, fuzzy
+#| msgid "Unknown packet"
+msgid "Unknown identity"
+msgstr "Ismeretlen csomag"
+
+#, fuzzy
+#| msgid "Bad certificate chain"
+msgid "Bad certificate message in handshake"
+msgstr "Rossz tanúsítványlánc"
+
+msgid "Bad certificate request message in handshake"
+msgstr ""
+
+msgid "Bad certificate verify message in handshake"
+msgstr ""
+
+msgid "Bad change cipher message in handshake"
+msgstr ""
+
+msgid "Bad client hello message in handshake"
+msgstr ""
+
+msgid "Bad server hello message in handshake"
+msgstr ""
+
+msgid "Bad server hello done message in handshake"
+msgstr ""
+
+msgid "Bad finished message in handshake"
+msgstr ""
+
+msgid "Bad server key exchange message in handshake"
+msgstr ""
+
+msgid "Bad client key exchange message in handshake"
+msgstr ""
+
+msgid "Bogus string"
+msgstr ""
+
+msgid "Forbidden"
+msgstr ""
+
+#, fuzzy
+#| msgid "Key expired"
+msgid "Key disabled"
+msgstr "A kulcs lejárt"
+
+msgid "Not possible with a card based key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid object"
+msgid "Invalid lock object"
+msgstr "Érvénytelen objektum"
+
+msgid "True"
+msgstr ""
+
+msgid "False"
+msgstr ""
+
+msgid "General IPC error"
+msgstr "Általános IPC hiba"
+
+msgid "IPC accept call failed"
+msgstr "Az IPC elfogadási hívás meghiúsult"
+
+msgid "IPC connect call failed"
+msgstr "Az IPC kapcsolódási hívás meghiúsult"
+
+msgid "Invalid IPC response"
+msgstr "Érvénytelen IPC válasz"
+
+msgid "Invalid value passed to IPC"
+msgstr "Érvénytelen érték került átadásra az IPC-nek"
+
+msgid "Incomplete line passed to IPC"
+msgstr "Befejezetlen sor került átadásra az IPC-nek"
+
+msgid "Line passed to IPC too long"
+msgstr "Az IPC-nek átadott sor túl hosszú"
+
+msgid "Nested IPC commands"
+msgstr "Beágyazott IPC parancsok"
+
+msgid "No data callback in IPC"
+msgstr "Nincs adatvisszahívás az IPC-ben"
+
+msgid "No inquire callback in IPC"
+msgstr "Nincs érdeklődés visszahívás az IPC-ben"
+
+msgid "Not an IPC server"
+msgstr "Nem IPC kiszolgáló"
+
+msgid "Not an IPC client"
+msgstr "Nem IPC kliens"
+
+msgid "Problem starting IPC server"
+msgstr "Probléma adódott az IPC kiszolgáló indításakor"
+
+msgid "IPC read error"
+msgstr "IPC olvasási hiba"
+
+msgid "IPC write error"
+msgstr "IPC írási hiba"
+
+msgid "Too much data for IPC layer"
+msgstr "Túl sok adat az IPC réteghez"
+
+msgid "Unexpected IPC command"
+msgstr "Váratlan IPC parancs"
+
+msgid "Unknown IPC command"
+msgstr "Ismeretlen IPC parancs"
+
+msgid "IPC syntax error"
+msgstr "IPC szintaktikai hiba"
+
+msgid "IPC call has been cancelled"
+msgstr "Az IPC hívás megszakításra került"
+
+msgid "No input source for IPC"
+msgstr "Nincs bemeneti forrás az IPC-hez"
+
+msgid "No output source for IPC"
+msgstr "Nincs kimeneti forrás az IPC-hez"
+
+msgid "IPC parameter error"
+msgstr "IPC paraméterhiba"
+
+msgid "Unknown IPC inquire"
+msgstr "Ismeretlen IPC érdeklődés"
+
+#, fuzzy
+#| msgid "Invalid crypto engine"
+msgid "Crypto engine too old"
+msgstr "Érvénytelen titkosítási motor"
+
+msgid "Screen or window too small"
+msgstr ""
+
+msgid "Screen or window too large"
+msgstr ""
+
+msgid "Required environment variable not set"
+msgstr ""
+
+msgid "User ID already exists"
+msgstr ""
+
+msgid "Name already exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated name"
+msgstr "Kettőzött érték"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Object is too young"
+msgstr "Túl fiatal tanúsítvány"
+
+#, fuzzy
+#| msgid "Provided object is too short"
+msgid "Object is too old"
+msgstr "A megadott objektum túl kicsi"
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Unknown flag"
+msgstr "Ismeretlen név"
+
+#, fuzzy
+#| msgid "Invalid operation code"
+msgid "Invalid execution order"
+msgstr "Érvénytelen műveletkód"
+
+msgid "Already fetched"
+msgstr ""
+
+msgid "Try again later"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Wrong name"
+msgstr "Ismeretlen név"
+
+msgid "System bug detected"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown system error"
+msgid "Unknown DNS error"
+msgstr "Ismeretlen rendszerhiba"
+
+#, fuzzy
+#| msgid "Invalid OID string"
+msgid "Invalid DNS section"
+msgstr "Érvénytelen OID karakterlánc"
+
+#, fuzzy
+#| msgid "Invalid S-expression"
+msgid "Invalid textual address form"
+msgstr "Érvénytelen S-kifejezés"
+
+#, fuzzy
+#| msgid "Missing certificate"
+msgid "Missing DNS query packet"
+msgstr "Hiányzó tanúsítvány"
+
+msgid "Missing DNS answer packet"
+msgstr ""
+
+msgid "Connection closed in DNS"
+msgstr ""
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "Verification failed in DNS"
+msgstr "Visszafejtés sikertelen"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "DNS Timeout"
+msgstr "Időtúllépés"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "General LDAP error"
+msgstr "Általános IPC hiba"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP attribute error"
+msgstr "Általános hiba"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP name error"
+msgstr "Általános hiba"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP security error"
+msgstr "Általános Assuan hiba"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP service error"
+msgstr "Általános hiba"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP update error"
+msgstr "Általános Assuan hiba"
+
+msgid "Experimental LDAP error code"
+msgstr ""
+
+#, fuzzy
+#| msgid "IPC write error"
+msgid "Private LDAP error code"
+msgstr "IPC írási hiba"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other general LDAP error"
+msgstr "Általános IPC hiba"
+
+#, fuzzy
+#| msgid "IPC connect call failed"
+msgid "LDAP connecting failed (X)"
+msgstr "Az IPC kapcsolódási hívás meghiúsult"
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral limit exceeded"
+msgstr "Általános hiba"
+
+msgid "LDAP client loop"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "No LDAP results returned"
+msgstr "Kártya visszaállítás szükséges"
+
+#, fuzzy
+#| msgid "Element not found"
+msgid "LDAP control not found"
+msgstr "Az elem nem található"
+
+#, fuzzy
+#| msgid "Not supported"
+msgid "Not supported by LDAP"
+msgstr "Nem támogatott"
+
+#, fuzzy
+#| msgid "Unexpected error"
+msgid "LDAP connect error"
+msgstr "Váratlan hiba"
+
+msgid "Out of memory in LDAP"
+msgstr ""
+
+msgid "Bad parameter to an LDAP routine"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported operation"
+msgid "User cancelled LDAP operation"
+msgstr "Nem támogatott művelet"
+
+#, fuzzy
+#| msgid "Bad certificate"
+msgid "Bad LDAP search filter"
+msgstr "Rossz tanúsítvány"
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "Unknown LDAP authentication method"
+msgstr "Ismeretlen kiterjesztés"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "Timeout in LDAP"
+msgstr "Időtúllépés"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP decoding error"
+msgstr "dirmngr hiba"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP encoding error"
+msgstr "dirmngr hiba"
+
+#, fuzzy
+#| msgid "IPC read error"
+msgid "LDAP local error"
+msgstr "IPC olvasási hiba"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot contact LDAP server"
+msgstr "Nem IPC kiszolgáló"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP success"
+msgstr "Sikeres"
+
+#, fuzzy
+#| msgid "Configuration error"
+msgid "LDAP operations error"
+msgstr "Beállítási hiba"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP protocol error"
+msgstr "Protokollsértés"
+
+msgid "Time limit exceeded in LDAP"
+msgstr ""
+
+msgid "Size limit exceeded in LDAP"
+msgstr ""
+
+msgid "LDAP compare false"
+msgstr ""
+
+msgid "LDAP compare true"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "LDAP authentication method not supported"
+msgstr "Ismeretlen kiterjesztés"
+
+msgid "Strong(er) LDAP authentication required"
+msgstr ""
+
+msgid "Partial LDAP results+referral received"
+msgstr ""
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral"
+msgstr "Általános hiba"
+
+msgid "Administrative LDAP limit exceeded"
+msgstr ""
+
+msgid "Critical LDAP extension is unavailable"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Confidentiality required by LDAP"
+msgstr "Kártya visszaállítás szükséges"
+
+msgid "LDAP SASL bind in progress"
+msgstr ""
+
+msgid "No such LDAP attribute"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid attribute"
+msgid "Undefined LDAP attribute type"
+msgstr "Érvénytelen attribútum"
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate matching in LDAP"
+msgstr "Nem támogatott védelem"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Constraint violation in LDAP"
+msgstr "Protokollsértés"
+
+msgid "LDAP type or value exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid syntax in LDAP"
+msgstr "Érvénytelen állapot"
+
+#, fuzzy
+#| msgid "No CMS object"
+msgid "No such LDAP object"
+msgstr "Nincs CMS objektum"
+
+#, fuzzy
+#| msgid "Hardware problem"
+msgid "LDAP alias problem"
+msgstr "Hardverprobléma"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid DN syntax in LDAP"
+msgstr "Érvénytelen állapot"
+
+msgid "LDAP entry is a leaf"
+msgstr ""
+
+#, fuzzy
+#| msgid "Encoding problem"
+msgid "LDAP alias dereferencing problem"
+msgstr "Kódolási probléma"
+
+msgid "LDAP proxy authorization failure (X)"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate LDAP authentication"
+msgstr "Nem támogatott védelem"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid LDAP credentials"
+msgstr "Érvénytelen kártya"
+
+msgid "Insufficient access for LDAP"
+msgstr ""
+
+msgid "LDAP server is busy"
+msgstr ""
+
+msgid "LDAP server is unavailable"
+msgstr ""
+
+msgid "LDAP server is unwilling to perform"
+msgstr ""
+
+msgid "Loop detected by LDAP"
+msgstr ""
+
+#, fuzzy
+#| msgid "Missing action"
+msgid "LDAP naming violation"
+msgstr "Hiányzó művelet"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP object class violation"
+msgstr "Protokollsértés"
+
+#, fuzzy
+#| msgid "Operation not yet finished"
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "A művelet még nem fejeződött be"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation not allowed on RDN"
+msgstr "A művelet megszakítva"
+
+msgid "Already exists (LDAP)"
+msgstr ""
+
+msgid "Cannot modify LDAP object class"
+msgstr ""
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "LDAP results too large"
+msgstr "Túl hosszú sor"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation affects multiple DSAs"
+msgstr "A művelet megszakítva"
+
+msgid "Virtual LDAP list view error"
+msgstr ""
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other LDAP error"
+msgstr "Általános IPC hiba"
+
+#, fuzzy
+#| msgid "Resources exhausted"
+msgid "Resources exhausted in LCUP"
+msgstr "Az erőforrások kimerültek"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Security violation in LCUP"
+msgstr "Protokollsértés"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid data in LCUP"
+msgstr "Érvénytelen állapot"
+
+#, fuzzy
+#| msgid "Unsupported certificate"
+msgid "Unsupported scheme in LCUP"
+msgstr "Nem támogatott tanúsítvány"
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Reload required in LCUP"
+msgstr "Kártya visszaállítás szükséges"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP cancelled"
+msgstr "Sikeres"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "No LDAP operation to cancel"
+msgstr "Nem működik"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "Too late to cancel LDAP"
+msgstr "Nem működik"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot cancel LDAP"
+msgstr "Nem IPC kiszolgáló"
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "LDAP assertion failed"
+msgstr "Visszafejtés sikertelen"
+
+msgid "Proxied authorization denied by LDAP"
+msgstr ""
+
+msgid "User defined error code 1"
+msgstr "1. felhasználó által megadott hibakód"
+
+msgid "User defined error code 2"
+msgstr "2. felhasználó által megadott hibakód"
+
+msgid "User defined error code 3"
+msgstr "3. felhasználó által megadott hibakód"
+
+msgid "User defined error code 4"
+msgstr "4. felhasználó által megadott hibakód"
+
+msgid "User defined error code 5"
+msgstr "5. felhasználó által megadott hibakód"
+
+msgid "User defined error code 6"
+msgstr "6. felhasználó által megadott hibakód"
+
+msgid "User defined error code 7"
+msgstr "7. felhasználó által megadott hibakód"
+
+msgid "User defined error code 8"
+msgstr "8. felhasználó által megadott hibakód"
+
+msgid "User defined error code 9"
+msgstr "9. felhasználó által megadott hibakód"
+
+msgid "User defined error code 10"
+msgstr "10. felhasználó által megadott hibakód"
+
+msgid "User defined error code 11"
+msgstr "11. felhasználó által megadott hibakód"
+
+msgid "User defined error code 12"
+msgstr "12. felhasználó által megadott hibakód"
+
+msgid "User defined error code 13"
+msgstr "13. felhasználó által megadott hibakód"
+
+msgid "User defined error code 14"
+msgstr "14. felhasználó által megadott hibakód"
+
+msgid "User defined error code 15"
+msgstr "15. felhasználó által megadott hibakód"
+
+msgid "User defined error code 16"
+msgstr "16. felhasználó által megadott hibakód"
+
+msgid "System error w/o errno"
+msgstr "Rendszerhiba w/o hibaszám"
+
+msgid "Unknown system error"
+msgstr "Ismeretlen rendszerhiba"
+
+msgid "End of file"
+msgstr "Fájl vége"
+
+msgid "Unknown error code"
+msgstr "Ismeretlen hibakód"
+
+#, c-format
+msgid "Usage: %s GPG-ERROR [...]\n"
+msgstr "Használat: %s GPG-ERROR […]\n"
+
+#, c-format
+msgid "%s: warning: could not recognize %s\n"
+msgstr "%s: figyelmeztetés: nem sikerült felismerni: %s\n"
+
+#, fuzzy
+#~| msgid "Resources exhausted"
+#~ msgid "LCUP Resources exhausted"
+#~ msgstr "Az erőforrások kimerültek"
+
+#, fuzzy
+#~| msgid "Invalid data"
+#~ msgid "LCUP Invalid data"
+#~ msgstr "Érvénytelen adatok"
+
+#, fuzzy
+#~| msgid "General error"
+#~ msgid "LDAP Other general error"
+#~ msgstr "Általános hiba"
+
+#, fuzzy
+#~| msgid "dirmngr error"
+#~ msgid "Encoding error"
+#~ msgstr "dirmngr hiba"
diff --git a/po/insert-header.sin b/po/insert-header.sin
new file mode 100644
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/it.po b/po/it.po
new file mode 100644
index 0000000..2e7dc2b
--- /dev/null
+++ b/po/it.po
@@ -0,0 +1,1470 @@
+# Italian messages for libgpg-error.
+# Copyright (C) 2009, 2014 Free Software Foundation, Inc.
+# This file is distributed under the same license as the libgpg-error package.
+# Francesco Groccia <[email protected]>, 2009.
+# Milo Casagrande <[email protected]>, 2014.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: libgpg-error\n"
+"Report-Msgid-Bugs-To: [email protected]\n"
+"PO-Revision-Date: 2014-11-17 09:06+0100\n"
+"Last-Translator: Milo Casagrande <[email protected]>\n"
+"Language-Team: Italian <[email protected]>\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "Unspecified source"
+msgstr "Sorgente non specificata"
+
+msgid "gcrypt"
+msgstr "gcrypt"
+
+msgid "GnuPG"
+msgstr "GnuPG"
+
+msgid "GpgSM"
+msgstr "GpgSM"
+
+msgid "GPG Agent"
+msgstr "GPG Agent"
+
+msgid "Pinentry"
+msgstr "Pinentry"
+
+msgid "SCD"
+msgstr "SCD"
+
+msgid "GPGME"
+msgstr "GPGME"
+
+msgid "Keybox"
+msgstr "Keybox"
+
+msgid "KSBA"
+msgstr "KSBA"
+
+msgid "Dirmngr"
+msgstr "Dirmngr"
+
+msgid "GSTI"
+msgstr "GSTI"
+
+msgid "GPA"
+msgstr "GPA"
+
+msgid "Kleopatra"
+msgstr "Kleopatra"
+
+msgid "G13"
+msgstr "G13"
+
+msgid "Assuan"
+msgstr "Assuan"
+
+msgid "TLS"
+msgstr "TLS"
+
+msgid "Any source"
+msgstr "Qualsiasi fonte"
+
+msgid "User defined source 1"
+msgstr "Fonte 1 definita dall'utente"
+
+msgid "User defined source 2"
+msgstr "Fonte 2 definita dall'utente"
+
+msgid "User defined source 3"
+msgstr "Fonte 3 definita dall'utente"
+
+msgid "User defined source 4"
+msgstr "Fonte 4 definita dall'utente"
+
+msgid "Unknown source"
+msgstr "Fonte sconosciuta"
+
+msgid "Success"
+msgstr "Eseguito"
+
+msgid "General error"
+msgstr "Errore generale"
+
+msgid "Unknown packet"
+msgstr "Pacchetto sconosciuto"
+
+msgid "Unknown version in packet"
+msgstr "Versione sconosciuta nel pacchetto"
+
+msgid "Invalid public key algorithm"
+msgstr "Algoritmo a chiave pubblica non valido"
+
+msgid "Invalid digest algorithm"
+msgstr "Algoritmo di digest non valido"
+
+msgid "Bad public key"
+msgstr "Chiave pubblica errata"
+
+msgid "Bad secret key"
+msgstr "Chiave segreta errata"
+
+msgid "Bad signature"
+msgstr "Firma digitale errata"
+
+msgid "No public key"
+msgstr "Nessuna chiave pubblica"
+
+msgid "Checksum error"
+msgstr "Errore nel codice di controllo"
+
+msgid "Bad passphrase"
+msgstr "Passphrase errata"
+
+msgid "Invalid cipher algorithm"
+msgstr "Algoritmo di cifratura non valido"
+
+msgid "Cannot open keyring"
+msgstr "Apertura del portachiavi"
+
+msgid "Invalid packet"
+msgstr "Pacchetto non valido"
+
+msgid "Invalid armor"
+msgstr "Armatura non valida"
+
+msgid "No user ID"
+msgstr "Nessun identificativo utente"
+
+msgid "No secret key"
+msgstr "Nessuna chiave segreta"
+
+msgid "Wrong secret key used"
+msgstr "È stata usata una chiave segreta errata"
+
+msgid "Bad session key"
+msgstr "Chiave di sessione errata"
+
+msgid "Unknown compression algorithm"
+msgstr "Algoritmo di compressione sconosciuto"
+
+msgid "Number is not prime"
+msgstr "Non è un numero primo"
+
+msgid "Invalid encoding method"
+msgstr "Metodo di codifica non valido"
+
+msgid "Invalid encryption scheme"
+msgstr "Schema di cifratura non valido"
+
+msgid "Invalid signature scheme"
+msgstr "Schema di firma digitale non valido"
+
+msgid "Invalid attribute"
+msgstr "Attributo non valido"
+
+msgid "No value"
+msgstr "Nessun valore"
+
+msgid "Not found"
+msgstr "Non trovato"
+
+msgid "Value not found"
+msgstr "Valore non trovato"
+
+msgid "Syntax error"
+msgstr "Errore di sintassi"
+
+msgid "Bad MPI value"
+msgstr "Valore MPI errato"
+
+msgid "Invalid passphrase"
+msgstr "Passphrase non valida"
+
+msgid "Invalid signature class"
+msgstr "Classe di firma non valida"
+
+msgid "Resources exhausted"
+msgstr "Risorse esaurite"
+
+msgid "Invalid keyring"
+msgstr "Portachiavi non valido"
+
+msgid "Trust DB error"
+msgstr "Errore nel database della fiducia"
+
+msgid "Bad certificate"
+msgstr "Certificato errato"
+
+msgid "Invalid user ID"
+msgstr "Identificativo utente non valido"
+
+msgid "Unexpected error"
+msgstr "Errore inaspettato"
+
+msgid "Time conflict"
+msgstr "Data e ora in conflitto"
+
+msgid "Keyserver error"
+msgstr "Errore del server delle chiavi"
+
+msgid "Wrong public key algorithm"
+msgstr "Algoritmo a chiave pubblica errato"
+
+msgid "Tribute to D. A."
+msgstr "Tributo a D. A."
+
+msgid "Weak encryption key"
+msgstr "Chiave di cifratura debole"
+
+msgid "Invalid key length"
+msgstr "Lunghezza chiave non valida"
+
+msgid "Invalid argument"
+msgstr "Argomento non valido"
+
+msgid "Syntax error in URI"
+msgstr "Errore di sintassi nell'URI"
+
+msgid "Invalid URI"
+msgstr "URI non valido"
+
+msgid "Network error"
+msgstr "Errore di rete"
+
+msgid "Unknown host"
+msgstr "Host sconosciuto"
+
+msgid "Selftest failed"
+msgstr "Autodiagnosi non riuscito"
+
+msgid "Data not encrypted"
+msgstr "Dati non cifrati"
+
+msgid "Data not processed"
+msgstr "Dati non elaborati"
+
+msgid "Unusable public key"
+msgstr "Chiave pubblica non utilizzabile"
+
+msgid "Unusable secret key"
+msgstr "Chiave segreta non utilizzabile"
+
+msgid "Invalid value"
+msgstr "Valore non valido"
+
+msgid "Bad certificate chain"
+msgstr "Catena del certificato errata"
+
+msgid "Missing certificate"
+msgstr "Certificato mancante"
+
+msgid "No data"
+msgstr "Dati assenti"
+
+msgid "Bug"
+msgstr "Bug"
+
+msgid "Not supported"
+msgstr "Non supportato"
+
+msgid "Invalid operation code"
+msgstr "Codice di operazione non valido"
+
+msgid "Timeout"
+msgstr "Tempo scaduto"
+
+msgid "Internal error"
+msgstr "Errore interno"
+
+msgid "EOF (gcrypt)"
+msgstr "EOF (gcrypt)"
+
+msgid "Invalid object"
+msgstr "Oggetto non valido"
+
+msgid "Provided object is too short"
+msgstr "L'oggetto fornito è troppo piccolo"
+
+msgid "Provided object is too large"
+msgstr "L'oggetto fornito è troppo grande"
+
+msgid "Missing item in object"
+msgstr "Voce mancante nell'oggetto"
+
+msgid "Not implemented"
+msgstr "Non implementato"
+
+msgid "Conflicting use"
+msgstr "Uso in conflitto"
+
+msgid "Invalid cipher mode"
+msgstr "Modo di cifratura non valido"
+
+msgid "Invalid flag"
+msgstr "Indicatore non valido"
+
+msgid "Invalid handle"
+msgstr "Handle non valido"
+
+msgid "Result truncated"
+msgstr "Risultato troncato"
+
+msgid "Incomplete line"
+msgstr "Riga incompleta"
+
+msgid "Invalid response"
+msgstr "Risposta non valida"
+
+msgid "No agent running"
+msgstr "Nessun agente in esecuzione"
+
+msgid "Agent error"
+msgstr "Errore dell'agente"
+
+msgid "Invalid data"
+msgstr "Dati non validi"
+
+msgid "Unspecific Assuan server fault"
+msgstr "Fallimento non specificato del server Assuan"
+
+msgid "General Assuan error"
+msgstr "Errore generale per Assuan"
+
+msgid "Invalid session key"
+msgstr "Chiave di sessione non valida"
+
+msgid "Invalid S-expression"
+msgstr "S-expression non valida"
+
+msgid "Unsupported algorithm"
+msgstr "Algoritmo non supportato"
+
+msgid "No pinentry"
+msgstr "pinentry non è installato"
+
+msgid "pinentry error"
+msgstr "Errore di pinentry"
+
+msgid "Bad PIN"
+msgstr "PIN errato"
+
+msgid "Invalid name"
+msgstr "Nome non valido"
+
+msgid "Bad data"
+msgstr "Dati errati"
+
+msgid "Invalid parameter"
+msgstr "Parametro non valido"
+
+msgid "Wrong card"
+msgstr "Scheda errata"
+
+msgid "No dirmngr"
+msgstr "dirmngr non è installato"
+
+msgid "dirmngr error"
+msgstr "Errore di dirmngr"
+
+msgid "Certificate revoked"
+msgstr "Certificato revocato"
+
+msgid "No CRL known"
+msgstr "Nessun CRL conosciuto"
+
+msgid "CRL too old"
+msgstr "CRL troppo vecchio"
+
+msgid "Line too long"
+msgstr "Riga troppo lunga"
+
+msgid "Not trusted"
+msgstr "Non affidabile"
+
+msgid "Operation cancelled"
+msgstr "Operazione annullata"
+
+msgid "Bad CA certificate"
+msgstr "Certificato CA errato"
+
+msgid "Certificate expired"
+msgstr "Certificato scaduto"
+
+msgid "Certificate too young"
+msgstr "Certificato troppo nuovo"
+
+msgid "Unsupported certificate"
+msgstr "Certificato non supportato"
+
+msgid "Unknown S-expression"
+msgstr "S-expression sconosciuta"
+
+msgid "Unsupported protection"
+msgstr "Protezione non supportata"
+
+msgid "Corrupted protection"
+msgstr "Protezione danneggiata"
+
+msgid "Ambiguous name"
+msgstr "Nome ambiguo"
+
+msgid "Card error"
+msgstr "Errore della scheda"
+
+msgid "Card reset required"
+msgstr "È richiesto il riavvio della scheda"
+
+msgid "Card removed"
+msgstr "Scheda rimossa"
+
+msgid "Invalid card"
+msgstr "Scheda non valida"
+
+msgid "Card not present"
+msgstr "Scheda non presente"
+
+msgid "No PKCS15 application"
+msgstr "Non esiste un'applicazione per PKCS15"
+
+msgid "Not confirmed"
+msgstr "Non confermato"
+
+msgid "Configuration error"
+msgstr "Errore di configurazione"
+
+msgid "No policy match"
+msgstr "Nessuna politica corrispondente"
+
+msgid "Invalid index"
+msgstr "Indice non valido"
+
+msgid "Invalid ID"
+msgstr "Identificativo non valido"
+
+msgid "No SmartCard daemon"
+msgstr "Nessun demone per la SmartCard"
+
+msgid "SmartCard daemon error"
+msgstr "Errore del demone della SmartCard"
+
+msgid "Unsupported protocol"
+msgstr "Protocollo non supportato"
+
+msgid "Bad PIN method"
+msgstr "Sistema personale di identificazione non valido"
+
+msgid "Card not initialized"
+msgstr "La scheda non è stata inizializzata"
+
+msgid "Unsupported operation"
+msgstr "Operazione non supportata"
+
+msgid "Wrong key usage"
+msgstr "Uso errato della chiave"
+
+msgid "Nothing found"
+msgstr "Non è stato trovato nulla"
+
+msgid "Wrong blob type"
+msgstr "Tipo blob errato"
+
+msgid "Missing value"
+msgstr "Valore assente"
+
+msgid "Hardware problem"
+msgstr "Problema hardware"
+
+msgid "PIN blocked"
+msgstr "PIN bloccato"
+
+msgid "Conditions of use not satisfied"
+msgstr "Le condizioni d'uso non sono state soddisfatte"
+
+msgid "PINs are not synced"
+msgstr "I PIN non sono stati sincronizzati"
+
+msgid "Invalid CRL"
+msgstr "CRL non valido"
+
+msgid "BER error"
+msgstr "Errore BER"
+
+msgid "Invalid BER"
+msgstr "BER non valido"
+
+msgid "Element not found"
+msgstr "Elemento non trovato"
+
+msgid "Identifier not found"
+msgstr "Identificatore non trovato"
+
+msgid "Invalid tag"
+msgstr "Etichetta non valida"
+
+msgid "Invalid length"
+msgstr "Lunghezza non valida"
+
+msgid "Invalid key info"
+msgstr "Informazioni della chiave non valide"
+
+msgid "Unexpected tag"
+msgstr "Etichetta inaspettata"
+
+msgid "Not DER encoded"
+msgstr "Non è un codificato DER"
+
+msgid "No CMS object"
+msgstr "Non esiste alcun oggetto CMS"
+
+msgid "Invalid CMS object"
+msgstr "Oggetto CMS non valido"
+
+msgid "Unknown CMS object"
+msgstr "Oggetto CMS sconosciuto"
+
+msgid "Unsupported CMS object"
+msgstr "Oggetto CMS non supportato"
+
+msgid "Unsupported encoding"
+msgstr "Codifica non supportata"
+
+msgid "Unsupported CMS version"
+msgstr "Versione CMS non supportata"
+
+msgid "Unknown algorithm"
+msgstr "Algoritmo sconosciuto"
+
+msgid "Invalid crypto engine"
+msgstr "Motore crittografico non valido"
+
+msgid "Public key not trusted"
+msgstr "Chiave pubblica non affidabile"
+
+msgid "Decryption failed"
+msgstr "Decifratura non riuscita"
+
+msgid "Key expired"
+msgstr "Chiave scaduta"
+
+msgid "Signature expired"
+msgstr "Firma scaduta"
+
+msgid "Encoding problem"
+msgstr "Problema nella codifica"
+
+msgid "Invalid state"
+msgstr "Stato non valido"
+
+msgid "Duplicated value"
+msgstr "Valore duplicato"
+
+msgid "Missing action"
+msgstr "Azione mancante"
+
+msgid "ASN.1 module not found"
+msgstr "Modulo ASN.1 non trovato"
+
+msgid "Invalid OID string"
+msgstr "Testo per l'OID non valido"
+
+msgid "Invalid time"
+msgstr "Data non valida"
+
+msgid "Invalid CRL object"
+msgstr "Oggetto CRL non valido"
+
+msgid "Unsupported CRL version"
+msgstr "Versione CRL non supportata"
+
+msgid "Invalid certificate object"
+msgstr "Certificato dell'oggetto non valido"
+
+msgid "Unknown name"
+msgstr "Nome sconosciuto"
+
+msgid "A locale function failed"
+msgstr "Funzione locale ha fallito"
+
+msgid "Not locked"
+msgstr "Non bloccato"
+
+msgid "Protocol violation"
+msgstr "Violazione del protocollo"
+
+msgid "Invalid MAC"
+msgstr "MAC non valido"
+
+msgid "Invalid request"
+msgstr "Richiesta non valida"
+
+msgid "Unknown extension"
+msgstr "Estensione sconosciuta"
+
+msgid "Unknown critical extension"
+msgstr "Estensione critica sconosciuta"
+
+msgid "Locked"
+msgstr "Bloccato"
+
+msgid "Unknown option"
+msgstr "Opzione sconosciuta"
+
+msgid "Unknown command"
+msgstr "Comando sconosciuto"
+
+msgid "Not operational"
+msgstr "Non è in funzione"
+
+msgid "No passphrase given"
+msgstr "Nessuna passphrase fornita"
+
+msgid "No PIN given"
+msgstr "Nessun PIN fornito"
+
+msgid "Not enabled"
+msgstr "Disabilitato"
+
+msgid "No crypto engine"
+msgstr "Nessun motore di cifratura"
+
+msgid "Missing key"
+msgstr "Chiave mancate"
+
+msgid "Too many objects"
+msgstr "Troppi oggetti"
+
+msgid "Limit reached"
+msgstr "Raggiunto limite"
+
+msgid "Not initialized"
+msgstr "Non inizializzato"
+
+msgid "Missing issuer certificate"
+msgstr "Manca il certificato dell'emittente"
+
+msgid "No keyserver available"
+msgstr "Nessun server di chiavi disponibile"
+
+msgid "Invalid elliptic curve"
+msgstr "Curva ellittica non valida"
+
+msgid "Unknown elliptic curve"
+msgstr "Curva ellittica sconosciuta"
+
+msgid "Duplicated key"
+msgstr "Chiave duplicata"
+
+msgid "Ambiguous result"
+msgstr "Risultato ambiguo"
+
+msgid "No crypto context"
+msgstr "Nessun contesto di cifratura"
+
+msgid "Wrong crypto context"
+msgstr "Contesto di cifratura errato"
+
+msgid "Bad crypto context"
+msgstr "Contesto di cifratura rovinato"
+
+msgid "Conflict in the crypto context"
+msgstr "Conflitto nel contesto di cifratura"
+
+msgid "Broken public key"
+msgstr "Chiave pubblica danneggiata"
+
+msgid "Broken secret key"
+msgstr "Chiave segreta danneggiata"
+
+msgid "Invalid MAC algorithm"
+msgstr "Algoritmo MAC non valido"
+
+msgid "Operation fully cancelled"
+msgstr "Operazione annullata completamente"
+
+msgid "Operation not yet finished"
+msgstr "Operazione non ancora terminata"
+
+msgid "Buffer too short"
+msgstr "Buffer troppo breve"
+
+msgid "Invalid length specifier in S-expression"
+msgstr "Lunghezza dello specificatore in S-expression non valida"
+
+msgid "String too long in S-expression"
+msgstr "Testo troppo lungo in S-expression"
+
+msgid "Unmatched parentheses in S-expression"
+msgstr "Parentesi non corrispondenti in S-expression"
+
+msgid "S-expression not canonical"
+msgstr "S-expression non canonica"
+
+msgid "Bad character in S-expression"
+msgstr "Carattere errato in S-expression"
+
+msgid "Bad quotation in S-expression"
+msgstr "Citazione errata in S-expression"
+
+msgid "Zero prefix in S-expression"
+msgstr "Prefisso zero in S-expression"
+
+msgid "Nested display hints in S-expression"
+msgstr "Suggerimenti mostrati nidificati in S-expression"
+
+msgid "Unmatched display hints"
+msgstr "Suggerimenti mostrati non corrispondenti"
+
+msgid "Unexpected reserved punctuation in S-expression"
+msgstr "Punteggiatura riservata inaspettata in S-expression"
+
+msgid "Bad hexadecimal character in S-expression"
+msgstr "Carattere esadecimale errato in S-expression"
+
+msgid "Odd hexadecimal numbers in S-expression"
+msgstr "Numeri esadecimali dispari in S-expression"
+
+msgid "Bad octal character in S-expression"
+msgstr "Carattere ottale errato in S-expression"
+
+msgid "All subkeys are expired or revoked"
+msgstr ""
+
+#, fuzzy
+#| msgid "Data not encrypted"
+msgid "Database is corrupted"
+msgstr "Dati non cifrati"
+
+msgid "Server indicated a failure"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "No name"
+msgstr "Nome sconosciuto"
+
+#, fuzzy
+#| msgid "No public key"
+msgid "No key"
+msgstr "Nessuna chiave pubblica"
+
+msgid "Legacy key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Buffer too short"
+msgid "Request too short"
+msgstr "Buffer troppo breve"
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "Request too long"
+msgstr "Riga troppo lunga"
+
+msgid "Object is in termination state"
+msgstr ""
+
+msgid "No certificate chain"
+msgstr "Nessuna catena di certificazione"
+
+msgid "Certificate is too large"
+msgstr "Il certificato è troppo grande"
+
+msgid "Invalid record"
+msgstr "Record non valido"
+
+msgid "The MAC does not verify"
+msgstr "Impossibile verificare il MAC"
+
+msgid "Unexpected message"
+msgstr "Messaggio inaspettato"
+
+msgid "Compression or decompression failed"
+msgstr "Compressione o estrazione non riuscita"
+
+msgid "A counter would wrap"
+msgstr "Un contatore si azzererebbe (troppi messaggi...)"
+
+msgid "Fatal alert message received"
+msgstr "Ricevuto un messaggio di avviso fatale"
+
+msgid "No cipher algorithm"
+msgstr "Nessun algoritmo di cifratura"
+
+msgid "Missing client certificate"
+msgstr "Certificato client mancante"
+
+msgid "Close notification received"
+msgstr "Ricevuta notifica di chiusura"
+
+msgid "Ticket expired"
+msgstr "Ticket scaduto"
+
+msgid "Bad ticket"
+msgstr "Ticket errato"
+
+msgid "Unknown identity"
+msgstr "Identità sconosciuta"
+
+msgid "Bad certificate message in handshake"
+msgstr "Messaggio del certificato errato nell'handshake"
+
+msgid "Bad certificate request message in handshake"
+msgstr "Messaggio di richiesta del certificato errato nell'handshake"
+
+msgid "Bad certificate verify message in handshake"
+msgstr "Messaggio di verifica del certificato errato nell'handshake"
+
+msgid "Bad change cipher message in handshake"
+msgstr "Messaggi di modifica cifrario errato nell'handshake"
+
+msgid "Bad client hello message in handshake"
+msgstr "Messaggio client hello errato nell'handshake"
+
+msgid "Bad server hello message in handshake"
+msgstr "Messaggio server hello errato nell'handshake"
+
+msgid "Bad server hello done message in handshake"
+msgstr "Messaggio server hello completato errato nell'handshake"
+
+msgid "Bad finished message in handshake"
+msgstr "Messaggio completato errato nell'handshake"
+
+msgid "Bad server key exchange message in handshake"
+msgstr "Messaggio server scambio di chiavi errato nell'handshake"
+
+msgid "Bad client key exchange message in handshake"
+msgstr "Messaggio client scambio di chiavi errato nell'handshake"
+
+msgid "Bogus string"
+msgstr "Stringa fasulla"
+
+msgid "Forbidden"
+msgstr ""
+
+msgid "Key disabled"
+msgstr "Chiave disabilitata"
+
+msgid "Not possible with a card based key"
+msgstr "Non possibile con una chiave su scheda"
+
+msgid "Invalid lock object"
+msgstr "Oggetto di blocco non valido"
+
+msgid "True"
+msgstr ""
+
+msgid "False"
+msgstr ""
+
+msgid "General IPC error"
+msgstr "Errore IPC generale"
+
+msgid "IPC accept call failed"
+msgstr "Chiamata \"accept\" IPC non riuscita"
+
+msgid "IPC connect call failed"
+msgstr "Chiamata \"connect\" IPC non riuscita"
+
+msgid "Invalid IPC response"
+msgstr "Risposta IPC non valida"
+
+msgid "Invalid value passed to IPC"
+msgstr "Valore non valido passato a IPC"
+
+msgid "Incomplete line passed to IPC"
+msgstr "Riga incompleta passata a IPC"
+
+msgid "Line passed to IPC too long"
+msgstr "Riga passata a IPC troppo lunga"
+
+msgid "Nested IPC commands"
+msgstr "Comandi IPC nidificati"
+
+msgid "No data callback in IPC"
+msgstr "Nessun callback \"data\" in IPC"
+
+msgid "No inquire callback in IPC"
+msgstr "Nessun callback \"inquire\" in IPC"
+
+msgid "Not an IPC server"
+msgstr "Non è un server IPC"
+
+msgid "Not an IPC client"
+msgstr "Non è un client IPC"
+
+msgid "Problem starting IPC server"
+msgstr "Problema nell'avviare il server IPC"
+
+msgid "IPC read error"
+msgstr "Errore di lettura IPC"
+
+msgid "IPC write error"
+msgstr "Errore di scrittura IPC"
+
+msgid "Too much data for IPC layer"
+msgstr "Troppi dati per il livello IPC"
+
+msgid "Unexpected IPC command"
+msgstr "Comando IPC inaspettato"
+
+msgid "Unknown IPC command"
+msgstr "Comando IPC sconosciuto"
+
+msgid "IPC syntax error"
+msgstr "Errore di sintassi IPC"
+
+msgid "IPC call has been cancelled"
+msgstr "La chiamata IPC è stata annullata"
+
+msgid "No input source for IPC"
+msgstr "Nessuna sorgente in entrata per IPC"
+
+msgid "No output source for IPC"
+msgstr "Nessuna sorgente in uscita per IPC"
+
+msgid "IPC parameter error"
+msgstr "Errore per il parametro IPC"
+
+msgid "Unknown IPC inquire"
+msgstr "Richiesta IPC sconosciuta"
+
+#, fuzzy
+#| msgid "No crypto engine"
+msgid "Crypto engine too old"
+msgstr "Nessun motore di cifratura"
+
+msgid "Screen or window too small"
+msgstr ""
+
+msgid "Screen or window too large"
+msgstr ""
+
+msgid "Required environment variable not set"
+msgstr ""
+
+msgid "User ID already exists"
+msgstr ""
+
+msgid "Name already exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated name"
+msgstr "Valore duplicato"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Object is too young"
+msgstr "Certificato troppo nuovo"
+
+#, fuzzy
+#| msgid "Provided object is too short"
+msgid "Object is too old"
+msgstr "L'oggetto fornito è troppo piccolo"
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Unknown flag"
+msgstr "Nome sconosciuto"
+
+#, fuzzy
+#| msgid "Invalid operation code"
+msgid "Invalid execution order"
+msgstr "Codice di operazione non valido"
+
+msgid "Already fetched"
+msgstr ""
+
+msgid "Try again later"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Wrong name"
+msgstr "Nome sconosciuto"
+
+msgid "System bug detected"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown system error"
+msgid "Unknown DNS error"
+msgstr "Errore di sistema sconosciuto"
+
+#, fuzzy
+#| msgid "Invalid OID string"
+msgid "Invalid DNS section"
+msgstr "Testo per l'OID non valido"
+
+#, fuzzy
+#| msgid "Invalid S-expression"
+msgid "Invalid textual address form"
+msgstr "S-expression non valida"
+
+#, fuzzy
+#| msgid "Missing issuer certificate"
+msgid "Missing DNS query packet"
+msgstr "Manca il certificato dell'emittente"
+
+msgid "Missing DNS answer packet"
+msgstr ""
+
+msgid "Connection closed in DNS"
+msgstr ""
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "Verification failed in DNS"
+msgstr "Decifratura non riuscita"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "DNS Timeout"
+msgstr "Tempo scaduto"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "General LDAP error"
+msgstr "Errore IPC generale"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP attribute error"
+msgstr "Errore generale"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP name error"
+msgstr "Errore generale"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP security error"
+msgstr "Errore generale per Assuan"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP service error"
+msgstr "Errore generale"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP update error"
+msgstr "Errore generale per Assuan"
+
+msgid "Experimental LDAP error code"
+msgstr ""
+
+#, fuzzy
+#| msgid "IPC write error"
+msgid "Private LDAP error code"
+msgstr "Errore di scrittura IPC"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other general LDAP error"
+msgstr "Errore IPC generale"
+
+#, fuzzy
+#| msgid "IPC connect call failed"
+msgid "LDAP connecting failed (X)"
+msgstr "Chiamata \"connect\" IPC non riuscita"
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral limit exceeded"
+msgstr "Errore generale"
+
+msgid "LDAP client loop"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "No LDAP results returned"
+msgstr "È richiesto il riavvio della scheda"
+
+#, fuzzy
+#| msgid "Element not found"
+msgid "LDAP control not found"
+msgstr "Elemento non trovato"
+
+#, fuzzy
+#| msgid "Not supported"
+msgid "Not supported by LDAP"
+msgstr "Non supportato"
+
+#, fuzzy
+#| msgid "Unexpected error"
+msgid "LDAP connect error"
+msgstr "Errore inaspettato"
+
+msgid "Out of memory in LDAP"
+msgstr ""
+
+msgid "Bad parameter to an LDAP routine"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported operation"
+msgid "User cancelled LDAP operation"
+msgstr "Operazione non supportata"
+
+#, fuzzy
+#| msgid "Bad certificate"
+msgid "Bad LDAP search filter"
+msgstr "Certificato errato"
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "Unknown LDAP authentication method"
+msgstr "Estensione sconosciuta"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "Timeout in LDAP"
+msgstr "Tempo scaduto"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP decoding error"
+msgstr "Errore di dirmngr"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP encoding error"
+msgstr "Errore di dirmngr"
+
+#, fuzzy
+#| msgid "IPC read error"
+msgid "LDAP local error"
+msgstr "Errore di lettura IPC"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot contact LDAP server"
+msgstr "Non è un server IPC"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP success"
+msgstr "Eseguito"
+
+#, fuzzy
+#| msgid "Configuration error"
+msgid "LDAP operations error"
+msgstr "Errore di configurazione"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP protocol error"
+msgstr "Violazione del protocollo"
+
+msgid "Time limit exceeded in LDAP"
+msgstr ""
+
+msgid "Size limit exceeded in LDAP"
+msgstr ""
+
+msgid "LDAP compare false"
+msgstr ""
+
+msgid "LDAP compare true"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "LDAP authentication method not supported"
+msgstr "Estensione sconosciuta"
+
+msgid "Strong(er) LDAP authentication required"
+msgstr ""
+
+#, fuzzy
+#| msgid "Fatal alert message received"
+msgid "Partial LDAP results+referral received"
+msgstr "Ricevuto un messaggio di avviso fatale"
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral"
+msgstr "Errore generale"
+
+msgid "Administrative LDAP limit exceeded"
+msgstr ""
+
+msgid "Critical LDAP extension is unavailable"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Confidentiality required by LDAP"
+msgstr "È richiesto il riavvio della scheda"
+
+msgid "LDAP SASL bind in progress"
+msgstr ""
+
+msgid "No such LDAP attribute"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid attribute"
+msgid "Undefined LDAP attribute type"
+msgstr "Attributo non valido"
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate matching in LDAP"
+msgstr "Protezione non supportata"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Constraint violation in LDAP"
+msgstr "Violazione del protocollo"
+
+msgid "LDAP type or value exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid syntax in LDAP"
+msgstr "Stato non valido"
+
+#, fuzzy
+#| msgid "No CMS object"
+msgid "No such LDAP object"
+msgstr "Non esiste alcun oggetto CMS"
+
+#, fuzzy
+#| msgid "Hardware problem"
+msgid "LDAP alias problem"
+msgstr "Problema hardware"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid DN syntax in LDAP"
+msgstr "Stato non valido"
+
+msgid "LDAP entry is a leaf"
+msgstr ""
+
+#, fuzzy
+#| msgid "Encoding problem"
+msgid "LDAP alias dereferencing problem"
+msgstr "Problema nella codifica"
+
+msgid "LDAP proxy authorization failure (X)"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate LDAP authentication"
+msgstr "Protezione non supportata"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid LDAP credentials"
+msgstr "Scheda non valida"
+
+msgid "Insufficient access for LDAP"
+msgstr ""
+
+msgid "LDAP server is busy"
+msgstr ""
+
+#, fuzzy
+#| msgid "No keyserver available"
+msgid "LDAP server is unavailable"
+msgstr "Nessun server di chiavi disponibile"
+
+msgid "LDAP server is unwilling to perform"
+msgstr ""
+
+msgid "Loop detected by LDAP"
+msgstr ""
+
+#, fuzzy
+#| msgid "Missing action"
+msgid "LDAP naming violation"
+msgstr "Azione mancante"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP object class violation"
+msgstr "Violazione del protocollo"
+
+#, fuzzy
+#| msgid "Operation not yet finished"
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "Operazione non ancora terminata"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation not allowed on RDN"
+msgstr "Operazione annullata"
+
+msgid "Already exists (LDAP)"
+msgstr ""
+
+msgid "Cannot modify LDAP object class"
+msgstr ""
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "LDAP results too large"
+msgstr "Riga troppo lunga"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation affects multiple DSAs"
+msgstr "Operazione annullata"
+
+msgid "Virtual LDAP list view error"
+msgstr ""
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other LDAP error"
+msgstr "Errore IPC generale"
+
+#, fuzzy
+#| msgid "Resources exhausted"
+msgid "Resources exhausted in LCUP"
+msgstr "Risorse esaurite"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Security violation in LCUP"
+msgstr "Violazione del protocollo"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid data in LCUP"
+msgstr "Stato non valido"
+
+#, fuzzy
+#| msgid "Unsupported certificate"
+msgid "Unsupported scheme in LCUP"
+msgstr "Certificato non supportato"
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Reload required in LCUP"
+msgstr "È richiesto il riavvio della scheda"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP cancelled"
+msgstr "Eseguito"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "No LDAP operation to cancel"
+msgstr "Non è in funzione"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "Too late to cancel LDAP"
+msgstr "Non è in funzione"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot cancel LDAP"
+msgstr "Non è un server IPC"
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "LDAP assertion failed"
+msgstr "Decifratura non riuscita"
+
+msgid "Proxied authorization denied by LDAP"
+msgstr ""
+
+msgid "User defined error code 1"
+msgstr "Codice errore 1 definito dall'utente"
+
+msgid "User defined error code 2"
+msgstr "Codice errore 2 definito dall'utente"
+
+msgid "User defined error code 3"
+msgstr "Codice errore 3 definito dall'utente"
+
+msgid "User defined error code 4"
+msgstr "Codice errore 4 definito dall'utente"
+
+msgid "User defined error code 5"
+msgstr "Codice errore 5 definito dall'utente"
+
+msgid "User defined error code 6"
+msgstr "Codice errore 6 definito dall'utente"
+
+msgid "User defined error code 7"
+msgstr "Codice errore 7 definito dall'utente"
+
+msgid "User defined error code 8"
+msgstr "Codice errore 8 definito dall'utente"
+
+msgid "User defined error code 9"
+msgstr "Codice errore 9 definito dall'utente"
+
+msgid "User defined error code 10"
+msgstr "Codice errore 10 definito dall'utente"
+
+msgid "User defined error code 11"
+msgstr "Codice errore 11 definito dall'utente"
+
+msgid "User defined error code 12"
+msgstr "Codice errore 12 definito dall'utente"
+
+msgid "User defined error code 13"
+msgstr "Codice errore 13 definito dall'utente"
+
+msgid "User defined error code 14"
+msgstr "Codice errore 14 definito dall'utente"
+
+msgid "User defined error code 15"
+msgstr "Codice errore 15 definito dall'utente"
+
+msgid "User defined error code 16"
+msgstr "Codice errore 16 definito dall'utente"
+
+msgid "System error w/o errno"
+msgstr "Errore di sistema senza errno"
+
+msgid "Unknown system error"
+msgstr "Errore di sistema sconosciuto"
+
+msgid "End of file"
+msgstr "Fine del file"
+
+msgid "Unknown error code"
+msgstr "Codice di errore sconosciuto"
+
+#, c-format
+msgid "Usage: %s GPG-ERROR [...]\n"
+msgstr "Uso: %s GPG-ERROR [...]\n"
+
+#, c-format
+msgid "%s: warning: could not recognize %s\n"
+msgstr "%s: avviso: impossibile riconoscere %s\n"
+
+#, fuzzy
+#~| msgid "Resources exhausted"
+#~ msgid "LCUP Resources exhausted"
+#~ msgstr "Risorse esaurite"
+
+#, fuzzy
+#~| msgid "Invalid data"
+#~ msgid "LCUP Invalid data"
+#~ msgstr "Dati non validi"
+
+#, fuzzy
+#~| msgid "General error"
+#~ msgid "LDAP Other general error"
+#~ msgstr "Errore generale"
+
+#, fuzzy
+#~| msgid "dirmngr error"
+#~ msgid "Encoding error"
+#~ msgstr "Errore di dirmngr"
diff --git a/po/ja.po b/po/ja.po
new file mode 100644
index 0000000..63f390a
--- /dev/null
+++ b/po/ja.po
@@ -0,0 +1,1304 @@
+# Japanese messages for GnuPG libgpg-error
+# Copyright (C) 2010, 2012, 2014, 2015, 2016 Free Software Foundation, Inc.
+# This file is distributed under the same license as the libgpg-error package.
+# Yasuaki Taniguchi <[email protected]>, 2010.
+# Takeshi Hamasaki <[email protected]>, 2012.
+# NIIBE Yutaka <[email protected]>, 2014, 2015, 2016, 2017.
+msgid ""
+msgstr ""
+"Project-Id-Version: libgpg-error 1.27\n"
+"Report-Msgid-Bugs-To: [email protected]\n"
+"PO-Revision-Date: 2017-03-06 20:25+0900\n"
+"Last-Translator: NIIBE Yutaka <[email protected]>\n"
+"Language-Team: none\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+msgid "Unspecified source"
+msgstr "指定されていないソース"
+
+msgid "gcrypt"
+msgstr "gcrypt"
+
+msgid "GnuPG"
+msgstr "GnuPG"
+
+msgid "GpgSM"
+msgstr "GpgSM"
+
+msgid "GPG Agent"
+msgstr "GPG Agent"
+
+msgid "Pinentry"
+msgstr "Pinentry"
+
+msgid "SCD"
+msgstr "SCD"
+
+msgid "GPGME"
+msgstr "GPGME"
+
+msgid "Keybox"
+msgstr "Keybox"
+
+msgid "KSBA"
+msgstr "KSBA"
+
+msgid "Dirmngr"
+msgstr "Dirmngr"
+
+msgid "GSTI"
+msgstr "GSTI"
+
+msgid "GPA"
+msgstr "GPA"
+
+msgid "Kleopatra"
+msgstr "Kleopatra"
+
+msgid "G13"
+msgstr "G13"
+
+msgid "Assuan"
+msgstr "Assuan"
+
+msgid "TLS"
+msgstr "TLS"
+
+msgid "Any source"
+msgstr "指定なしのソース"
+
+msgid "User defined source 1"
+msgstr "ユーザ定義ソース 1"
+
+msgid "User defined source 2"
+msgstr "ユーザ定義ソース 2"
+
+msgid "User defined source 3"
+msgstr "ユーザ定義ソース 3"
+
+msgid "User defined source 4"
+msgstr "ユーザ定義ソース 4"
+
+msgid "Unknown source"
+msgstr "不明なソース"
+
+msgid "Success"
+msgstr "成功です"
+
+msgid "General error"
+msgstr "一般エラーです"
+
+msgid "Unknown packet"
+msgstr "不明なパケットです"
+
+msgid "Unknown version in packet"
+msgstr "パケット内の不明なバージョンです"
+
+msgid "Invalid public key algorithm"
+msgstr "無効な公開鍵アルゴリズムです"
+
+msgid "Invalid digest algorithm"
+msgstr "無効なダイジェスト・アルゴリズムです"
+
+msgid "Bad public key"
+msgstr "誤った公開鍵です"
+
+msgid "Bad secret key"
+msgstr "誤った秘密鍵です"
+
+msgid "Bad signature"
+msgstr "誤った署名です"
+
+msgid "No public key"
+msgstr "公開鍵がありません"
+
+msgid "Checksum error"
+msgstr "チェックサムエラーです"
+
+msgid "Bad passphrase"
+msgstr "誤ったパスフレーズです"
+
+msgid "Invalid cipher algorithm"
+msgstr "無効な暗号アルゴリズムです"
+
+msgid "Cannot open keyring"
+msgstr "鍵リングが開けません"
+
+msgid "Invalid packet"
+msgstr "無効なパケットです"
+
+msgid "Invalid armor"
+msgstr "無効なアスキー保護形式です"
+
+msgid "No user ID"
+msgstr "ユーザ ID がありません"
+
+msgid "No secret key"
+msgstr "秘密鍵がありません"
+
+msgid "Wrong secret key used"
+msgstr "間違った秘密鍵が使用されました"
+
+msgid "Bad session key"
+msgstr "誤ったセッション鍵です"
+
+msgid "Unknown compression algorithm"
+msgstr "不明な圧縮アルゴリズムです"
+
+msgid "Number is not prime"
+msgstr "数が素数ではありません"
+
+msgid "Invalid encoding method"
+msgstr "無効な符号化方法です"
+
+msgid "Invalid encryption scheme"
+msgstr "無効な暗号系です"
+
+msgid "Invalid signature scheme"
+msgstr "無効な署名系です"
+
+msgid "Invalid attribute"
+msgstr "無効な属性です"
+
+msgid "No value"
+msgstr "値がありません"
+
+msgid "Not found"
+msgstr "見つかりません"
+
+msgid "Value not found"
+msgstr "値が見つかりません"
+
+msgid "Syntax error"
+msgstr "構文エラーです"
+
+msgid "Bad MPI value"
+msgstr "誤った MPI の値です"
+
+msgid "Invalid passphrase"
+msgstr "無効なパスフレーズです"
+
+msgid "Invalid signature class"
+msgstr "無効な署名クラスです"
+
+msgid "Resources exhausted"
+msgstr "資源を使い果たしました"
+
+msgid "Invalid keyring"
+msgstr "無効な鍵リングです"
+
+msgid "Trust DB error"
+msgstr "信用 DB エラーです"
+
+msgid "Bad certificate"
+msgstr "誤った証明書です"
+
+msgid "Invalid user ID"
+msgstr "無効なユーザ ID です"
+
+msgid "Unexpected error"
+msgstr "予期しないエラーです"
+
+msgid "Time conflict"
+msgstr "時間の不一致です"
+
+msgid "Keyserver error"
+msgstr "鍵サーバーエラーです"
+
+msgid "Wrong public key algorithm"
+msgstr "誤った公開鍵アルゴリズムです"
+
+msgid "Tribute to D. A."
+msgstr "ダグラス・アダムスに捧ぐ"
+
+msgid "Weak encryption key"
+msgstr "弱い暗号鍵です"
+
+msgid "Invalid key length"
+msgstr "無効な鍵長です"
+
+msgid "Invalid argument"
+msgstr "無効な引数です"
+
+msgid "Syntax error in URI"
+msgstr "URIの構文エラーです"
+
+msgid "Invalid URI"
+msgstr "無効な URI です"
+
+msgid "Network error"
+msgstr "ネットワークエラーです"
+
+msgid "Unknown host"
+msgstr "不明なホストです"
+
+msgid "Selftest failed"
+msgstr "セルフテストに失敗しました"
+
+msgid "Data not encrypted"
+msgstr "データは暗号化されませんでした"
+
+msgid "Data not processed"
+msgstr "データは処理されませんでした"
+
+msgid "Unusable public key"
+msgstr "使用できない公開鍵です"
+
+msgid "Unusable secret key"
+msgstr "使用できない秘密鍵です"
+
+msgid "Invalid value"
+msgstr "無効な値です"
+
+msgid "Bad certificate chain"
+msgstr "誤った証明書連鎖です"
+
+msgid "Missing certificate"
+msgstr "証明書が欠如しています"
+
+msgid "No data"
+msgstr "データがありません"
+
+msgid "Bug"
+msgstr "バグです"
+
+msgid "Not supported"
+msgstr "サポートされていません"
+
+msgid "Invalid operation code"
+msgstr "無効な操作コードです"
+
+msgid "Timeout"
+msgstr "タイムアウトです"
+
+msgid "Internal error"
+msgstr "内部エラーです"
+
+msgid "EOF (gcrypt)"
+msgstr "EOF (gcrypt)です"
+
+msgid "Invalid object"
+msgstr "無効なオブジェクトです"
+
+msgid "Provided object is too short"
+msgstr "与えられたオブジェクトが小さすぎます"
+
+msgid "Provided object is too large"
+msgstr "与えられたオブジェクトが大きすぎます"
+
+msgid "Missing item in object"
+msgstr "オブジェクト内に項目が欠如しています"
+
+msgid "Not implemented"
+msgstr "実装されていません"
+
+msgid "Conflicting use"
+msgstr "対立する使用です"
+
+msgid "Invalid cipher mode"
+msgstr "無効な暗号モードです"
+
+msgid "Invalid flag"
+msgstr "無効なフラグです"
+
+msgid "Invalid handle"
+msgstr "無効なハンドルです"
+
+msgid "Result truncated"
+msgstr "結果が切り詰められました"
+
+msgid "Incomplete line"
+msgstr "不完全な行です"
+
+msgid "Invalid response"
+msgstr "無効な応答です"
+
+msgid "No agent running"
+msgstr "エージェントが動いていません"
+
+msgid "Agent error"
+msgstr "エージェントエラーです"
+
+msgid "Invalid data"
+msgstr "無効なデータです"
+
+msgid "Unspecific Assuan server fault"
+msgstr "不特定な Assuan サーバ失敗です"
+
+msgid "General Assuan error"
+msgstr "一般Assuan エラーです"
+
+msgid "Invalid session key"
+msgstr "無効なセッション鍵です"
+
+msgid "Invalid S-expression"
+msgstr "無効な S-式です"
+
+msgid "Unsupported algorithm"
+msgstr "サポートされていないアルゴリズムです"
+
+msgid "No pinentry"
+msgstr "Pinentryがありません"
+
+msgid "pinentry error"
+msgstr "Pinentryエラー"
+
+msgid "Bad PIN"
+msgstr "誤った PIN です"
+
+msgid "Invalid name"
+msgstr "無効な名前です"
+
+msgid "Bad data"
+msgstr "誤ったデータです"
+
+msgid "Invalid parameter"
+msgstr "無効なパラメータです"
+
+msgid "Wrong card"
+msgstr "誤ったカードです"
+
+msgid "No dirmngr"
+msgstr "dirmngrがありません"
+
+msgid "dirmngr error"
+msgstr "dirmngr のエラー"
+
+msgid "Certificate revoked"
+msgstr "証明書が廃止されました"
+
+msgid "No CRL known"
+msgstr "既知の CRL がありません"
+
+msgid "CRL too old"
+msgstr "CRL が古すぎます"
+
+msgid "Line too long"
+msgstr "行が長すぎます"
+
+msgid "Not trusted"
+msgstr "信用されていません"
+
+msgid "Operation cancelled"
+msgstr "操作がキャンセルされました"
+
+msgid "Bad CA certificate"
+msgstr "誤った CA 証明書です"
+
+msgid "Certificate expired"
+msgstr "証明書が期限切れです"
+
+msgid "Certificate too young"
+msgstr "証明書が若すぎます"
+
+msgid "Unsupported certificate"
+msgstr "サポートされていない証明書です"
+
+msgid "Unknown S-expression"
+msgstr "不明な S-式です"
+
+msgid "Unsupported protection"
+msgstr "サポートされていない防護です"
+
+msgid "Corrupted protection"
+msgstr "破損した防護です"
+
+msgid "Ambiguous name"
+msgstr "曖昧な名前です"
+
+msgid "Card error"
+msgstr "カードエラー"
+
+msgid "Card reset required"
+msgstr "カードリセットが必要です"
+
+msgid "Card removed"
+msgstr "カードが削除されました"
+
+msgid "Invalid card"
+msgstr "無効なカードです"
+
+msgid "Card not present"
+msgstr "カードが存在していません"
+
+msgid "No PKCS15 application"
+msgstr "PKCS15 アプリケーションがありません"
+
+msgid "Not confirmed"
+msgstr "確認されていません"
+
+msgid "Configuration error"
+msgstr "設定のエラーです"
+
+msgid "No policy match"
+msgstr "一致するポリシーがありません"
+
+msgid "Invalid index"
+msgstr "無効な索引です"
+
+msgid "Invalid ID"
+msgstr "無効な ID です"
+
+msgid "No SmartCard daemon"
+msgstr "スマートカードデーモンがありません"
+
+msgid "SmartCard daemon error"
+msgstr "スマートカードデーモンエラーです"
+
+msgid "Unsupported protocol"
+msgstr "サポートされていないプロトコルです"
+
+msgid "Bad PIN method"
+msgstr "誤った PIN 方法です"
+
+msgid "Card not initialized"
+msgstr "カードが初期化されていません"
+
+msgid "Unsupported operation"
+msgstr "サポートされていない操作です"
+
+msgid "Wrong key usage"
+msgstr "誤った鍵の使用法です"
+
+msgid "Nothing found"
+msgstr "見つかりませんでした"
+
+msgid "Wrong blob type"
+msgstr "誤った blog 型です"
+
+msgid "Missing value"
+msgstr "値がありません"
+
+msgid "Hardware problem"
+msgstr "ハードウェアの問題です"
+
+msgid "PIN blocked"
+msgstr "PIN がブロックされました"
+
+msgid "Conditions of use not satisfied"
+msgstr "使用条件が満たされていません"
+
+msgid "PINs are not synced"
+msgstr "PIN が同期されていません"
+
+msgid "Invalid CRL"
+msgstr "無効な CRL です"
+
+msgid "BER error"
+msgstr "BER エラーです"
+
+msgid "Invalid BER"
+msgstr "無効な BER です"
+
+msgid "Element not found"
+msgstr "要素が見つかりませんでした"
+
+msgid "Identifier not found"
+msgstr "識別子が見つかりませんでした"
+
+msgid "Invalid tag"
+msgstr "無効なタグです"
+
+msgid "Invalid length"
+msgstr "無効な長さです"
+
+msgid "Invalid key info"
+msgstr "無効な鍵情報です"
+
+msgid "Unexpected tag"
+msgstr "予期しないタグです"
+
+msgid "Not DER encoded"
+msgstr "DER 符号化ではありません"
+
+msgid "No CMS object"
+msgstr "CMS オブジェクトではありません"
+
+msgid "Invalid CMS object"
+msgstr "無効な CMS オブジェクトです"
+
+msgid "Unknown CMS object"
+msgstr "不明な CMS オブジェクトです"
+
+msgid "Unsupported CMS object"
+msgstr "サポートされていない CMS オブジェクトです"
+
+msgid "Unsupported encoding"
+msgstr "サポートされていない符号化です"
+
+msgid "Unsupported CMS version"
+msgstr "サポートされていない CMS バージョンです"
+
+msgid "Unknown algorithm"
+msgstr "不明なアルゴリズムです"
+
+msgid "Invalid crypto engine"
+msgstr "無効な暗号エンジンです"
+
+msgid "Public key not trusted"
+msgstr "信用されていない公開鍵です"
+
+msgid "Decryption failed"
+msgstr "復号に失敗しました"
+
+msgid "Key expired"
+msgstr "鍵が期限切れです"
+
+msgid "Signature expired"
+msgstr "署名が期限切れです"
+
+msgid "Encoding problem"
+msgstr "符号化に問題があります"
+
+msgid "Invalid state"
+msgstr "無効な状態です"
+
+msgid "Duplicated value"
+msgstr "重複した値です"
+
+msgid "Missing action"
+msgstr "アクションが欠如しています"
+
+msgid "ASN.1 module not found"
+msgstr "ASN.1 モジュールがみつかりませんでした"
+
+msgid "Invalid OID string"
+msgstr "無効な OID 文字列です"
+
+msgid "Invalid time"
+msgstr "無効な時間です"
+
+msgid "Invalid CRL object"
+msgstr "無効な CRL オブジェクトです"
+
+msgid "Unsupported CRL version"
+msgstr "サポートされていない CRL バージョンです"
+
+msgid "Invalid certificate object"
+msgstr "無効な証明書オブジェクトです"
+
+msgid "Unknown name"
+msgstr "不明な名前です"
+
+msgid "A locale function failed"
+msgstr "ロケール関数 失敗"
+
+msgid "Not locked"
+msgstr "ロックされていません"
+
+msgid "Protocol violation"
+msgstr "プロトコル違反"
+
+msgid "Invalid MAC"
+msgstr "無効な MACです"
+
+msgid "Invalid request"
+msgstr "無効なリクエスト"
+
+msgid "Unknown extension"
+msgstr "未知の拡張子"
+
+msgid "Unknown critical extension"
+msgstr "不明のクリチカル拡張です"
+
+msgid "Locked"
+msgstr "ロックされています"
+
+msgid "Unknown option"
+msgstr "未知のオプションです"
+
+msgid "Unknown command"
+msgstr "未知のコマンドです"
+
+msgid "Not operational"
+msgstr "操作できません"
+
+msgid "No passphrase given"
+msgstr "パスフレーズが与えられていません"
+
+msgid "No PIN given"
+msgstr "PINが与えられていません"
+
+msgid "Not enabled"
+msgstr "有効となってません"
+
+msgid "No crypto engine"
+msgstr "暗号エンジンがありません"
+
+msgid "Missing key"
+msgstr "鍵がありません"
+
+msgid "Too many objects"
+msgstr "オブジェクトが多すぎます"
+
+msgid "Limit reached"
+msgstr "限界に達しました"
+
+msgid "Not initialized"
+msgstr "初期化されていません"
+
+msgid "Missing issuer certificate"
+msgstr "発行元証明書がありません"
+
+msgid "No keyserver available"
+msgstr "キーサーバが利用可能ではありません"
+
+msgid "Invalid elliptic curve"
+msgstr "無効な楕円関数です"
+
+msgid "Unknown elliptic curve"
+msgstr "不明の楕円関数です"
+
+msgid "Duplicated key"
+msgstr "重複した鍵です"
+
+msgid "Ambiguous result"
+msgstr "曖昧な結果です"
+
+msgid "No crypto context"
+msgstr "暗号コンテクストがありません"
+
+msgid "Wrong crypto context"
+msgstr "誤った暗号コンテクストです"
+
+msgid "Bad crypto context"
+msgstr "間違ったな暗号コンテクストです"
+
+msgid "Conflict in the crypto context"
+msgstr "暗号コンテクストが競合しています"
+
+msgid "Broken public key"
+msgstr "公開鍵が壊れています"
+
+msgid "Broken secret key"
+msgstr "秘密鍵が壊れています"
+
+msgid "Invalid MAC algorithm"
+msgstr "無効なMACアルゴリズムです"
+
+msgid "Operation fully cancelled"
+msgstr "操作が完全にキャンセルされました"
+
+msgid "Operation not yet finished"
+msgstr "操作がまだ終了していません"
+
+msgid "Buffer too short"
+msgstr "バッファが短すぎます"
+
+msgid "Invalid length specifier in S-expression"
+msgstr "S式の中の長さ指定が無効です"
+
+msgid "String too long in S-expression"
+msgstr "S式の中の文字列が長すぎます"
+
+msgid "Unmatched parentheses in S-expression"
+msgstr "S式の括弧が一致しません"
+
+msgid "S-expression not canonical"
+msgstr "カノニカルなS式ではありません"
+
+msgid "Bad character in S-expression"
+msgstr "S式に誤ったキャラクタがあります"
+
+msgid "Bad quotation in S-expression"
+msgstr "S式の誤ったクオーテーションです"
+
+msgid "Zero prefix in S-expression"
+msgstr "S式のゼロ・プレフィックスです"
+
+msgid "Nested display hints in S-expression"
+msgstr "S式に表示ヒントが入れ子になっています"
+
+msgid "Unmatched display hints"
+msgstr "表示ヒントが一致しません"
+
+msgid "Unexpected reserved punctuation in S-expression"
+msgstr "S式に予期しない予約された句読点があります"
+
+msgid "Bad hexadecimal character in S-expression"
+msgstr "S式に間違った16進キャラクタがあります"
+
+msgid "Odd hexadecimal numbers in S-expression"
+msgstr "S式におかしな16進キャラクタがあります"
+
+msgid "Bad octal character in S-expression"
+msgstr "S式に間違った8進キャラクタがあります"
+
+msgid "All subkeys are expired or revoked"
+msgstr "すべての副鍵が期限切れか失効しています"
+
+msgid "Database is corrupted"
+msgstr "データベースがおかしくなってます"
+
+msgid "Server indicated a failure"
+msgstr "サーバが失敗を示しています"
+
+msgid "No name"
+msgstr "名前がありません"
+
+msgid "No key"
+msgstr "鍵がありません"
+
+msgid "Legacy key"
+msgstr "レガシーな鍵"
+
+msgid "Request too short"
+msgstr "リクエストが短すぎます"
+
+msgid "Request too long"
+msgstr "リクエストが長すぎます"
+
+msgid "Object is in termination state"
+msgstr "オブジェクトは終了状態です"
+
+msgid "No certificate chain"
+msgstr "証明書連鎖がありません"
+
+msgid "Certificate is too large"
+msgstr "証明書が大きすぎです"
+
+msgid "Invalid record"
+msgstr "無効なレコードです"
+
+msgid "The MAC does not verify"
+msgstr "MACが検証できません"
+
+msgid "Unexpected message"
+msgstr "予期しないメッセージです"
+
+msgid "Compression or decompression failed"
+msgstr "圧縮/伸長が失敗しました"
+
+msgid "A counter would wrap"
+msgstr "カウンタが一回りするかもしれません"
+
+msgid "Fatal alert message received"
+msgstr "致命的な警告メッセージを受信しました"
+
+msgid "No cipher algorithm"
+msgstr "暗号アルゴリズムがありません"
+
+msgid "Missing client certificate"
+msgstr "クライアント証明書がありません"
+
+msgid "Close notification received"
+msgstr "クローズの知らせを受信しました"
+
+msgid "Ticket expired"
+msgstr "チケットが期限切れです"
+
+msgid "Bad ticket"
+msgstr "誤ったチケットです"
+
+msgid "Unknown identity"
+msgstr "不明なアイデンテティです"
+
+msgid "Bad certificate message in handshake"
+msgstr "ハンドシェークで誤った証明書メッセージです"
+
+msgid "Bad certificate request message in handshake"
+msgstr "ハンドシェークで誤った証明書要求メッセージです"
+
+msgid "Bad certificate verify message in handshake"
+msgstr "ハンドシェークで誤った証明書検証メッセージです"
+
+msgid "Bad change cipher message in handshake"
+msgstr "ハンドシェークで誤った暗号変更メッセージです"
+
+msgid "Bad client hello message in handshake"
+msgstr "ハンドシェークで誤ったクライアントハローメッセージです"
+
+msgid "Bad server hello message in handshake"
+msgstr "ハンドシェークで誤ったサーバハローメッセージです"
+
+msgid "Bad server hello done message in handshake"
+msgstr "ハンドシェークで誤ったサーバハロー了解メッセージです"
+
+msgid "Bad finished message in handshake"
+msgstr "ハンドシェークで誤った終了メッセージです"
+
+msgid "Bad server key exchange message in handshake"
+msgstr "ハンドシェークで誤ったサーバ鍵交換メッセージです"
+
+msgid "Bad client key exchange message in handshake"
+msgstr "ハンドシェークで誤ったクライアント鍵交換メッセージです"
+
+msgid "Bogus string"
+msgstr "おかしな文字列です"
+
+msgid "Forbidden"
+msgstr "禁止"
+
+msgid "Key disabled"
+msgstr "鍵が停止されています"
+
+msgid "Not possible with a card based key"
+msgstr "カードの鍵では不可能です"
+
+msgid "Invalid lock object"
+msgstr "無効なロック・オブジェクトです"
+
+msgid "True"
+msgstr "真"
+
+msgid "False"
+msgstr "偽"
+
+msgid "General IPC error"
+msgstr "一般IPCエラーです"
+
+msgid "IPC accept call failed"
+msgstr "IPC accept呼び出しに失敗"
+
+msgid "IPC connect call failed"
+msgstr "IPC connect呼び出しに失敗しました"
+
+msgid "Invalid IPC response"
+msgstr "無効なIPC応答です"
+
+msgid "Invalid value passed to IPC"
+msgstr "無効な値がIPCに渡されました"
+
+msgid "Incomplete line passed to IPC"
+msgstr "不完全な行がIPCに渡されました"
+
+msgid "Line passed to IPC too long"
+msgstr "IPCに渡された行が長すぎます"
+
+msgid "Nested IPC commands"
+msgstr "IPCコマンドが入れ子になっています"
+
+msgid "No data callback in IPC"
+msgstr "IPCでデータのコールバックがありません"
+
+msgid "No inquire callback in IPC"
+msgstr "IPCで問い合わせコールバックがありません"
+
+msgid "Not an IPC server"
+msgstr "IPCサーバではありません"
+
+msgid "Not an IPC client"
+msgstr "IPCクライアントではありません"
+
+msgid "Problem starting IPC server"
+msgstr "IPCサーバの開始に問題が発生しました"
+
+msgid "IPC read error"
+msgstr "IPC読み取りエラー"
+
+msgid "IPC write error"
+msgstr "IPC書き込みエラー"
+
+msgid "Too much data for IPC layer"
+msgstr "IPCレイヤにデータが多すぎです"
+
+msgid "Unexpected IPC command"
+msgstr "予期しないIPCコマンドです"
+
+msgid "Unknown IPC command"
+msgstr "不明なIPCコマンドです"
+
+msgid "IPC syntax error"
+msgstr "IPC構文エラーです"
+
+msgid "IPC call has been cancelled"
+msgstr "IPC呼び出しがキャンセルされました"
+
+msgid "No input source for IPC"
+msgstr "IPCに対する入力ソースがありません"
+
+msgid "No output source for IPC"
+msgstr "IPCに対する出力ソースがありません"
+
+msgid "IPC parameter error"
+msgstr "IPCパラメータエラーです"
+
+msgid "Unknown IPC inquire"
+msgstr "不明なIPC問い合わせです"
+
+msgid "Crypto engine too old"
+msgstr "暗号エンジンが古すぎます"
+
+msgid "Screen or window too small"
+msgstr "スクリーンまたはウィンドウが小さすぎます"
+
+msgid "Screen or window too large"
+msgstr "スクリーンまたはウィンドウが大きすぎます"
+
+msgid "Required environment variable not set"
+msgstr "必要な環境変数が設定されていません"
+
+msgid "User ID already exists"
+msgstr "User IDが既に存在します"
+
+msgid "Name already exists"
+msgstr "名前が既に存在します"
+
+msgid "Duplicated name"
+msgstr "重複した名前です"
+
+msgid "Object is too young"
+msgstr "オブジェクトが若すぎます"
+
+msgid "Object is too old"
+msgstr "オブジェクトが古すぎます"
+
+msgid "Unknown flag"
+msgstr "不明なフラグです"
+
+msgid "Invalid execution order"
+msgstr "無効な実効順です"
+
+msgid "Already fetched"
+msgstr "すでにフェッチされてます"
+
+msgid "Try again later"
+msgstr "後で再度試してください"
+
+msgid "Wrong name"
+msgstr "間違った名前です"
+
+msgid "System bug detected"
+msgstr "システムのバグが検出されました"
+
+msgid "Unknown DNS error"
+msgstr "不明なDNSエラー"
+
+msgid "Invalid DNS section"
+msgstr "無効な DNS セクションです"
+
+msgid "Invalid textual address form"
+msgstr "無効なテクストのアドレス形式です"
+
+msgid "Missing DNS query packet"
+msgstr "DNSクエリのパケットがありません"
+
+msgid "Missing DNS answer packet"
+msgstr "DNSの返答パケットが欠如しています"
+
+msgid "Connection closed in DNS"
+msgstr "DNSの接続が閉じられました"
+
+msgid "Verification failed in DNS"
+msgstr "DNSで検証に失敗しました"
+
+msgid "DNS Timeout"
+msgstr "DNSタイムアウトです"
+
+msgid "General LDAP error"
+msgstr "一般LDAPエラーです"
+
+msgid "General LDAP attribute error"
+msgstr "一般LDAP属性エラーです"
+
+msgid "General LDAP name error"
+msgstr "一般LDAPエラーです"
+
+msgid "General LDAP security error"
+msgstr "一般Assuanエラーです"
+
+msgid "General LDAP service error"
+msgstr "一般LDAPサーバエラーです"
+
+msgid "General LDAP update error"
+msgstr "一般LDAP更新エラーです"
+
+msgid "Experimental LDAP error code"
+msgstr "実験的LDAPエラーコード"
+
+msgid "Private LDAP error code"
+msgstr "プライベートLDAPエラーコード"
+
+msgid "Other general LDAP error"
+msgstr "その他の一般LDAPエラーです"
+
+msgid "LDAP connecting failed (X)"
+msgstr "LDAP接続が失敗しました (X)"
+
+msgid "LDAP referral limit exceeded"
+msgstr "LDAP参照制限を越えました"
+
+msgid "LDAP client loop"
+msgstr "LDAPクライアントのループ"
+
+msgid "No LDAP results returned"
+msgstr "LDAPの結果が返されませんでした"
+
+msgid "LDAP control not found"
+msgstr "LDAP制御が見つかりませんでした"
+
+msgid "Not supported by LDAP"
+msgstr "LDAPでサポートされていません"
+
+msgid "LDAP connect error"
+msgstr "LDAP connectエラーです"
+
+msgid "Out of memory in LDAP"
+msgstr "LDAPでメモリがなくなりました"
+
+msgid "Bad parameter to an LDAP routine"
+msgstr "LDAPルーチンに対する不正なパラメータです"
+
+msgid "User cancelled LDAP operation"
+msgstr "ユーザがLDAP操作をキャンセルしました"
+
+msgid "Bad LDAP search filter"
+msgstr "誤ったLDAP検索フィルタです"
+
+msgid "Unknown LDAP authentication method"
+msgstr "不明のLDAP認証方式です"
+
+msgid "Timeout in LDAP"
+msgstr "LDAPでタイムアウトです"
+
+msgid "LDAP decoding error"
+msgstr "LDAPデコードのエラー"
+
+msgid "LDAP encoding error"
+msgstr "LDAPエンコードのエラー"
+
+msgid "LDAP local error"
+msgstr "LDAPローカルエラー"
+
+msgid "Cannot contact LDAP server"
+msgstr "LDAPサーバに連絡できません"
+
+msgid "LDAP success"
+msgstr "LDAP成功です"
+
+msgid "LDAP operations error"
+msgstr "LDAP操作エラーです"
+
+msgid "LDAP protocol error"
+msgstr "LDAPプロトコル違反"
+
+msgid "Time limit exceeded in LDAP"
+msgstr "LDAPで時間制限を越えました"
+
+msgid "Size limit exceeded in LDAP"
+msgstr "LDAPでサイズ制限を越えました"
+
+msgid "LDAP compare false"
+msgstr "LDAP比較 偽"
+
+msgid "LDAP compare true"
+msgstr "LDAP比較 真"
+
+msgid "LDAP authentication method not supported"
+msgstr "LDAP認証方式はサポートされません"
+
+msgid "Strong(er) LDAP authentication required"
+msgstr "強いLDAP認証が必要です"
+
+msgid "Partial LDAP results+referral received"
+msgstr "部分的LDAP結果/参照を受信しました"
+
+msgid "LDAP referral"
+msgstr "LDAP参照"
+
+msgid "Administrative LDAP limit exceeded"
+msgstr "管理LDAP制限を越えました"
+
+msgid "Critical LDAP extension is unavailable"
+msgstr "クリティカルなLDAP拡張が利用可能ではありません"
+
+msgid "Confidentiality required by LDAP"
+msgstr "LDAPにより秘匿性が必要です"
+
+msgid "LDAP SASL bind in progress"
+msgstr "LDAP SASLバインドが進んでいます"
+
+msgid "No such LDAP attribute"
+msgstr "そのようなLDAP属性がありません"
+
+msgid "Undefined LDAP attribute type"
+msgstr "未定義のLDAP属性型です"
+
+msgid "Inappropriate matching in LDAP"
+msgstr "LDAPの不適切なマッチングです"
+
+msgid "Constraint violation in LDAP"
+msgstr "LDAP制約違反です"
+
+msgid "LDAP type or value exists"
+msgstr "LDAP型あるいは値が存在します"
+
+msgid "Invalid syntax in LDAP"
+msgstr "LDAPの無効な構文です"
+
+msgid "No such LDAP object"
+msgstr "そのようなLDAPオブジェクトはありません"
+
+msgid "LDAP alias problem"
+msgstr "LDAPエイリアスの問題です"
+
+msgid "Invalid DN syntax in LDAP"
+msgstr "LDAPの無効なDN構文状態です"
+
+msgid "LDAP entry is a leaf"
+msgstr "LDAPエントリがリーフです"
+
+msgid "LDAP alias dereferencing problem"
+msgstr "LDAPエイリアスのデレファレンス問題です"
+
+msgid "LDAP proxy authorization failure (X)"
+msgstr "LDAPプロキシの認証失敗です(X)"
+
+msgid "Inappropriate LDAP authentication"
+msgstr "不適切なLDAP認証です"
+
+msgid "Invalid LDAP credentials"
+msgstr "無効なLDAPクレデンシャルです"
+
+msgid "Insufficient access for LDAP"
+msgstr "LDAPの不十分なアクセスです"
+
+msgid "LDAP server is busy"
+msgstr "LDAPサーバがビジーです"
+
+msgid "LDAP server is unavailable"
+msgstr "LDAPサーバが利用可能ではありません"
+
+msgid "LDAP server is unwilling to perform"
+msgstr "LDAPサーバが実行を進めたくありません"
+
+msgid "Loop detected by LDAP"
+msgstr "LDAPでループが検出されました"
+
+msgid "LDAP naming violation"
+msgstr "LDAP名前違反です"
+
+msgid "LDAP object class violation"
+msgstr "LDAPオブジェクトクラス違反です"
+
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "LDAP操作は非リーフには許されません"
+
+msgid "LDAP operation not allowed on RDN"
+msgstr "LDAP操作はRDNには許されません"
+
+msgid "Already exists (LDAP)"
+msgstr "既に存在します (LDAP)"
+
+msgid "Cannot modify LDAP object class"
+msgstr "LDAPオブジェクト・クラスを修正できません"
+
+msgid "LDAP results too large"
+msgstr "LDAP結果が大きすぎます"
+
+msgid "LDAP operation affects multiple DSAs"
+msgstr "LDAP操作は複数のDSAに関与します"
+
+msgid "Virtual LDAP list view error"
+msgstr "バーチャルLDAPリストviewエラー"
+
+msgid "Other LDAP error"
+msgstr "その他のLDAPエラーです"
+
+msgid "Resources exhausted in LCUP"
+msgstr "LCUPで資源を使い果たしました"
+
+msgid "Security violation in LCUP"
+msgstr "LCUPのセキュリティ違反"
+
+msgid "Invalid data in LCUP"
+msgstr "LCUPの無効なデータです"
+
+msgid "Unsupported scheme in LCUP"
+msgstr "LCUPのサポートされていないスキームです"
+
+msgid "Reload required in LCUP"
+msgstr "LCUPでリロードが必要です"
+
+msgid "LDAP cancelled"
+msgstr "LDAPがキャンセルされました"
+
+msgid "No LDAP operation to cancel"
+msgstr "キャンセルするLDAP操作がありません"
+
+msgid "Too late to cancel LDAP"
+msgstr "LDAPをキャンセルするには遅すぎます"
+
+msgid "Cannot cancel LDAP"
+msgstr "LDAPをキャンセルできません"
+
+msgid "LDAP assertion failed"
+msgstr "LDAPアサーションに失敗しました"
+
+msgid "Proxied authorization denied by LDAP"
+msgstr "LDAPでプロキシの認証が拒否されました"
+
+msgid "User defined error code 1"
+msgstr "ユーザ定義エラーコード 1"
+
+msgid "User defined error code 2"
+msgstr "ユーザ定義エラーコード 2"
+
+msgid "User defined error code 3"
+msgstr "ユーザ定義エラーコード 3"
+
+msgid "User defined error code 4"
+msgstr "ユーザ定義エラーコード 4"
+
+msgid "User defined error code 5"
+msgstr "ユーザ定義エラーコード 5"
+
+msgid "User defined error code 6"
+msgstr "ユーザ定義エラーコード 6"
+
+msgid "User defined error code 7"
+msgstr "ユーザ定義エラーコード 7"
+
+msgid "User defined error code 8"
+msgstr "ユーザ定義エラーコード 8"
+
+msgid "User defined error code 9"
+msgstr "ユーザ定義エラーコード 9"
+
+msgid "User defined error code 10"
+msgstr "ユーザ定義エラーコード 10"
+
+msgid "User defined error code 11"
+msgstr "ユーザ定義エラーコード 11"
+
+msgid "User defined error code 12"
+msgstr "ユーザ定義エラーコード 12"
+
+msgid "User defined error code 13"
+msgstr "ユーザ定義エラーコード 13"
+
+msgid "User defined error code 14"
+msgstr "ユーザ定義エラーコード 14"
+
+msgid "User defined error code 15"
+msgstr "ユーザ定義エラーコード 15"
+
+msgid "User defined error code 16"
+msgstr "ユーザ定義エラーコード 16"
+
+msgid "System error w/o errno"
+msgstr "errno が無いシステムエラー"
+
+msgid "Unknown system error"
+msgstr "不明なシステムエラー"
+
+msgid "End of file"
+msgstr "ファイル終端"
+
+msgid "Unknown error code"
+msgstr "不明なエラーコード"
+
+#, c-format
+msgid "Usage: %s GPG-ERROR [...]\n"
+msgstr "使用法: %s GPG-ERROR [...]\n"
+
+#, c-format
+msgid "%s: warning: could not recognize %s\n"
+msgstr "%s: 警告: %s を認識できませんでした\n"
+
+#~ msgid "Keyring open"
+#~ msgstr "鍵リングオープン"
diff --git a/po/nl.po b/po/nl.po
new file mode 100644
index 0000000..a174ee1
--- /dev/null
+++ b/po/nl.po
@@ -0,0 +1,1471 @@
+# translation of libgpg-error-1.10.nl.po to Dutch
+# Copyright (C) 2008 Free Software Foundation, Inc.
+# This file is distributed under the same license as the libgpg-error package.
+#
+# Freek de Kruijf <[email protected]>, 2009, 2010, 2012, 2014.
+msgid ""
+msgstr ""
+"Project-Id-Version: libgpg-error 1.10\n"
+"Report-Msgid-Bugs-To: [email protected]\n"
+"PO-Revision-Date: 2014-11-17 00:16+0100\n"
+"Last-Translator: Freek de Kruijf <[email protected]>\n"
+"Language-Team: Dutch <[email protected]>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Lokalize 1.5\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+
+msgid "Unspecified source"
+msgstr "Niet-gespecificeerde bron"
+
+msgid "gcrypt"
+msgstr "gcrypt"
+
+msgid "GnuPG"
+msgstr "GnuPG"
+
+msgid "GpgSM"
+msgstr "GpgSM"
+
+msgid "GPG Agent"
+msgstr "GPG-agent"
+
+msgid "Pinentry"
+msgstr "Pinentry"
+
+msgid "SCD"
+msgstr "SCD"
+
+msgid "GPGME"
+msgstr "GPGME"
+
+msgid "Keybox"
+msgstr "Keybox"
+
+msgid "KSBA"
+msgstr "KSBA"
+
+msgid "Dirmngr"
+msgstr "Dirmngr"
+
+msgid "GSTI"
+msgstr "GSTI"
+
+msgid "GPA"
+msgstr "GPA"
+
+msgid "Kleopatra"
+msgstr "Kleopatra"
+
+msgid "G13"
+msgstr "G13"
+
+msgid "Assuan"
+msgstr "Assuan"
+
+msgid "TLS"
+msgstr "TLS"
+
+msgid "Any source"
+msgstr "Elke bron"
+
+msgid "User defined source 1"
+msgstr "Gebruikergedefinieerde bron 1"
+
+msgid "User defined source 2"
+msgstr "Gebruikergedefinieerde bron 2"
+
+msgid "User defined source 3"
+msgstr "Gebruikergedefinieerde bron 3"
+
+msgid "User defined source 4"
+msgstr "Gebruikergedefinieerde bron 4"
+
+msgid "Unknown source"
+msgstr "Onbekende bron"
+
+msgid "Success"
+msgstr "Succes"
+
+msgid "General error"
+msgstr "Algemene fout"
+
+msgid "Unknown packet"
+msgstr "Onbekend pakket"
+
+msgid "Unknown version in packet"
+msgstr "Onbekende versie in pakket"
+
+msgid "Invalid public key algorithm"
+msgstr "Ongeldig algoritme voor publieke sleutel"
+
+msgid "Invalid digest algorithm"
+msgstr "Ongeldig digest-algoritme"
+
+msgid "Bad public key"
+msgstr "Foute publieke sleutel"
+
+msgid "Bad secret key"
+msgstr "Foute geheime sleutel"
+
+msgid "Bad signature"
+msgstr "Onjuiste ondertekening"
+
+msgid "No public key"
+msgstr "Geen publieke sleutel"
+
+msgid "Checksum error"
+msgstr "Fout in controlesom"
+
+msgid "Bad passphrase"
+msgstr "Ongeldige wachtwoordzin"
+
+msgid "Invalid cipher algorithm"
+msgstr "Ongeldig versleutelingsalgoritme"
+
+msgid "Cannot open keyring"
+msgstr "Sleutelring open"
+
+msgid "Invalid packet"
+msgstr "Ongeldig pakket"
+
+msgid "Invalid armor"
+msgstr "Ongeldige bepantsering"
+
+msgid "No user ID"
+msgstr "Geen gebruiker-ID"
+
+msgid "No secret key"
+msgstr "Geen geheime sleutel"
+
+msgid "Wrong secret key used"
+msgstr "Foute geheime sleutel gebruikt"
+
+msgid "Bad session key"
+msgstr "Foute sessiesleutel"
+
+msgid "Unknown compression algorithm"
+msgstr "Onbekend compressie-algoritme"
+
+msgid "Number is not prime"
+msgstr "Nummer is geen priemgetal"
+
+msgid "Invalid encoding method"
+msgstr "Ongeldige coderingsmethode"
+
+msgid "Invalid encryption scheme"
+msgstr "Ongeldig versleutelingsschema"
+
+msgid "Invalid signature scheme"
+msgstr "Ongeldig ondertekeningsschema"
+
+msgid "Invalid attribute"
+msgstr "Ongeldig attribuut"
+
+msgid "No value"
+msgstr "Geen waarde"
+
+msgid "Not found"
+msgstr "Niet gevonden"
+
+msgid "Value not found"
+msgstr "Waarde niet gevonden"
+
+msgid "Syntax error"
+msgstr "Syntaxfout"
+
+msgid "Bad MPI value"
+msgstr "Foute MPI-waarde"
+
+msgid "Invalid passphrase"
+msgstr "Ongeldige wachtwoordzin"
+
+msgid "Invalid signature class"
+msgstr "Ongeldige ondertekeningsklasse"
+
+msgid "Resources exhausted"
+msgstr "Hulpbronnen uitgeput"
+
+msgid "Invalid keyring"
+msgstr "Ongeldige sleutelring"
+
+msgid "Trust DB error"
+msgstr "Fout in vertrouwensDB"
+
+msgid "Bad certificate"
+msgstr "Fout certificaat"
+
+msgid "Invalid user ID"
+msgstr "Ongeldig gebruiker-ID"
+
+msgid "Unexpected error"
+msgstr "Onverwachte fout"
+
+msgid "Time conflict"
+msgstr "Tijdconflict"
+
+msgid "Keyserver error"
+msgstr "Fout in sleutelserver"
+
+msgid "Wrong public key algorithm"
+msgstr "Ongeldig algoritme voor publieke sleutel"
+
+msgid "Tribute to D. A."
+msgstr "Eerbetoon aan D. A."
+
+msgid "Weak encryption key"
+msgstr "Zwakke cryptografische sleutel"
+
+msgid "Invalid key length"
+msgstr "Ongeldige sleutellengte"
+
+msgid "Invalid argument"
+msgstr "Ongeldig argument"
+
+msgid "Syntax error in URI"
+msgstr "Syntaxfout in URI"
+
+msgid "Invalid URI"
+msgstr "Ongeldige URI"
+
+msgid "Network error"
+msgstr "Netwerkfout"
+
+msgid "Unknown host"
+msgstr "Onbekende host"
+
+msgid "Selftest failed"
+msgstr "Zelftest is mislukt"
+
+msgid "Data not encrypted"
+msgstr "Gegevens niet versleuteld"
+
+msgid "Data not processed"
+msgstr "Gegevens niet verwerkt"
+
+msgid "Unusable public key"
+msgstr "Onbruikbare publieke sleutel"
+
+msgid "Unusable secret key"
+msgstr "Onbruikbare geheime sleutel"
+
+msgid "Invalid value"
+msgstr "Ongeldige waarde"
+
+msgid "Bad certificate chain"
+msgstr "Foute certificaatketting"
+
+msgid "Missing certificate"
+msgstr "Ontbrekend certificaat"
+
+msgid "No data"
+msgstr "Geen gegevens"
+
+msgid "Bug"
+msgstr "Bug"
+
+msgid "Not supported"
+msgstr "Niet ondersteund"
+
+msgid "Invalid operation code"
+msgstr "Ongeldige bewerkingscode"
+
+msgid "Timeout"
+msgstr "Tijdslimiet"
+
+msgid "Internal error"
+msgstr "Interne fout"
+
+msgid "EOF (gcrypt)"
+msgstr "EOF (gcrypt)"
+
+msgid "Invalid object"
+msgstr "Ongeldig object"
+
+msgid "Provided object is too short"
+msgstr "Geleverd object is te kort"
+
+msgid "Provided object is too large"
+msgstr "Geleverd object is te groot"
+
+msgid "Missing item in object"
+msgstr "Ontbrekend item in object"
+
+msgid "Not implemented"
+msgstr "Niet geïmplementeerd"
+
+msgid "Conflicting use"
+msgstr "Conflicterend gebruik"
+
+msgid "Invalid cipher mode"
+msgstr "Ongeldige versleutelingsmodus"
+
+msgid "Invalid flag"
+msgstr "Ongeldige vlag"
+
+msgid "Invalid handle"
+msgstr "Ongeldige handel"
+
+msgid "Result truncated"
+msgstr "Resultaat is afgekapt"
+
+msgid "Incomplete line"
+msgstr "Onvolledige regel"
+
+msgid "Invalid response"
+msgstr "Ongeldige reactie"
+
+msgid "No agent running"
+msgstr "Er draait geen agent"
+
+msgid "Agent error"
+msgstr "Fout met agent"
+
+msgid "Invalid data"
+msgstr "Ongeldige gegevens"
+
+msgid "Unspecific Assuan server fault"
+msgstr "Ongespecificeerde fout in de Assuan-server"
+
+msgid "General Assuan error"
+msgstr "Algemene Assuan-fout"
+
+msgid "Invalid session key"
+msgstr "Ongeldige sessiesleutel"
+
+msgid "Invalid S-expression"
+msgstr "Ongeldige S-expressie"
+
+msgid "Unsupported algorithm"
+msgstr "Niet ondersteund algoritme"
+
+msgid "No pinentry"
+msgstr "Geen pin-item"
+
+msgid "pinentry error"
+msgstr "pin-item-fout"
+
+msgid "Bad PIN"
+msgstr "Verkeerde PIN"
+
+msgid "Invalid name"
+msgstr "Ongeldige naam"
+
+msgid "Bad data"
+msgstr "Slechte gegevens"
+
+msgid "Invalid parameter"
+msgstr "Ongeldige parameter "
+
+msgid "Wrong card"
+msgstr "Verkeerde kaart"
+
+msgid "No dirmngr"
+msgstr "Geen dirmngr"
+
+msgid "dirmngr error"
+msgstr "dirmngr-fout"
+
+msgid "Certificate revoked"
+msgstr "Certificaat is ingetrokken"
+
+msgid "No CRL known"
+msgstr "Geen CRL bekend"
+
+msgid "CRL too old"
+msgstr "CRL te oud"
+
+msgid "Line too long"
+msgstr "Regel te lang"
+
+msgid "Not trusted"
+msgstr "Niet vertrouwd"
+
+msgid "Operation cancelled"
+msgstr "Bewerking geannuleerd"
+
+msgid "Bad CA certificate"
+msgstr "Fout CA-certificaat"
+
+msgid "Certificate expired"
+msgstr "Certificaat verlopen"
+
+msgid "Certificate too young"
+msgstr "Certificaat te jong"
+
+msgid "Unsupported certificate"
+msgstr "Niet ondersteund certificaat"
+
+msgid "Unknown S-expression"
+msgstr "Onbekende S-expressie"
+
+msgid "Unsupported protection"
+msgstr "Niet ondersteunde bescherming"
+
+msgid "Corrupted protection"
+msgstr "Doorbroken bescherming"
+
+msgid "Ambiguous name"
+msgstr "Dubbelzinnige naam"
+
+msgid "Card error"
+msgstr "Kaartfout"
+
+msgid "Card reset required"
+msgstr "Reset van kaart vereist"
+
+msgid "Card removed"
+msgstr "Kaart verwijderd"
+
+msgid "Invalid card"
+msgstr "Ongeldige kaart"
+
+msgid "Card not present"
+msgstr "Kaart niet aanwezig"
+
+msgid "No PKCS15 application"
+msgstr "Geen PKCS15-toepassing"
+
+msgid "Not confirmed"
+msgstr "Niet bevestigd"
+
+msgid "Configuration error"
+msgstr "Configuratiefout"
+
+msgid "No policy match"
+msgstr "Geen overeenkomst met beleid"
+
+msgid "Invalid index"
+msgstr "Ongeldige index"
+
+msgid "Invalid ID"
+msgstr "Ongeldige ID"
+
+msgid "No SmartCard daemon"
+msgstr "Geen SmartCard-daemon"
+
+msgid "SmartCard daemon error"
+msgstr "SmartCard-daemon-fout"
+
+msgid "Unsupported protocol"
+msgstr "Niet ondersteund protocol"
+
+msgid "Bad PIN method"
+msgstr "Verkeerde PIN-methode"
+
+msgid "Card not initialized"
+msgstr "Kaart niet geïnitialiseerd"
+
+msgid "Unsupported operation"
+msgstr "Niet-ondersteunde operatie"
+
+msgid "Wrong key usage"
+msgstr "Verkeerd gebruik van sleutel"
+
+msgid "Nothing found"
+msgstr "Niets gevonden"
+
+msgid "Wrong blob type"
+msgstr "Verkeerde blob-type"
+
+msgid "Missing value"
+msgstr "Ontbrekende waarde"
+
+msgid "Hardware problem"
+msgstr "Hardwareprobleem"
+
+msgid "PIN blocked"
+msgstr "PIN geblokkeerd"
+
+msgid "Conditions of use not satisfied"
+msgstr "Aan voorwaarden voor gebruik wordt niet voldaan"
+
+msgid "PINs are not synced"
+msgstr "PIN's zijn niet gesynchroniseerd"
+
+msgid "Invalid CRL"
+msgstr "Ongeldige CRL"
+
+msgid "BER error"
+msgstr "BER-fout"
+
+msgid "Invalid BER"
+msgstr "Ongeldige BER"
+
+msgid "Element not found"
+msgstr "Element niet gevonden"
+
+msgid "Identifier not found"
+msgstr "Identifier niet gevonden"
+
+msgid "Invalid tag"
+msgstr "Ongeldige tag"
+
+msgid "Invalid length"
+msgstr "Ongeldige lengte"
+
+msgid "Invalid key info"
+msgstr "Ongeldige sleutelinformatie"
+
+msgid "Unexpected tag"
+msgstr "Onverwachte tag"
+
+msgid "Not DER encoded"
+msgstr "Niet met DER gecodeerd"
+
+msgid "No CMS object"
+msgstr "Geen CMS-object"
+
+msgid "Invalid CMS object"
+msgstr "Ongeldig CMS-object"
+
+msgid "Unknown CMS object"
+msgstr "Onbekend CMS-object"
+
+msgid "Unsupported CMS object"
+msgstr "Niet-ondersteund CMS-object"
+
+msgid "Unsupported encoding"
+msgstr "Niet-ondersteunde codering"
+
+msgid "Unsupported CMS version"
+msgstr "Niet-ondersteunde CMS-versie"
+
+msgid "Unknown algorithm"
+msgstr "Onbekend algoritme"
+
+msgid "Invalid crypto engine"
+msgstr "Ongeldige crypto-engine"
+
+msgid "Public key not trusted"
+msgstr "Publieke sleutel wordt niet vertrouwd"
+
+msgid "Decryption failed"
+msgstr "Ontcijfering is mislukt"
+
+msgid "Key expired"
+msgstr "Sleutel is verlopen"
+
+msgid "Signature expired"
+msgstr "Handtekening verlopen"
+
+msgid "Encoding problem"
+msgstr "Coderingsprobleem"
+
+msgid "Invalid state"
+msgstr "Ongeldige status"
+
+msgid "Duplicated value"
+msgstr "Gedupliceerde waarde"
+
+msgid "Missing action"
+msgstr "Ontbrekende actie"
+
+msgid "ASN.1 module not found"
+msgstr "ASN.1-module niet gevonden"
+
+msgid "Invalid OID string"
+msgstr "Ongeldige OID-tekenreeks"
+
+msgid "Invalid time"
+msgstr "Ongeldige tijd"
+
+msgid "Invalid CRL object"
+msgstr "Ongeldig CRL-object"
+
+msgid "Unsupported CRL version"
+msgstr "Niet-ondersteunde CRL-versie"
+
+msgid "Invalid certificate object"
+msgstr "Ongeldig certificaatobject"
+
+msgid "Unknown name"
+msgstr "Onbekende naam"
+
+msgid "A locale function failed"
+msgstr "Een lokale functie is mislukt"
+
+msgid "Not locked"
+msgstr "Niet vergrendeld"
+
+msgid "Protocol violation"
+msgstr "In strijd met protocol"
+
+msgid "Invalid MAC"
+msgstr "Ongeldige MAC"
+
+msgid "Invalid request"
+msgstr "Ongeldig verzoek"
+
+msgid "Unknown extension"
+msgstr "Onbekende extensie"
+
+msgid "Unknown critical extension"
+msgstr "Onbekende kritische extensie"
+
+msgid "Locked"
+msgstr "Vergrendeld"
+
+msgid "Unknown option"
+msgstr "Onbekende optie"
+
+msgid "Unknown command"
+msgstr "Onbekend commando"
+
+msgid "Not operational"
+msgstr "Niet in werking"
+
+msgid "No passphrase given"
+msgstr "Geen wachtwoordzin ingegeven"
+
+msgid "No PIN given"
+msgstr "Geen PIN ingegeven"
+
+msgid "Not enabled"
+msgstr "Niet ingeschakeld"
+
+msgid "No crypto engine"
+msgstr "Geen crypto-engine"
+
+msgid "Missing key"
+msgstr "Ontbrekende sleutel"
+
+msgid "Too many objects"
+msgstr "Te veel objecten"
+
+msgid "Limit reached"
+msgstr "Limiet bereikt"
+
+msgid "Not initialized"
+msgstr "Niet geïnitialiseerd"
+
+msgid "Missing issuer certificate"
+msgstr "Ontbrekend certificaat van uitgever"
+
+msgid "No keyserver available"
+msgstr "Geen sleutelserver beschikbaar"
+
+msgid "Invalid elliptic curve"
+msgstr "Ongeldige elliptische kromme"
+
+msgid "Unknown elliptic curve"
+msgstr "Onbekende elliptische kromme"
+
+msgid "Duplicated key"
+msgstr "Dubbele sleutel"
+
+msgid "Ambiguous result"
+msgstr "Dubbelzinnig resultaat"
+
+msgid "No crypto context"
+msgstr "Geen crypto-context"
+
+msgid "Wrong crypto context"
+msgstr "Verkeerde crypto-context"
+
+msgid "Bad crypto context"
+msgstr "Slechte crypto-context"
+
+msgid "Conflict in the crypto context"
+msgstr "Conflict in de crypto-context"
+
+msgid "Broken public key"
+msgstr "Gebroken publieke sleutel"
+
+msgid "Broken secret key"
+msgstr "Gebroken geheime sleutel"
+
+msgid "Invalid MAC algorithm"
+msgstr "Ongeldig MAC-algoritme"
+
+msgid "Operation fully cancelled"
+msgstr "Bewerking volledig geannuleerd"
+
+msgid "Operation not yet finished"
+msgstr "Bewerking is nog niet beëindigd"
+
+msgid "Buffer too short"
+msgstr "Buffer is te kort"
+
+msgid "Invalid length specifier in S-expression"
+msgstr "Ongeldige lengtespecificatie in S-expressie"
+
+msgid "String too long in S-expression"
+msgstr "Tekenreeks is te lang in S-expressie"
+
+msgid "Unmatched parentheses in S-expression"
+msgstr "Niet overeenkomende haakjes in S-expressie"
+
+msgid "S-expression not canonical"
+msgstr "S-expressie is niet canoniek"
+
+msgid "Bad character in S-expression"
+msgstr "Fout teken in S-expressie"
+
+msgid "Bad quotation in S-expression"
+msgstr "Foute aanhalingstekens in S-expressie"
+
+msgid "Zero prefix in S-expression"
+msgstr "Nul-prefix in S-expressie"
+
+msgid "Nested display hints in S-expression"
+msgstr "Geneste weergavetips in S-expressie"
+
+msgid "Unmatched display hints"
+msgstr "Niet overeenkomende weergavetips"
+
+msgid "Unexpected reserved punctuation in S-expression"
+msgstr "Onverwachte gereserveerde punctuatie in S-expressie"
+
+msgid "Bad hexadecimal character in S-expression"
+msgstr "Fout hexadecimaal teken in S-expressie"
+
+msgid "Odd hexadecimal numbers in S-expression"
+msgstr "Vreemde hexadecimale getallen in S-expressie"
+
+msgid "Bad octal character in S-expression"
+msgstr "Fout octaal teken in S-expressie"
+
+msgid "All subkeys are expired or revoked"
+msgstr ""
+
+#, fuzzy
+#| msgid "Data not encrypted"
+msgid "Database is corrupted"
+msgstr "Gegevens niet versleuteld"
+
+msgid "Server indicated a failure"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "No name"
+msgstr "Onbekende naam"
+
+#, fuzzy
+#| msgid "No public key"
+msgid "No key"
+msgstr "Geen publieke sleutel"
+
+msgid "Legacy key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Buffer too short"
+msgid "Request too short"
+msgstr "Buffer is te kort"
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "Request too long"
+msgstr "Regel te lang"
+
+msgid "Object is in termination state"
+msgstr ""
+
+msgid "No certificate chain"
+msgstr "Geen certificaatketting"
+
+msgid "Certificate is too large"
+msgstr "Certificaat te groot"
+
+msgid "Invalid record"
+msgstr "Ongeldig record"
+
+msgid "The MAC does not verify"
+msgstr "De MAC komt niet overeen"
+
+msgid "Unexpected message"
+msgstr "Onverwacht bericht"
+
+msgid "Compression or decompression failed"
+msgstr "Compressie of decompressie is mislukt"
+
+msgid "A counter would wrap"
+msgstr "Een teller loopt rond"
+
+msgid "Fatal alert message received"
+msgstr "Een alarmeringsbericht over iets fataal ontvangen "
+
+msgid "No cipher algorithm"
+msgstr "Geen versleutelingsalgoritme"
+
+msgid "Missing client certificate"
+msgstr "Ontbrekend certificaat van client"
+
+msgid "Close notification received"
+msgstr "Melding over sluiten ontvangen"
+
+msgid "Ticket expired"
+msgstr "Ticket is verlopen"
+
+msgid "Bad ticket"
+msgstr "Slecht ticket"
+
+msgid "Unknown identity"
+msgstr "Onbekende identiteit"
+
+msgid "Bad certificate message in handshake"
+msgstr "Slecht certificaatbericht in uitwisseling"
+
+msgid "Bad certificate request message in handshake"
+msgstr "Slecht verzoek om certificaatbericht in uitwisseling"
+
+msgid "Bad certificate verify message in handshake"
+msgstr "Slecht certificaatbericht over verificatie in uitwisseling"
+
+msgid "Bad change cipher message in handshake"
+msgstr "Slecht wijzigingsbericht over vercijfering in uitwisseling"
+
+msgid "Bad client hello message in handshake"
+msgstr "Slecht hello-bericht van client in uitwisseling"
+
+msgid "Bad server hello message in handshake"
+msgstr "Slecht hello-bericht van server in uitwisseling"
+
+msgid "Bad server hello done message in handshake"
+msgstr "Slecht hello-gedaan-bericht van server in uitwisseling"
+
+msgid "Bad finished message in handshake"
+msgstr "Slecht bericht over beëindiging in uitwisseling"
+
+msgid "Bad server key exchange message in handshake"
+msgstr "Slecht sleuteluitwisselingsbericht van server in uitwisseling"
+
+msgid "Bad client key exchange message in handshake"
+msgstr "Slecht sleuteluitwisselingsbericht van client in uitwisseling"
+
+msgid "Bogus string"
+msgstr "Onzintekenreeks"
+
+msgid "Forbidden"
+msgstr ""
+
+msgid "Key disabled"
+msgstr "Sleutel uitgeschakeld"
+
+msgid "Not possible with a card based key"
+msgstr "Niet mogelijk met een sleutel van een kaart"
+
+msgid "Invalid lock object"
+msgstr "Ongeldig vergrendelobject"
+
+msgid "True"
+msgstr ""
+
+msgid "False"
+msgstr ""
+
+msgid "General IPC error"
+msgstr "Algemene IPC-fout"
+
+msgid "IPC accept call failed"
+msgstr "IPC acceptatie-aanroep is mislukt"
+
+msgid "IPC connect call failed"
+msgstr "IPC verbindingsoproep is mislukt"
+
+msgid "Invalid IPC response"
+msgstr "Ongeldige IPC-reactie"
+
+msgid "Invalid value passed to IPC"
+msgstr "Ongeldige waarde naar IPC gestuurd"
+
+msgid "Incomplete line passed to IPC"
+msgstr "Onvolledige regel naar IPC gestuurd"
+
+msgid "Line passed to IPC too long"
+msgstr "Naar IPC gestuurde regel is te lang"
+
+msgid "Nested IPC commands"
+msgstr "Geneste IPC-commando's"
+
+msgid "No data callback in IPC"
+msgstr "Geen gegevens terugroep in IPC"
+
+msgid "No inquire callback in IPC"
+msgstr "Geen afvraagterugroep in IPC"
+
+msgid "Not an IPC server"
+msgstr "Geen IPC-server"
+
+msgid "Not an IPC client"
+msgstr "Geen IPC-client"
+
+msgid "Problem starting IPC server"
+msgstr "Probleem met opstarten van IPC-server"
+
+msgid "IPC read error"
+msgstr "IPC-leesfout"
+
+msgid "IPC write error"
+msgstr "IPC-schrijffout"
+
+msgid "Too much data for IPC layer"
+msgstr "Te veel gegevens voor IPC=laag"
+
+msgid "Unexpected IPC command"
+msgstr "Onverwacht IPC-commando"
+
+msgid "Unknown IPC command"
+msgstr "Onbekend IPC-commando"
+
+msgid "IPC syntax error"
+msgstr "IPC-syntaxfout"
+
+msgid "IPC call has been cancelled"
+msgstr "IPC-oproep is geannuleerd"
+
+msgid "No input source for IPC"
+msgstr "Geen invoerbron voor IPC"
+
+msgid "No output source for IPC"
+msgstr "Geen uitvoerbron voor IPC"
+
+msgid "IPC parameter error"
+msgstr "IPC-parameterfout"
+
+msgid "Unknown IPC inquire"
+msgstr "Onbekende IPC-afvraging"
+
+#, fuzzy
+#| msgid "No crypto engine"
+msgid "Crypto engine too old"
+msgstr "Geen crypto-engine"
+
+msgid "Screen or window too small"
+msgstr ""
+
+msgid "Screen or window too large"
+msgstr ""
+
+msgid "Required environment variable not set"
+msgstr ""
+
+msgid "User ID already exists"
+msgstr ""
+
+msgid "Name already exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated name"
+msgstr "Gedupliceerde waarde"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Object is too young"
+msgstr "Certificaat te jong"
+
+#, fuzzy
+#| msgid "Provided object is too short"
+msgid "Object is too old"
+msgstr "Geleverd object is te kort"
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Unknown flag"
+msgstr "Onbekende naam"
+
+#, fuzzy
+#| msgid "Invalid operation code"
+msgid "Invalid execution order"
+msgstr "Ongeldige bewerkingscode"
+
+msgid "Already fetched"
+msgstr ""
+
+msgid "Try again later"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Wrong name"
+msgstr "Onbekende naam"
+
+msgid "System bug detected"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown system error"
+msgid "Unknown DNS error"
+msgstr "Onbekende systeemfout"
+
+#, fuzzy
+#| msgid "Invalid OID string"
+msgid "Invalid DNS section"
+msgstr "Ongeldige OID-tekenreeks"
+
+#, fuzzy
+#| msgid "Invalid S-expression"
+msgid "Invalid textual address form"
+msgstr "Ongeldige S-expressie"
+
+#, fuzzy
+#| msgid "Missing issuer certificate"
+msgid "Missing DNS query packet"
+msgstr "Ontbrekend certificaat van uitgever"
+
+msgid "Missing DNS answer packet"
+msgstr ""
+
+msgid "Connection closed in DNS"
+msgstr ""
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "Verification failed in DNS"
+msgstr "Ontcijfering is mislukt"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "DNS Timeout"
+msgstr "Tijdslimiet"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "General LDAP error"
+msgstr "Algemene IPC-fout"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP attribute error"
+msgstr "Algemene fout"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP name error"
+msgstr "Algemene fout"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP security error"
+msgstr "Algemene Assuan-fout"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP service error"
+msgstr "Algemene fout"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP update error"
+msgstr "Algemene Assuan-fout"
+
+msgid "Experimental LDAP error code"
+msgstr ""
+
+#, fuzzy
+#| msgid "IPC write error"
+msgid "Private LDAP error code"
+msgstr "IPC-schrijffout"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other general LDAP error"
+msgstr "Algemene IPC-fout"
+
+#, fuzzy
+#| msgid "IPC connect call failed"
+msgid "LDAP connecting failed (X)"
+msgstr "IPC verbindingsoproep is mislukt"
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral limit exceeded"
+msgstr "Algemene fout"
+
+msgid "LDAP client loop"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "No LDAP results returned"
+msgstr "Reset van kaart vereist"
+
+#, fuzzy
+#| msgid "Element not found"
+msgid "LDAP control not found"
+msgstr "Element niet gevonden"
+
+#, fuzzy
+#| msgid "Not supported"
+msgid "Not supported by LDAP"
+msgstr "Niet ondersteund"
+
+#, fuzzy
+#| msgid "Unexpected error"
+msgid "LDAP connect error"
+msgstr "Onverwachte fout"
+
+msgid "Out of memory in LDAP"
+msgstr ""
+
+msgid "Bad parameter to an LDAP routine"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported operation"
+msgid "User cancelled LDAP operation"
+msgstr "Niet-ondersteunde operatie"
+
+#, fuzzy
+#| msgid "Bad certificate"
+msgid "Bad LDAP search filter"
+msgstr "Fout certificaat"
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "Unknown LDAP authentication method"
+msgstr "Onbekende extensie"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "Timeout in LDAP"
+msgstr "Tijdslimiet"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP decoding error"
+msgstr "dirmngr-fout"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP encoding error"
+msgstr "dirmngr-fout"
+
+#, fuzzy
+#| msgid "IPC read error"
+msgid "LDAP local error"
+msgstr "IPC-leesfout"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot contact LDAP server"
+msgstr "Geen IPC-server"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP success"
+msgstr "Succes"
+
+#, fuzzy
+#| msgid "Configuration error"
+msgid "LDAP operations error"
+msgstr "Configuratiefout"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP protocol error"
+msgstr "In strijd met protocol"
+
+msgid "Time limit exceeded in LDAP"
+msgstr ""
+
+msgid "Size limit exceeded in LDAP"
+msgstr ""
+
+msgid "LDAP compare false"
+msgstr ""
+
+msgid "LDAP compare true"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "LDAP authentication method not supported"
+msgstr "Onbekende extensie"
+
+msgid "Strong(er) LDAP authentication required"
+msgstr ""
+
+#, fuzzy
+#| msgid "Fatal alert message received"
+msgid "Partial LDAP results+referral received"
+msgstr "Een alarmeringsbericht over iets fataal ontvangen "
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral"
+msgstr "Algemene fout"
+
+msgid "Administrative LDAP limit exceeded"
+msgstr ""
+
+msgid "Critical LDAP extension is unavailable"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Confidentiality required by LDAP"
+msgstr "Reset van kaart vereist"
+
+msgid "LDAP SASL bind in progress"
+msgstr ""
+
+msgid "No such LDAP attribute"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid attribute"
+msgid "Undefined LDAP attribute type"
+msgstr "Ongeldig attribuut"
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate matching in LDAP"
+msgstr "Niet ondersteunde bescherming"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Constraint violation in LDAP"
+msgstr "In strijd met protocol"
+
+msgid "LDAP type or value exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid syntax in LDAP"
+msgstr "Ongeldige status"
+
+#, fuzzy
+#| msgid "No CMS object"
+msgid "No such LDAP object"
+msgstr "Geen CMS-object"
+
+#, fuzzy
+#| msgid "Hardware problem"
+msgid "LDAP alias problem"
+msgstr "Hardwareprobleem"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid DN syntax in LDAP"
+msgstr "Ongeldige status"
+
+msgid "LDAP entry is a leaf"
+msgstr ""
+
+#, fuzzy
+#| msgid "Encoding problem"
+msgid "LDAP alias dereferencing problem"
+msgstr "Coderingsprobleem"
+
+msgid "LDAP proxy authorization failure (X)"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate LDAP authentication"
+msgstr "Niet ondersteunde bescherming"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid LDAP credentials"
+msgstr "Ongeldige kaart"
+
+msgid "Insufficient access for LDAP"
+msgstr ""
+
+msgid "LDAP server is busy"
+msgstr ""
+
+#, fuzzy
+#| msgid "No keyserver available"
+msgid "LDAP server is unavailable"
+msgstr "Geen sleutelserver beschikbaar"
+
+msgid "LDAP server is unwilling to perform"
+msgstr ""
+
+msgid "Loop detected by LDAP"
+msgstr ""
+
+#, fuzzy
+#| msgid "Missing action"
+msgid "LDAP naming violation"
+msgstr "Ontbrekende actie"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP object class violation"
+msgstr "In strijd met protocol"
+
+#, fuzzy
+#| msgid "Operation not yet finished"
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "Bewerking is nog niet beëindigd"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation not allowed on RDN"
+msgstr "Bewerking geannuleerd"
+
+msgid "Already exists (LDAP)"
+msgstr ""
+
+msgid "Cannot modify LDAP object class"
+msgstr ""
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "LDAP results too large"
+msgstr "Regel te lang"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation affects multiple DSAs"
+msgstr "Bewerking geannuleerd"
+
+msgid "Virtual LDAP list view error"
+msgstr ""
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other LDAP error"
+msgstr "Algemene IPC-fout"
+
+#, fuzzy
+#| msgid "Resources exhausted"
+msgid "Resources exhausted in LCUP"
+msgstr "Hulpbronnen uitgeput"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Security violation in LCUP"
+msgstr "In strijd met protocol"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid data in LCUP"
+msgstr "Ongeldige status"
+
+#, fuzzy
+#| msgid "Unsupported certificate"
+msgid "Unsupported scheme in LCUP"
+msgstr "Niet ondersteund certificaat"
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Reload required in LCUP"
+msgstr "Reset van kaart vereist"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP cancelled"
+msgstr "Succes"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "No LDAP operation to cancel"
+msgstr "Niet in werking"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "Too late to cancel LDAP"
+msgstr "Niet in werking"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot cancel LDAP"
+msgstr "Geen IPC-server"
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "LDAP assertion failed"
+msgstr "Ontcijfering is mislukt"
+
+msgid "Proxied authorization denied by LDAP"
+msgstr ""
+
+msgid "User defined error code 1"
+msgstr "Gebruikergedefinieerde foutcode 1"
+
+msgid "User defined error code 2"
+msgstr "Gebruikergedefinieerde foutcode 2"
+
+msgid "User defined error code 3"
+msgstr "Gebruikergedefinieerde foutcode 3"
+
+msgid "User defined error code 4"
+msgstr "Gebruikergedefinieerde foutcode 4"
+
+msgid "User defined error code 5"
+msgstr "Gebruikergedefinieerde foutcode 5"
+
+msgid "User defined error code 6"
+msgstr "Gebruikergedefinieerde foutcode 6"
+
+msgid "User defined error code 7"
+msgstr "Gebruikergedefinieerde foutcode 7"
+
+msgid "User defined error code 8"
+msgstr "Gebruikergedefinieerde foutcode 8"
+
+msgid "User defined error code 9"
+msgstr "Gebruikergedefinieerde foutcode 9"
+
+msgid "User defined error code 10"
+msgstr "Gebruikergedefinieerde foutcode 10"
+
+msgid "User defined error code 11"
+msgstr "Gebruikergedefinieerde foutcode 11"
+
+msgid "User defined error code 12"
+msgstr "Gebruikergedefinieerde foutcode 12"
+
+msgid "User defined error code 13"
+msgstr "Gebruikergedefinieerde foutcode 13"
+
+msgid "User defined error code 14"
+msgstr "Gebruikergedefinieerde foutcode 14"
+
+msgid "User defined error code 15"
+msgstr "Gebruikergedefinieerde foutcode 15"
+
+msgid "User defined error code 16"
+msgstr "Gebruikergedefinieerde foutcode 16"
+
+msgid "System error w/o errno"
+msgstr "Systeemfout zonder foutnr."
+
+msgid "Unknown system error"
+msgstr "Onbekende systeemfout"
+
+msgid "End of file"
+msgstr "Einde van bestand"
+
+msgid "Unknown error code"
+msgstr "Onbekende foutcode"
+
+#, c-format
+msgid "Usage: %s GPG-ERROR [...]\n"
+msgstr "Gebruik: %s GPG-ERROR [...]\n"
+
+#, c-format
+msgid "%s: warning: could not recognize %s\n"
+msgstr "%s: waarschuwing: kon %s niet herkennen\n"
+
+#, fuzzy
+#~| msgid "Resources exhausted"
+#~ msgid "LCUP Resources exhausted"
+#~ msgstr "Hulpbronnen uitgeput"
+
+#, fuzzy
+#~| msgid "Invalid data"
+#~ msgid "LCUP Invalid data"
+#~ msgstr "Ongeldige gegevens"
+
+#, fuzzy
+#~| msgid "General error"
+#~ msgid "LDAP Other general error"
+#~ msgstr "Algemene fout"
+
+#, fuzzy
+#~| msgid "dirmngr error"
+#~ msgid "Encoding error"
+#~ msgstr "dirmngr-fout"
diff --git a/po/pl.po b/po/pl.po
new file mode 100644
index 0000000..3aee7e6
--- /dev/null
+++ b/po/pl.po
@@ -0,0 +1,1329 @@
+# Polish translation for libgpg-error.
+# Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+# This file is distributed under the same license as the libgpg-error package.
+# Jakub Bogusz <[email protected]>, 2004-2016.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: libgpg-error 1.22\n"
+"Report-Msgid-Bugs-To: [email protected]\n"
+"PO-Revision-Date: 2016-05-11 18:02+0200\n"
+"Last-Translator: Jakub Bogusz <[email protected]>\n"
+"Language-Team: Polish <[email protected]>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "Unspecified source"
+msgstr "Nie podane źródło"
+
+msgid "gcrypt"
+msgstr "gcrypt"
+
+msgid "GnuPG"
+msgstr "GnuPG"
+
+msgid "GpgSM"
+msgstr "GpgSM"
+
+msgid "GPG Agent"
+msgstr "Agent GPG"
+
+msgid "Pinentry"
+msgstr "Pinentry"
+
+msgid "SCD"
+msgstr "SCD"
+
+msgid "GPGME"
+msgstr "GPGME"
+
+msgid "Keybox"
+msgstr "Keybox"
+
+msgid "KSBA"
+msgstr "KSBA"
+
+msgid "Dirmngr"
+msgstr "Dirmngr"
+
+msgid "GSTI"
+msgstr "GSTI"
+
+msgid "GPA"
+msgstr "GPA"
+
+msgid "Kleopatra"
+msgstr "Kleopatra"
+
+msgid "G13"
+msgstr "G13"
+
+msgid "Assuan"
+msgstr "Assuan"
+
+msgid "TLS"
+msgstr "TLS"
+
+msgid "Any source"
+msgstr "Dowolne źródło"
+
+msgid "User defined source 1"
+msgstr "Zdefiniowane przez użytkownika źródło 1"
+
+msgid "User defined source 2"
+msgstr "Zdefiniowane przez użytkownika źródło 2"
+
+msgid "User defined source 3"
+msgstr "Zdefiniowane przez użytkownika źródło 3"
+
+msgid "User defined source 4"
+msgstr "Zdefiniowane przez użytkownika źródło 4"
+
+msgid "Unknown source"
+msgstr "Nieznane źródło"
+
+msgid "Success"
+msgstr "Sukces"
+
+msgid "General error"
+msgstr "Błąd ogólny"
+
+msgid "Unknown packet"
+msgstr "Nieznany pakiet"
+
+msgid "Unknown version in packet"
+msgstr "Nieznana wersja w pakiecie"
+
+msgid "Invalid public key algorithm"
+msgstr "Niepoprawny algorytm klucza publicznego"
+
+msgid "Invalid digest algorithm"
+msgstr "Niepoprawny algorytm skrótu"
+
+msgid "Bad public key"
+msgstr "Błędny klucz publiczny"
+
+msgid "Bad secret key"
+msgstr "Błędny klucz tajny"
+
+msgid "Bad signature"
+msgstr "Błędna sygnatura"
+
+msgid "No public key"
+msgstr "Brak klucza publicznego"
+
+msgid "Checksum error"
+msgstr "Błąd sumy kontrolnej"
+
+msgid "Bad passphrase"
+msgstr "Błędne hasło"
+
+msgid "Invalid cipher algorithm"
+msgstr "Niepoprawny algorytm szyfru"
+
+msgid "Cannot open keyring"
+msgstr "Zbiór kluczy otwarty"
+
+msgid "Invalid packet"
+msgstr "Niepoprawny pakiet"
+
+msgid "Invalid armor"
+msgstr "Niepoprawne opakowanie"
+
+msgid "No user ID"
+msgstr "Brak identyfikatora użytkownika"
+
+msgid "No secret key"
+msgstr "Brak klucza tajnego"
+
+msgid "Wrong secret key used"
+msgstr "Użyto niewłaściwego klucza tajnego"
+
+msgid "Bad session key"
+msgstr "Błędny klucz sesji"
+
+msgid "Unknown compression algorithm"
+msgstr "Nieznany algorytm kompresji"
+
+msgid "Number is not prime"
+msgstr "Liczba nie jest pierwsza"
+
+msgid "Invalid encoding method"
+msgstr "Niepoprawna metoda kodowania"
+
+msgid "Invalid encryption scheme"
+msgstr "Niepoprawny układ szyfrowania"
+
+msgid "Invalid signature scheme"
+msgstr "Niepoprawny układ sygnatury"
+
+msgid "Invalid attribute"
+msgstr "Niepoprawny atrybut"
+
+msgid "No value"
+msgstr "Brak wartości"
+
+msgid "Not found"
+msgstr "Nie znaleziono"
+
+msgid "Value not found"
+msgstr "Wartość nie znaleziona"
+
+msgid "Syntax error"
+msgstr "Błąd składni"
+
+msgid "Bad MPI value"
+msgstr "Błędna wartość MPI"
+
+msgid "Invalid passphrase"
+msgstr "Niepoprawne hasło"
+
+msgid "Invalid signature class"
+msgstr "Niepoprawna klasa sygnatury"
+
+msgid "Resources exhausted"
+msgstr "Zasoby wyczerpane"
+
+msgid "Invalid keyring"
+msgstr "Niepoprawny zbiór kluczy"
+
+msgid "Trust DB error"
+msgstr "Błąd bazy zaufania"
+
+msgid "Bad certificate"
+msgstr "Błędny certyfikat"
+
+msgid "Invalid user ID"
+msgstr "Niepoprawny identyfikator użytkownika"
+
+msgid "Unexpected error"
+msgstr "Nieoczekiwany błąd"
+
+msgid "Time conflict"
+msgstr "Konflikt czasu"
+
+msgid "Keyserver error"
+msgstr "Błąd serwera kluczy"
+
+msgid "Wrong public key algorithm"
+msgstr "Niewłaściwy algorytm klucza publicznego"
+
+msgid "Tribute to D. A."
+msgstr "Pamięci D. A."
+
+msgid "Weak encryption key"
+msgstr "Słaby klucz szyfrowania"
+
+msgid "Invalid key length"
+msgstr "Niepoprawna długość klucza"
+
+msgid "Invalid argument"
+msgstr "Niepoprawny argument"
+
+msgid "Syntax error in URI"
+msgstr "Błąd składni w URI"
+
+msgid "Invalid URI"
+msgstr "Błędne URI"
+
+msgid "Network error"
+msgstr "Błąd sieci"
+
+msgid "Unknown host"
+msgstr "Nieznany host"
+
+msgid "Selftest failed"
+msgstr "Test wewnętrzny nie powiódł się"
+
+msgid "Data not encrypted"
+msgstr "Dane nie zaszyfrowane"
+
+msgid "Data not processed"
+msgstr "Dane nie przetworzone"
+
+msgid "Unusable public key"
+msgstr "Bezużyteczny klucz publiczny"
+
+msgid "Unusable secret key"
+msgstr "Bezużyteczny klucz tajny"
+
+msgid "Invalid value"
+msgstr "Niepoprawna wartość"
+
+msgid "Bad certificate chain"
+msgstr "Błędny łańcuch certyfikatów"
+
+msgid "Missing certificate"
+msgstr "Brakujący certyfikat"
+
+msgid "No data"
+msgstr "Brak danych"
+
+msgid "Bug"
+msgstr "Błąd w kodzie"
+
+msgid "Not supported"
+msgstr "Nie obsługiwane"
+
+msgid "Invalid operation code"
+msgstr "Niepoprawny kod operacji"
+
+msgid "Timeout"
+msgstr "Upłynął limit czasu"
+
+msgid "Internal error"
+msgstr "Błąd wewnętrzny"
+
+msgid "EOF (gcrypt)"
+msgstr "Koniec pliku (gcrypt)"
+
+msgid "Invalid object"
+msgstr "Niepoprawny obiekt"
+
+msgid "Provided object is too short"
+msgstr "Dostarczony obiekt jest zbyt mały"
+
+msgid "Provided object is too large"
+msgstr "Dostarczony obiekt jest zbyt duży"
+
+msgid "Missing item in object"
+msgstr "Brak elementu w obiekcie"
+
+msgid "Not implemented"
+msgstr "Nie zaimplementowane"
+
+msgid "Conflicting use"
+msgstr "Konflikt użycia"
+
+msgid "Invalid cipher mode"
+msgstr "Niepoprawny tryb szyfru"
+
+msgid "Invalid flag"
+msgstr "Niepoprawna flaga"
+
+msgid "Invalid handle"
+msgstr "Niepoprawny uchwyt"
+
+msgid "Result truncated"
+msgstr "Wynik skrócony"
+
+msgid "Incomplete line"
+msgstr "Niekompletna linia"
+
+msgid "Invalid response"
+msgstr "Niepoprawna odpowiedź"
+
+msgid "No agent running"
+msgstr "Agent nie uruchomiony"
+
+msgid "Agent error"
+msgstr "Błąd agenta"
+
+msgid "Invalid data"
+msgstr "Niepoprawne dane"
+
+msgid "Unspecific Assuan server fault"
+msgstr "Nieokreślone niepowodzenie serwera Assuan"
+
+msgid "General Assuan error"
+msgstr "Błąd ogólny Assuana"
+
+msgid "Invalid session key"
+msgstr "Niepoprawny klucz sesji"
+
+msgid "Invalid S-expression"
+msgstr "Niepoprawne S-wyrażenie"
+
+msgid "Unsupported algorithm"
+msgstr "Nieobsługiwany algorytn"
+
+msgid "No pinentry"
+msgstr "Brak pinentry"
+
+msgid "pinentry error"
+msgstr "Błąd pinentry"
+
+msgid "Bad PIN"
+msgstr "Błędny PIN"
+
+msgid "Invalid name"
+msgstr "Niepoprawna nazwa"
+
+msgid "Bad data"
+msgstr "Błędne dane"
+
+msgid "Invalid parameter"
+msgstr "Niepoprawny parametr"
+
+msgid "Wrong card"
+msgstr "Niewłaściwa karta"
+
+msgid "No dirmngr"
+msgstr "Brak dirmngr"
+
+msgid "dirmngr error"
+msgstr "Błąd dirmngr"
+
+msgid "Certificate revoked"
+msgstr "Certyfikat anulowany"
+
+msgid "No CRL known"
+msgstr "Nieznane CRL"
+
+msgid "CRL too old"
+msgstr "CRL zbyt stare"
+
+msgid "Line too long"
+msgstr "Linia zbyt długa"
+
+msgid "Not trusted"
+msgstr "Nie zaufany"
+
+msgid "Operation cancelled"
+msgstr "Operacja anulowana"
+
+msgid "Bad CA certificate"
+msgstr "Błędny certyfikat CA"
+
+msgid "Certificate expired"
+msgstr "Certyfikat wygasł"
+
+msgid "Certificate too young"
+msgstr "Certyfikat zbyt młody"
+
+msgid "Unsupported certificate"
+msgstr "Nieobsługiwany certyfikat"
+
+msgid "Unknown S-expression"
+msgstr "Nieznane S-wyrażenie"
+
+msgid "Unsupported protection"
+msgstr "Nieobsługiwane zabezpieczenie"
+
+msgid "Corrupted protection"
+msgstr "Uszkodzone zabezpieczenie"
+
+msgid "Ambiguous name"
+msgstr "Niejednoznaczna nazwa"
+
+msgid "Card error"
+msgstr "Błąd karty"
+
+msgid "Card reset required"
+msgstr "Wymagany reset karty"
+
+msgid "Card removed"
+msgstr "Karta wyciągnięta"
+
+msgid "Invalid card"
+msgstr "Niepoprawna karta"
+
+msgid "Card not present"
+msgstr "Karta nieobecna"
+
+msgid "No PKCS15 application"
+msgstr "Brak aplikacji PKCS15"
+
+msgid "Not confirmed"
+msgstr "Brak potwierdzenia"
+
+msgid "Configuration error"
+msgstr "Błąd konfiguracji"
+
+msgid "No policy match"
+msgstr "Brak zgodności polityki"
+
+msgid "Invalid index"
+msgstr "Niepoprawny indeks"
+
+msgid "Invalid ID"
+msgstr "Niepoprawny identyfikator"
+
+msgid "No SmartCard daemon"
+msgstr "Brak demona SmartCard"
+
+msgid "SmartCard daemon error"
+msgstr "Błąd demona SmartCard"
+
+msgid "Unsupported protocol"
+msgstr "Nieobsługiwany protokół"
+
+msgid "Bad PIN method"
+msgstr "Błędna metoda PIN-u"
+
+msgid "Card not initialized"
+msgstr "Karta nie zainicjowana"
+
+msgid "Unsupported operation"
+msgstr "Nieobsługiwana operacja"
+
+msgid "Wrong key usage"
+msgstr "Niewłaściwe użycie klucza"
+
+msgid "Nothing found"
+msgstr "Nic nie znaleziono"
+
+msgid "Wrong blob type"
+msgstr "Niewłaściwy typ blob"
+
+msgid "Missing value"
+msgstr "Brak wartości"
+
+msgid "Hardware problem"
+msgstr "Problem sprzętowy"
+
+msgid "PIN blocked"
+msgstr "PIN zablokowany"
+
+msgid "Conditions of use not satisfied"
+msgstr "Warunki użycia nie spełnione"
+
+msgid "PINs are not synced"
+msgstr "PIN-y nie zsynchronizowane"
+
+msgid "Invalid CRL"
+msgstr "Niepoprawne CRL"
+
+msgid "BER error"
+msgstr "Błąd BER"
+
+msgid "Invalid BER"
+msgstr "Niepoprawne BER"
+
+msgid "Element not found"
+msgstr "Element nie znaleziony"
+
+msgid "Identifier not found"
+msgstr "Identyfikator nie znaleziony"
+
+msgid "Invalid tag"
+msgstr "Niepoprawny znacznik"
+
+msgid "Invalid length"
+msgstr "Niepoprawna długość"
+
+msgid "Invalid key info"
+msgstr "Niepoprawna informacja klucza"
+
+msgid "Unexpected tag"
+msgstr "Nieoczekiwany znacznik"
+
+msgid "Not DER encoded"
+msgstr "Nie zakodowane DER"
+
+msgid "No CMS object"
+msgstr "Brak obiektu CMS"
+
+msgid "Invalid CMS object"
+msgstr "Niepoprawny obiekt CMS"
+
+msgid "Unknown CMS object"
+msgstr "Nieznany obiekt CMS"
+
+msgid "Unsupported CMS object"
+msgstr "Nieobsługiwany obiekt CMS"
+
+msgid "Unsupported encoding"
+msgstr "Nieobsługiwane kodowanie"
+
+msgid "Unsupported CMS version"
+msgstr "Nieobsługiwana wersja CMS"
+
+msgid "Unknown algorithm"
+msgstr "Nieznany algorytm"
+
+msgid "Invalid crypto engine"
+msgstr "Niepoprawny silnik kryptograficzny"
+
+msgid "Public key not trusted"
+msgstr "Klucz publiczny nie zaufany"
+
+msgid "Decryption failed"
+msgstr "Odszyfrowywanie nie powiodło się"
+
+msgid "Key expired"
+msgstr "Klucz wygasł"
+
+msgid "Signature expired"
+msgstr "Sygnatura wygasła"
+
+msgid "Encoding problem"
+msgstr "Problem z kodowaniem"
+
+msgid "Invalid state"
+msgstr "Niepoprawny stan"
+
+msgid "Duplicated value"
+msgstr "Powtórzona wartość"
+
+msgid "Missing action"
+msgstr "Brak akcji"
+
+msgid "ASN.1 module not found"
+msgstr "Nie znaleziono modułu ASN.1"
+
+msgid "Invalid OID string"
+msgstr "Niepoprawny łańcuch OID"
+
+msgid "Invalid time"
+msgstr "Niepoprawny czas"
+
+msgid "Invalid CRL object"
+msgstr "Niepoprawny obiekt CRL"
+
+msgid "Unsupported CRL version"
+msgstr "Nieobsługiwana wersja CRL"
+
+msgid "Invalid certificate object"
+msgstr "Niepoprawny obiekt certyfikatu"
+
+msgid "Unknown name"
+msgstr "Nieznana nazwa"
+
+msgid "A locale function failed"
+msgstr "Funkcja lokalizacji nie powiodła się"
+
+msgid "Not locked"
+msgstr "Nie zablokowany"
+
+msgid "Protocol violation"
+msgstr "Naruszenie protokołu"
+
+msgid "Invalid MAC"
+msgstr "Niepoprawny MAC"
+
+msgid "Invalid request"
+msgstr "Niepoprawne żądanie"
+
+msgid "Unknown extension"
+msgstr "Nieznane rozszerzenie"
+
+msgid "Unknown critical extension"
+msgstr "Nieznane rozszerzenie krytyczne"
+
+msgid "Locked"
+msgstr "Zablokowany"
+
+msgid "Unknown option"
+msgstr "Nieznana opcja"
+
+msgid "Unknown command"
+msgstr "Nieznane polecenie"
+
+msgid "Not operational"
+msgstr "Nie gotowy"
+
+msgid "No passphrase given"
+msgstr "Nie podano hasła"
+
+msgid "No PIN given"
+msgstr "Nie podano PIN-u"
+
+msgid "Not enabled"
+msgstr "Nie włączony"
+
+msgid "No crypto engine"
+msgstr "Brak silnika kryptograficznego"
+
+msgid "Missing key"
+msgstr "Brak klucza"
+
+msgid "Too many objects"
+msgstr "Zbyt dużo obiektów"
+
+msgid "Limit reached"
+msgstr "Osiągnięto limit"
+
+msgid "Not initialized"
+msgstr "Nie zainicjowano"
+
+msgid "Missing issuer certificate"
+msgstr "Brak certyfikatu wystawcy"
+
+msgid "No keyserver available"
+msgstr "Brak dostępnego serwera kluczy"
+
+msgid "Invalid elliptic curve"
+msgstr "Błędna krzywa eliptyczna"
+
+msgid "Unknown elliptic curve"
+msgstr "Nieznana krzywa eliptyczna"
+
+msgid "Duplicated key"
+msgstr "Powtórzony klucz"
+
+msgid "Ambiguous result"
+msgstr "Niejednoznaczny wynik"
+
+msgid "No crypto context"
+msgstr "Brak kontekstu kryptograficznego"
+
+msgid "Wrong crypto context"
+msgstr "Niewłaściwy kontekst kryptograficzny"
+
+msgid "Bad crypto context"
+msgstr "Błędny kontekst kryptograficzny"
+
+msgid "Conflict in the crypto context"
+msgstr "Konflikt w kontekście kryptograficznym"
+
+msgid "Broken public key"
+msgstr "Uszkodzony klucz publiczny"
+
+msgid "Broken secret key"
+msgstr "Uszkodzony klucz tajny"
+
+msgid "Invalid MAC algorithm"
+msgstr "Niepoprawny algorytm MAC"
+
+msgid "Operation fully cancelled"
+msgstr "Operacja całkowicie anulowana"
+
+msgid "Operation not yet finished"
+msgstr "Operacja jeszcze nie zakończona"
+
+msgid "Buffer too short"
+msgstr "Bufor zbyt mały"
+
+msgid "Invalid length specifier in S-expression"
+msgstr "Niepoprawne określenie długości w S-wyrażeniu"
+
+msgid "String too long in S-expression"
+msgstr "Zbyt długi łańcuch w S-wyrażeniu"
+
+msgid "Unmatched parentheses in S-expression"
+msgstr "Niedopasowane nawiasy w S-wyrażeniu"
+
+msgid "S-expression not canonical"
+msgstr "S-wyrażenie nie kanoniczne"
+
+msgid "Bad character in S-expression"
+msgstr "Błędny znak w S-wyrażeniu"
+
+msgid "Bad quotation in S-expression"
+msgstr "Błędne cytowanie w S-wyrażeniu"
+
+msgid "Zero prefix in S-expression"
+msgstr "Zerowy prefiks w S-wyrażeniu"
+
+msgid "Nested display hints in S-expression"
+msgstr "Zagnieżdżone podpowiedzi wyświetlania w S-wyrażeniu"
+
+msgid "Unmatched display hints"
+msgstr "Niedopasowane podpowiedzi wyświetlania"
+
+msgid "Unexpected reserved punctuation in S-expression"
+msgstr "Nieoczekiwany zarezerwowany znak w S-wyrażeniu"
+
+msgid "Bad hexadecimal character in S-expression"
+msgstr "Błędny znak szesnastkowy w S-wyrażeniu"
+
+msgid "Odd hexadecimal numbers in S-expression"
+msgstr "Nieparzysta liczba cyfr szesnastkowych w S-wyrażeniu"
+
+msgid "Bad octal character in S-expression"
+msgstr "Błędny znak ósemkowy w S-wyrażeniu"
+
+msgid "All subkeys are expired or revoked"
+msgstr ""
+
+msgid "Database is corrupted"
+msgstr "Baza danych jest uszkodzona"
+
+msgid "Server indicated a failure"
+msgstr "Serwer wskazał niepowodzenie"
+
+msgid "No name"
+msgstr "Brak nazwy"
+
+msgid "No key"
+msgstr "Brak klucza"
+
+msgid "Legacy key"
+msgstr "Stary typ klucza"
+
+msgid "Request too short"
+msgstr "Żądanie za krótkie"
+
+msgid "Request too long"
+msgstr "Żądanie za długie"
+
+msgid "Object is in termination state"
+msgstr "Obiekt jest w stanie końcowym"
+
+msgid "No certificate chain"
+msgstr "Brak łańcucha certyfikatów"
+
+msgid "Certificate is too large"
+msgstr "Certyfikat jest zbyt duży"
+
+msgid "Invalid record"
+msgstr "Niepoprawny rekord"
+
+msgid "The MAC does not verify"
+msgstr "Niepomyślna weryfikacja MAC"
+
+msgid "Unexpected message"
+msgstr "Nieoczekiwany komunikat"
+
+msgid "Compression or decompression failed"
+msgstr "Kompresja lub dekompresja nie powiodła się"
+
+msgid "A counter would wrap"
+msgstr "Licznik by się przekręcił"
+
+msgid "Fatal alert message received"
+msgstr "Otrzymano komunikat alarmu krytycznego"
+
+msgid "No cipher algorithm"
+msgstr "Brak algorytmu szyfru"
+
+msgid "Missing client certificate"
+msgstr "Brak certyfikatu klienta"
+
+msgid "Close notification received"
+msgstr "Otrzymano powiadomienie o zamknięciu"
+
+msgid "Ticket expired"
+msgstr "Bilet wygasł"
+
+msgid "Bad ticket"
+msgstr "Błędny bilet"
+
+msgid "Unknown identity"
+msgstr "Nieznana tożsamość"
+
+msgid "Bad certificate message in handshake"
+msgstr "Błędny komunikat certyfikatu przy powitaniu"
+
+msgid "Bad certificate request message in handshake"
+msgstr "Błędny komunikat żądania certyfikatu przy powitaniu"
+
+msgid "Bad certificate verify message in handshake"
+msgstr "Błędny komunikat weryfikacji certyfikatu przy powitaniu"
+
+msgid "Bad change cipher message in handshake"
+msgstr "Błędny komunikat zmiany szyfru przy powitaniu"
+
+msgid "Bad client hello message in handshake"
+msgstr "Błędny komunikat przywitania klienta w powitaniu"
+
+msgid "Bad server hello message in handshake"
+msgstr "Błędny komunikat przywitania serwera w powitaniu"
+
+msgid "Bad server hello done message in handshake"
+msgstr "Błędny komunikat zakończenia przywitania serwera w powitaniu"
+
+msgid "Bad finished message in handshake"
+msgstr "Błędny komunikat zakończenia w powitaniu"
+
+msgid "Bad server key exchange message in handshake"
+msgstr "Błędny komunikat wymiany klucza serwera w powitaniu"
+
+msgid "Bad client key exchange message in handshake"
+msgstr "Błędny komunikat wymiany klucza klienta w powitaniu"
+
+msgid "Bogus string"
+msgstr "Fałszywy łańcuch"
+
+msgid "Forbidden"
+msgstr "Zabronione"
+
+msgid "Key disabled"
+msgstr "Klucz dezaktywowany"
+
+msgid "Not possible with a card based key"
+msgstr "Niemożliwe przy użyciu klucza opartego na karcie"
+
+msgid "Invalid lock object"
+msgstr "Niepoprawny obiekt blokady"
+
+msgid "True"
+msgstr "Prawda"
+
+msgid "False"
+msgstr "Fałsz"
+
+msgid "General IPC error"
+msgstr "Błąd ogólny IPC"
+
+msgid "IPC accept call failed"
+msgstr "Wywołanie accept dla IPC nie powiodło się"
+
+msgid "IPC connect call failed"
+msgstr "Wywołanie connect dla IPC nie powiodło się"
+
+msgid "Invalid IPC response"
+msgstr "Niepoprawna odpowiedź IPC"
+
+msgid "Invalid value passed to IPC"
+msgstr "Niepoprawna wartość przekazana do IPC"
+
+msgid "Incomplete line passed to IPC"
+msgstr "Niekompletna linia przekazana do IPC"
+
+msgid "Line passed to IPC too long"
+msgstr "Linia przekazana do IPC zbyt długa"
+
+msgid "Nested IPC commands"
+msgstr "Zagnieżdżone polecenia IPC"
+
+msgid "No data callback in IPC"
+msgstr "Brak wywołania zwrotnego dla danych w IPC"
+
+msgid "No inquire callback in IPC"
+msgstr "Brak wywołania wstecznego dla zapytań w IPC"
+
+msgid "Not an IPC server"
+msgstr "To nie jest serwer IPC"
+
+msgid "Not an IPC client"
+msgstr "To nie jest klient IPC"
+
+msgid "Problem starting IPC server"
+msgstr "Problem z uruchomieniem serwera IPC"
+
+msgid "IPC read error"
+msgstr "Błąd odczytu IPC"
+
+msgid "IPC write error"
+msgstr "Błąd zapisu IPC"
+
+msgid "Too much data for IPC layer"
+msgstr "Zbyt dużo danych dla warstwy IPC"
+
+msgid "Unexpected IPC command"
+msgstr "Nieoczekiwane polecenie IPC"
+
+msgid "Unknown IPC command"
+msgstr "Nieznane polecenie IPC"
+
+msgid "IPC syntax error"
+msgstr "Błąd składni IPC"
+
+msgid "IPC call has been cancelled"
+msgstr "Wywołanie IPC zostało anulowane"
+
+msgid "No input source for IPC"
+msgstr "Brak źródła wejściowego dla IPC"
+
+msgid "No output source for IPC"
+msgstr "Brak źródła wyjściowego dla IPC"
+
+msgid "IPC parameter error"
+msgstr "Błąd parametru IPC"
+
+msgid "Unknown IPC inquire"
+msgstr "Nieznane zapytanie IPC"
+
+#, fuzzy
+#| msgid "No crypto engine"
+msgid "Crypto engine too old"
+msgstr "Brak silnika kryptograficznego"
+
+msgid "Screen or window too small"
+msgstr ""
+
+msgid "Screen or window too large"
+msgstr ""
+
+msgid "Required environment variable not set"
+msgstr ""
+
+#, fuzzy
+#| msgid "Already exists (LDAP)"
+msgid "User ID already exists"
+msgstr "Już istnieje (LDAP)"
+
+#, fuzzy
+#| msgid "Already exists (LDAP)"
+msgid "Name already exists"
+msgstr "Już istnieje (LDAP)"
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated name"
+msgstr "Powtórzona wartość"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Object is too young"
+msgstr "Certyfikat zbyt młody"
+
+#, fuzzy
+#| msgid "Provided object is too short"
+msgid "Object is too old"
+msgstr "Dostarczony obiekt jest zbyt mały"
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Unknown flag"
+msgstr "Nieznana nazwa"
+
+#, fuzzy
+#| msgid "Invalid operation code"
+msgid "Invalid execution order"
+msgstr "Niepoprawny kod operacji"
+
+msgid "Already fetched"
+msgstr ""
+
+msgid "Try again later"
+msgstr ""
+
+#, fuzzy
+#| msgid "No name"
+msgid "Wrong name"
+msgstr "Brak nazwy"
+
+msgid "System bug detected"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown system error"
+msgid "Unknown DNS error"
+msgstr "Nieznany błąd systemu"
+
+#, fuzzy
+#| msgid "Invalid OID string"
+msgid "Invalid DNS section"
+msgstr "Niepoprawny łańcuch OID"
+
+#, fuzzy
+#| msgid "Invalid S-expression"
+msgid "Invalid textual address form"
+msgstr "Niepoprawne S-wyrażenie"
+
+#, fuzzy
+#| msgid "Missing issuer certificate"
+msgid "Missing DNS query packet"
+msgstr "Brak certyfikatu wystawcy"
+
+msgid "Missing DNS answer packet"
+msgstr ""
+
+msgid "Connection closed in DNS"
+msgstr ""
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "Verification failed in DNS"
+msgstr "Odszyfrowywanie nie powiodło się"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "DNS Timeout"
+msgstr "Upłynął limit czasu"
+
+msgid "General LDAP error"
+msgstr "Błąd ogólny LDAP"
+
+msgid "General LDAP attribute error"
+msgstr "Błąd ogólny atrybutu LDAP"
+
+msgid "General LDAP name error"
+msgstr "Błąd ogólny nazwy LDAP"
+
+msgid "General LDAP security error"
+msgstr "Błąd ogólny bezpieczeństwa LDAP"
+
+msgid "General LDAP service error"
+msgstr "Błąd ogólny usługi LDAP"
+
+msgid "General LDAP update error"
+msgstr "Błąd ogólny aktualizacji LDAP"
+
+msgid "Experimental LDAP error code"
+msgstr "Eksperymentalny kod błędu LDAP"
+
+msgid "Private LDAP error code"
+msgstr "Prywatny kod błędu LDAP"
+
+msgid "Other general LDAP error"
+msgstr "Inny błąd ogólny LDAP"
+
+msgid "LDAP connecting failed (X)"
+msgstr "Połączenie z LDAP nie powiodło się (X)"
+
+msgid "LDAP referral limit exceeded"
+msgstr "Przekroczony limit odniesień LDAP"
+
+msgid "LDAP client loop"
+msgstr "Pętla klienta LDAP"
+
+msgid "No LDAP results returned"
+msgstr "Nie zwrócono wyników LDAP"
+
+msgid "LDAP control not found"
+msgstr "Nie znaleziono sterowania LDAP"
+
+msgid "Not supported by LDAP"
+msgstr "Nie obsługiwane przez LDAP"
+
+msgid "LDAP connect error"
+msgstr "Błąd połączenia z LDAP"
+
+msgid "Out of memory in LDAP"
+msgstr "Brak pamięci w LDAP"
+
+msgid "Bad parameter to an LDAP routine"
+msgstr "Błędny parametr procedury LDAP"
+
+msgid "User cancelled LDAP operation"
+msgstr "Operacja LDAP anulowana przez użytkownika"
+
+msgid "Bad LDAP search filter"
+msgstr "Błędny filtr wyszukiwania LDAP"
+
+msgid "Unknown LDAP authentication method"
+msgstr "Nieznana metoda uwierzytelnienia LDAP"
+
+msgid "Timeout in LDAP"
+msgstr "Limit czasu w LDAP"
+
+msgid "LDAP decoding error"
+msgstr "Błąd dekodowania LDAP"
+
+msgid "LDAP encoding error"
+msgstr "Błąd kodowania LDAP"
+
+msgid "LDAP local error"
+msgstr "Błąd lokalny LDAP"
+
+msgid "Cannot contact LDAP server"
+msgstr "Nie można połączyć się z serwerem LDAP"
+
+msgid "LDAP success"
+msgstr "Sukces LDAP"
+
+msgid "LDAP operations error"
+msgstr "Błąd operacji LDAP"
+
+msgid "LDAP protocol error"
+msgstr "Błąd protokołu LDAP"
+
+msgid "Time limit exceeded in LDAP"
+msgstr "Przekroczony limit czasu w LDAP"
+
+msgid "Size limit exceeded in LDAP"
+msgstr "Przekroczony limit rozmiaru w LDAP"
+
+msgid "LDAP compare false"
+msgstr "Porównanie LDAP fałszywe"
+
+msgid "LDAP compare true"
+msgstr "Porównanie LDAP prawdziwe"
+
+msgid "LDAP authentication method not supported"
+msgstr "Nieobsługiwana metoda uwierzytelnienia LDAP"
+
+msgid "Strong(er) LDAP authentication required"
+msgstr "Wymagana silniejsze uwierzytelnienie LDAP"
+
+msgid "Partial LDAP results+referral received"
+msgstr "Otrzymano częściowe wyniki+odniesienie LDAP"
+
+msgid "LDAP referral"
+msgstr "Odniesienie LDAP"
+
+msgid "Administrative LDAP limit exceeded"
+msgstr "Przekroczony limit administracyjny LDAP"
+
+msgid "Critical LDAP extension is unavailable"
+msgstr "Krytyczne rozszerzenie LDAP jest niedostępne"
+
+msgid "Confidentiality required by LDAP"
+msgstr "Zaufanie wymagane przez LDAP"
+
+msgid "LDAP SASL bind in progress"
+msgstr "Wiązanie LDAP SASL w trakcie"
+
+msgid "No such LDAP attribute"
+msgstr "Nie ma takiego atrybutu LDAP"
+
+msgid "Undefined LDAP attribute type"
+msgstr "Niezdefiniowany typ atrybutu LDAP"
+
+msgid "Inappropriate matching in LDAP"
+msgstr "Niewłaściwe dopasowanie w LDAP"
+
+msgid "Constraint violation in LDAP"
+msgstr "Naruszenie ograniczenia w LDAP"
+
+msgid "LDAP type or value exists"
+msgstr "Typ lub wartość LDAP istnieje"
+
+msgid "Invalid syntax in LDAP"
+msgstr "Błędna składnia w LDAP"
+
+msgid "No such LDAP object"
+msgstr "Nie ma takiego obiektu LDAP"
+
+msgid "LDAP alias problem"
+msgstr "Problem z aliasem LDAP"
+
+msgid "Invalid DN syntax in LDAP"
+msgstr "Błędna składnia DN w LDAP"
+
+msgid "LDAP entry is a leaf"
+msgstr "Wpis LDAP jest liściem"
+
+msgid "LDAP alias dereferencing problem"
+msgstr "Problem z rozwinięciem aliasu LDAP"
+
+msgid "LDAP proxy authorization failure (X)"
+msgstr "Błąd autoryzacji do proxy LDAP (X)"
+
+msgid "Inappropriate LDAP authentication"
+msgstr "Niewłaściwe uwierzytelnienie LDAP"
+
+msgid "Invalid LDAP credentials"
+msgstr "Błędne dane uwierzytelniające LDAP"
+
+msgid "Insufficient access for LDAP"
+msgstr "Niewystarczający dostęp dla LDAP"
+
+msgid "LDAP server is busy"
+msgstr "Serwer LDAP jest zajęty"
+
+msgid "LDAP server is unavailable"
+msgstr "Serwer LDAP jest niedostępny"
+
+msgid "LDAP server is unwilling to perform"
+msgstr "Serwer LDAP nie zamierza wykonać żądania"
+
+msgid "Loop detected by LDAP"
+msgstr "Pętla wykryta przez LDAP"
+
+msgid "LDAP naming violation"
+msgstr "Naruszenie nazw LDAP"
+
+msgid "LDAP object class violation"
+msgstr "Naruszenie klasy obiektu LDAP"
+
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "Operacja LDAP nie jest dozwolona na nie-liściu"
+
+msgid "LDAP operation not allowed on RDN"
+msgstr "Operacja LDAP nie jest dozwolona na RDN"
+
+msgid "Already exists (LDAP)"
+msgstr "Już istnieje (LDAP)"
+
+msgid "Cannot modify LDAP object class"
+msgstr "Nie można zmodyfikować klasy obiektu LDAP"
+
+msgid "LDAP results too large"
+msgstr "Wyniki LDAP zbyt duże"
+
+msgid "LDAP operation affects multiple DSAs"
+msgstr "Operacja LDAP obejmuje wiele DSA"
+
+msgid "Virtual LDAP list view error"
+msgstr "Błąd widoku wirtualnej listy LDAP"
+
+msgid "Other LDAP error"
+msgstr "Inny błąd LDAP"
+
+msgid "Resources exhausted in LCUP"
+msgstr "Zasoby wyczerpane w LCUP"
+
+msgid "Security violation in LCUP"
+msgstr "Naruszenie bezpieczeństwa w LCUP"
+
+msgid "Invalid data in LCUP"
+msgstr "Błędne dane w LCUP"
+
+msgid "Unsupported scheme in LCUP"
+msgstr "Nieobsługiwany schemat w LCUP"
+
+msgid "Reload required in LCUP"
+msgstr "Wymagane przeładowanie w LCUP"
+
+msgid "LDAP cancelled"
+msgstr "LDAP anulowane"
+
+msgid "No LDAP operation to cancel"
+msgstr "Brak operacji LDAP do anulowania"
+
+msgid "Too late to cancel LDAP"
+msgstr "Za późno na anulowanie LDAP"
+
+msgid "Cannot cancel LDAP"
+msgstr "Nie można anulować LDAP"
+
+msgid "LDAP assertion failed"
+msgstr "Zapewnienie LDAP nie powiodło się"
+
+msgid "Proxied authorization denied by LDAP"
+msgstr "Autoryzacja przez proxy odrzucona przez LDAP"
+
+msgid "User defined error code 1"
+msgstr "Zdefiniowany przez użytkownika kod błędu 1"
+
+msgid "User defined error code 2"
+msgstr "Zdefiniowany przez użytkownika kod błędu 2"
+
+msgid "User defined error code 3"
+msgstr "Zdefiniowany przez użytkownika kod błędu 3"
+
+msgid "User defined error code 4"
+msgstr "Zdefiniowany przez użytkownika kod błędu 4"
+
+msgid "User defined error code 5"
+msgstr "Zdefiniowany przez użytkownika kod błędu 5"
+
+msgid "User defined error code 6"
+msgstr "Zdefiniowany przez użytkownika kod błędu 6"
+
+msgid "User defined error code 7"
+msgstr "Zdefiniowany przez użytkownika kod błędu 7"
+
+msgid "User defined error code 8"
+msgstr "Zdefiniowany przez użytkownika kod błędu 8"
+
+msgid "User defined error code 9"
+msgstr "Zdefiniowany przez użytkownika kod błędu 9"
+
+msgid "User defined error code 10"
+msgstr "Zdefiniowany przez użytkownika kod błędu 10"
+
+msgid "User defined error code 11"
+msgstr "Zdefiniowany przez użytkownika kod błędu 11"
+
+msgid "User defined error code 12"
+msgstr "Zdefiniowany przez użytkownika kod błędu 12"
+
+msgid "User defined error code 13"
+msgstr "Zdefiniowany przez użytkownika kod błędu 13"
+
+msgid "User defined error code 14"
+msgstr "Zdefiniowany przez użytkownika kod błędu 14"
+
+msgid "User defined error code 15"
+msgstr "Zdefiniowany przez użytkownika kod błędu 15"
+
+msgid "User defined error code 16"
+msgstr "Zdefiniowany przez użytkownika kod błędu 16"
+
+msgid "System error w/o errno"
+msgstr "Błąd systemowy bez errno"
+
+msgid "Unknown system error"
+msgstr "Nieznany błąd systemu"
+
+msgid "End of file"
+msgstr "Koniec pliku"
+
+msgid "Unknown error code"
+msgstr "Nieznany kod błędu"
+
+#, c-format
+msgid "Usage: %s GPG-ERROR [...]\n"
+msgstr "Składnia: %s BŁĄD-GPG [...]\n"
+
+#, c-format
+msgid "%s: warning: could not recognize %s\n"
+msgstr "%s: uwaga: nie rozpoznano %s\n"
diff --git a/po/pt.po b/po/pt.po
new file mode 100644
index 0000000..7feb13b
--- /dev/null
+++ b/po/pt.po
@@ -0,0 +1,1471 @@
+# Portuguese translations for libgpg-error package.
+# Copyright (C) 2014 g10 Code GmbH
+# This file is distributed under the same license as the libgpg-error package.
+#
+# paulo <[email protected]>, 2014.
+msgid ""
+msgstr ""
+"Project-Id-Version: libgpg-error 1.17\n"
+"Report-Msgid-Bugs-To: [email protected]\n"
+"PO-Revision-Date: 2014-11-24 02:32+0000\n"
+"Last-Translator: Paulo Tomé <[email protected]>\n"
+"Language-Team: Portuguese <[email protected]>\n"
+"Language: pt\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: Lokalize 1.4\n"
+
+msgid "Unspecified source"
+msgstr "Fonte não especificada"
+
+msgid "gcrypt"
+msgstr "gcrypt"
+
+msgid "GnuPG"
+msgstr "GnuPG"
+
+msgid "GpgSM"
+msgstr "GpgSM"
+
+msgid "GPG Agent"
+msgstr "Agente GPG"
+
+msgid "Pinentry"
+msgstr "Pinentry"
+
+msgid "SCD"
+msgstr "SCD"
+
+msgid "GPGME"
+msgstr "GPGME"
+
+msgid "Keybox"
+msgstr "Keybox"
+
+msgid "KSBA"
+msgstr "KSBA"
+
+msgid "Dirmngr"
+msgstr "Dirmngr"
+
+msgid "GSTI"
+msgstr "GSTI"
+
+msgid "GPA"
+msgstr "GPA"
+
+msgid "Kleopatra"
+msgstr "Kleopatra"
+
+msgid "G13"
+msgstr "G13"
+
+msgid "Assuan"
+msgstr "Assuan"
+
+msgid "TLS"
+msgstr "TLS"
+
+msgid "Any source"
+msgstr "Qualquer fonte"
+
+msgid "User defined source 1"
+msgstr "Fonte definida pelo utilizador 1"
+
+msgid "User defined source 2"
+msgstr "Fonte definida pelo utilizador 2"
+
+msgid "User defined source 3"
+msgstr "Fonte definida pelo utilizador 3"
+
+msgid "User defined source 4"
+msgstr "Fonte definida pelo utilizador 4"
+
+msgid "Unknown source"
+msgstr "Fonte não conhecida"
+
+msgid "Success"
+msgstr "Sucesso"
+
+msgid "General error"
+msgstr "Erro genérico"
+
+msgid "Unknown packet"
+msgstr "Pacote desconhecido"
+
+msgid "Unknown version in packet"
+msgstr "Versão desconhecida no pacote"
+
+msgid "Invalid public key algorithm"
+msgstr "Algoritmo de chave pública inválido"
+
+msgid "Invalid digest algorithm"
+msgstr "Algoritmo de resumo inválido"
+
+msgid "Bad public key"
+msgstr "Chave pública errada"
+
+msgid "Bad secret key"
+msgstr "Chave secreta errada"
+
+msgid "Bad signature"
+msgstr "Assinatura errada"
+
+msgid "No public key"
+msgstr "Sem chave pública"
+
+msgid "Checksum error"
+msgstr "Soma de verificação errada"
+
+msgid "Bad passphrase"
+msgstr "Senha errada"
+
+msgid "Invalid cipher algorithm"
+msgstr "Algoritmo de cifra inválido"
+
+msgid "Cannot open keyring"
+msgstr "Chaveiro aberto"
+
+msgid "Invalid packet"
+msgstr "Pacote inválido"
+
+msgid "Invalid armor"
+msgstr "Armadura inválida"
+
+msgid "No user ID"
+msgstr "Sem identificador de utilizador"
+
+msgid "No secret key"
+msgstr "Sem chave secreta"
+
+msgid "Wrong secret key used"
+msgstr "Utilizada chave secreta errada"
+
+msgid "Bad session key"
+msgstr "Chave de sessão errada"
+
+msgid "Unknown compression algorithm"
+msgstr "Algoritmo de compressão desconhecido"
+
+msgid "Number is not prime"
+msgstr "O número não é primo"
+
+msgid "Invalid encoding method"
+msgstr "Método de codificação errado"
+
+msgid "Invalid encryption scheme"
+msgstr "Esquema de encriptação errado"
+
+msgid "Invalid signature scheme"
+msgstr "Esquema de assinatura inválido"
+
+msgid "Invalid attribute"
+msgstr "Atributo inválido"
+
+msgid "No value"
+msgstr "Sem valor"
+
+msgid "Not found"
+msgstr "Não encontrado"
+
+msgid "Value not found"
+msgstr "Valor não encontrado"
+
+msgid "Syntax error"
+msgstr "Erro de sintaxe"
+
+msgid "Bad MPI value"
+msgstr "Valor de MPI errado"
+
+msgid "Invalid passphrase"
+msgstr "Senha inválida"
+
+msgid "Invalid signature class"
+msgstr "Classe de assinatura inválida"
+
+msgid "Resources exhausted"
+msgstr "Recursos esgotados"
+
+msgid "Invalid keyring"
+msgstr "Chaveiro inválido"
+
+msgid "Trust DB error"
+msgstr "Erro na Base de Dados de confiança"
+
+msgid "Bad certificate"
+msgstr "Certificado errado"
+
+msgid "Invalid user ID"
+msgstr "Identificador de utilizador errado"
+
+msgid "Unexpected error"
+msgstr "Erro inesperado"
+
+msgid "Time conflict"
+msgstr "Conflito temporal"
+
+msgid "Keyserver error"
+msgstr "Erro no servidor de chaves"
+
+msgid "Wrong public key algorithm"
+msgstr "Algoritmo da chave pública errado"
+
+msgid "Tribute to D. A."
+msgstr "Tributo a D. A."
+
+msgid "Weak encryption key"
+msgstr "Chave de encriptação fraca"
+
+msgid "Invalid key length"
+msgstr "Comprimento da chave inválido"
+
+msgid "Invalid argument"
+msgstr "Argumento inválido"
+
+msgid "Syntax error in URI"
+msgstr "Erro de sintaxe no URI"
+
+msgid "Invalid URI"
+msgstr "URI inválido"
+
+msgid "Network error"
+msgstr "Erro de rede"
+
+msgid "Unknown host"
+msgstr "Anfitrião desconhecido"
+
+msgid "Selftest failed"
+msgstr "Auto teste falhou"
+
+msgid "Data not encrypted"
+msgstr "Dados não encriptados"
+
+msgid "Data not processed"
+msgstr "Dados não processados"
+
+msgid "Unusable public key"
+msgstr "Chave pública inutilizável"
+
+msgid "Unusable secret key"
+msgstr "Chave secreta inutilizável"
+
+msgid "Invalid value"
+msgstr "Valor inválido"
+
+msgid "Bad certificate chain"
+msgstr "Cadeia de certificados errada"
+
+msgid "Missing certificate"
+msgstr "Certificado em falta"
+
+msgid "No data"
+msgstr "Não existem dados"
+
+msgid "Bug"
+msgstr "Erro"
+
+msgid "Not supported"
+msgstr "Não suportado"
+
+msgid "Invalid operation code"
+msgstr "Código de operação inválido"
+
+msgid "Timeout"
+msgstr "Tempo limite"
+
+msgid "Internal error"
+msgstr "Erro interno"
+
+msgid "EOF (gcrypt)"
+msgstr "EOF (gcrypt)"
+
+msgid "Invalid object"
+msgstr "Objecto inválido"
+
+msgid "Provided object is too short"
+msgstr "O objecto fornecido é demasiado curto"
+
+msgid "Provided object is too large"
+msgstr "O objecto fornecido é demasiado grande"
+
+msgid "Missing item in object"
+msgstr "Item em falta no objecto"
+
+msgid "Not implemented"
+msgstr "Não implementado"
+
+msgid "Conflicting use"
+msgstr "Utilização em conflito"
+
+msgid "Invalid cipher mode"
+msgstr "Modo de cifra inválido"
+
+msgid "Invalid flag"
+msgstr "Flag inválido"
+
+msgid "Invalid handle"
+msgstr "Identificador inválido"
+
+msgid "Result truncated"
+msgstr "Resultado truncado"
+
+msgid "Incomplete line"
+msgstr "Linha incompleta"
+
+msgid "Invalid response"
+msgstr "Resposta inválida"
+
+msgid "No agent running"
+msgstr "Nenhum agente em execução"
+
+msgid "Agent error"
+msgstr "Erro no agente"
+
+msgid "Invalid data"
+msgstr "Dados inválidos"
+
+msgid "Unspecific Assuan server fault"
+msgstr "Falha não especificada no servidor Assuan"
+
+msgid "General Assuan error"
+msgstr "Erro Assuan genérico"
+
+msgid "Invalid session key"
+msgstr "Chave de sessão inválida"
+
+msgid "Invalid S-expression"
+msgstr "Expressão simbólica inválida"
+
+msgid "Unsupported algorithm"
+msgstr "Algoritmo não suportado"
+
+msgid "No pinentry"
+msgstr "Sem pinentry"
+
+msgid "pinentry error"
+msgstr "Erro no pinentry"
+
+msgid "Bad PIN"
+msgstr "PIN errado"
+
+msgid "Invalid name"
+msgstr "Nome inválido"
+
+msgid "Bad data"
+msgstr "Dados errados"
+
+msgid "Invalid parameter"
+msgstr "Parâmetro inválido"
+
+msgid "Wrong card"
+msgstr "Cartão errado"
+
+msgid "No dirmngr"
+msgstr "Sem dirmngr"
+
+msgid "dirmngr error"
+msgstr "Erro no dirmngr"
+
+msgid "Certificate revoked"
+msgstr "Certificado revogado"
+
+msgid "No CRL known"
+msgstr "Sem CRL conhecido"
+
+msgid "CRL too old"
+msgstr "CRL muito velho"
+
+msgid "Line too long"
+msgstr "Linha demasiado longa"
+
+msgid "Not trusted"
+msgstr "Não é de confiança"
+
+msgid "Operation cancelled"
+msgstr "Operação cancelada"
+
+msgid "Bad CA certificate"
+msgstr "Certificado BA errado"
+
+msgid "Certificate expired"
+msgstr "Certificado expirou"
+
+msgid "Certificate too young"
+msgstr "Certificado demasiado novo"
+
+msgid "Unsupported certificate"
+msgstr "Certificado não suportado"
+
+msgid "Unknown S-expression"
+msgstr "Expressão simbólica desconhecida"
+
+msgid "Unsupported protection"
+msgstr "Protecção não suportada"
+
+msgid "Corrupted protection"
+msgstr "Protecção corrompida"
+
+msgid "Ambiguous name"
+msgstr "Nome ambíguo"
+
+msgid "Card error"
+msgstr "Erro de cartão"
+
+msgid "Card reset required"
+msgstr "Reinicialização de cartão necessária"
+
+msgid "Card removed"
+msgstr "Cartão removido"
+
+msgid "Invalid card"
+msgstr "Cartão inválido"
+
+msgid "Card not present"
+msgstr "Cartão não presente"
+
+msgid "No PKCS15 application"
+msgstr "Sem aplicação PKCS15"
+
+msgid "Not confirmed"
+msgstr "Não confirmado"
+
+msgid "Configuration error"
+msgstr "Erro de configuração"
+
+msgid "No policy match"
+msgstr "Sem correspondência de política"
+
+msgid "Invalid index"
+msgstr "Índice inválido"
+
+msgid "Invalid ID"
+msgstr "Identificador inválido"
+
+msgid "No SmartCard daemon"
+msgstr "Sem demónio de SmartCard"
+
+msgid "SmartCard daemon error"
+msgstr "Erro no demónio de SmartCard"
+
+msgid "Unsupported protocol"
+msgstr "Protocolo não suportado"
+
+msgid "Bad PIN method"
+msgstr "Método de PIN errado"
+
+msgid "Card not initialized"
+msgstr "Cartão não inicializado"
+
+msgid "Unsupported operation"
+msgstr "Operação não suportada"
+
+msgid "Wrong key usage"
+msgstr "Utilização de chave errada"
+
+msgid "Nothing found"
+msgstr "Nada encontrado"
+
+msgid "Wrong blob type"
+msgstr "Tipo de blob errado"
+
+msgid "Missing value"
+msgstr "Valor em falta"
+
+msgid "Hardware problem"
+msgstr "Problema de hardware"
+
+msgid "PIN blocked"
+msgstr "PIN bloqueado"
+
+msgid "Conditions of use not satisfied"
+msgstr "Condições de utilização não satisfeitas"
+
+msgid "PINs are not synced"
+msgstr "PINs não estão sincronizados"
+
+msgid "Invalid CRL"
+msgstr "CRL inválido"
+
+msgid "BER error"
+msgstr "Erro de BER"
+
+msgid "Invalid BER"
+msgstr "BER inválido"
+
+msgid "Element not found"
+msgstr "Elemento não encontrado"
+
+msgid "Identifier not found"
+msgstr "Identificador não encontrado"
+
+msgid "Invalid tag"
+msgstr "Etiqueta inválida"
+
+msgid "Invalid length"
+msgstr "Comprimento inválido"
+
+msgid "Invalid key info"
+msgstr "Informação de chave errada"
+
+msgid "Unexpected tag"
+msgstr "Etiqueta inesperada"
+
+msgid "Not DER encoded"
+msgstr "Não codificado através de DER"
+
+msgid "No CMS object"
+msgstr "Sem objecto CMS"
+
+msgid "Invalid CMS object"
+msgstr "Objecto CMS inválido"
+
+msgid "Unknown CMS object"
+msgstr "Objecto CMS desconhecido"
+
+msgid "Unsupported CMS object"
+msgstr "Objecto CMS não suportado"
+
+msgid "Unsupported encoding"
+msgstr "Codificação não suportada"
+
+msgid "Unsupported CMS version"
+msgstr "Versão de CMS não suportada"
+
+msgid "Unknown algorithm"
+msgstr "Algoritmo desconhecido"
+
+msgid "Invalid crypto engine"
+msgstr "Motor de encriptação inválido"
+
+msgid "Public key not trusted"
+msgstr "Chave pública não é de confiança"
+
+msgid "Decryption failed"
+msgstr "Desencriptação falhada"
+
+msgid "Key expired"
+msgstr "Chave expirada"
+
+msgid "Signature expired"
+msgstr "Assinatura expirada"
+
+msgid "Encoding problem"
+msgstr "Problema de codificação"
+
+msgid "Invalid state"
+msgstr "Estado inválido"
+
+msgid "Duplicated value"
+msgstr "Valor duplicado"
+
+msgid "Missing action"
+msgstr "Acção em falta"
+
+msgid "ASN.1 module not found"
+msgstr "Módulo ASN.1 não encontrado"
+
+msgid "Invalid OID string"
+msgstr "Sequência OID inválida"
+
+msgid "Invalid time"
+msgstr "Tempo inválido"
+
+msgid "Invalid CRL object"
+msgstr "Objecto CRL inválido"
+
+msgid "Unsupported CRL version"
+msgstr "Versão CRL não suportada"
+
+msgid "Invalid certificate object"
+msgstr "Objecto de certificado inválido"
+
+msgid "Unknown name"
+msgstr "Nome desconhecido"
+
+msgid "A locale function failed"
+msgstr "Uma função de localização falhou"
+
+msgid "Not locked"
+msgstr "Não trancado"
+
+msgid "Protocol violation"
+msgstr "Violação de protocolo"
+
+msgid "Invalid MAC"
+msgstr "MAC inválido"
+
+msgid "Invalid request"
+msgstr "Pedido inválido"
+
+msgid "Unknown extension"
+msgstr "Extensão desconhecida"
+
+msgid "Unknown critical extension"
+msgstr "Extensão crítica desconhecida"
+
+msgid "Locked"
+msgstr "Trancado"
+
+msgid "Unknown option"
+msgstr "Opção desconhecida"
+
+msgid "Unknown command"
+msgstr "Comando desconhecido"
+
+msgid "Not operational"
+msgstr "Não operacional"
+
+msgid "No passphrase given"
+msgstr "Nenhuma senha dada"
+
+msgid "No PIN given"
+msgstr "Sem PIN dado"
+
+msgid "Not enabled"
+msgstr "Não habilitado"
+
+msgid "No crypto engine"
+msgstr "Sem motor de encriptação"
+
+msgid "Missing key"
+msgstr "Chave em falta"
+
+msgid "Too many objects"
+msgstr "Demasiados objectos"
+
+msgid "Limit reached"
+msgstr "Limite atingido"
+
+msgid "Not initialized"
+msgstr "Não inicializado"
+
+msgid "Missing issuer certificate"
+msgstr "Certificado do emissor em falta"
+
+msgid "No keyserver available"
+msgstr "Sem servidor de chaves disponível"
+
+msgid "Invalid elliptic curve"
+msgstr "Curva elíptica inválida"
+
+msgid "Unknown elliptic curve"
+msgstr "Curva elíptica desconhecida"
+
+msgid "Duplicated key"
+msgstr "Chave duplicada"
+
+msgid "Ambiguous result"
+msgstr "Resultado ambíguo"
+
+msgid "No crypto context"
+msgstr "Sem contexto de encriptação"
+
+msgid "Wrong crypto context"
+msgstr "Contexto de encriptação errado"
+
+msgid "Bad crypto context"
+msgstr "Contexto de encriptação inválido"
+
+msgid "Conflict in the crypto context"
+msgstr "Conflito no contexto de encriptação"
+
+msgid "Broken public key"
+msgstr "Chave pública quebrada"
+
+msgid "Broken secret key"
+msgstr "Chave secreta quebrada"
+
+msgid "Invalid MAC algorithm"
+msgstr "Algoritmo MAC inválido"
+
+msgid "Operation fully cancelled"
+msgstr "Operação totalmente cancelada"
+
+msgid "Operation not yet finished"
+msgstr "Operação ainda não completada"
+
+msgid "Buffer too short"
+msgstr "Buffer demasiado curto"
+
+msgid "Invalid length specifier in S-expression"
+msgstr "Especificador de comprimento inválido na expressão simbólica"
+
+msgid "String too long in S-expression"
+msgstr "Sequência de caracteres demasiado longa na expressão simbólica"
+
+msgid "Unmatched parentheses in S-expression"
+msgstr "Parênteses não correspondidos na expressão simbólica"
+
+msgid "S-expression not canonical"
+msgstr "Expressão simbólica não canónica"
+
+msgid "Bad character in S-expression"
+msgstr "Carácter errado na expressão simbólica"
+
+msgid "Bad quotation in S-expression"
+msgstr "Plicas erradas na expressão simbólica"
+
+msgid "Zero prefix in S-expression"
+msgstr "Prefixo zero na expressão simbólica"
+
+msgid "Nested display hints in S-expression"
+msgstr "Dicas de exibição aninhadas na expressão simbólica"
+
+msgid "Unmatched display hints"
+msgstr "Dicas de exibição não correspondidas"
+
+msgid "Unexpected reserved punctuation in S-expression"
+msgstr "Pontuação reservada não esperada na expressão simbólica"
+
+msgid "Bad hexadecimal character in S-expression"
+msgstr "Carácter hexadecimal errado na expressão simbólica"
+
+msgid "Odd hexadecimal numbers in S-expression"
+msgstr "Números hexadecimais ímpares na expressão simbólica"
+
+msgid "Bad octal character in S-expression"
+msgstr "Carácter octal errado na expressão simbólica"
+
+msgid "All subkeys are expired or revoked"
+msgstr ""
+
+#, fuzzy
+#| msgid "Data not encrypted"
+msgid "Database is corrupted"
+msgstr "Dados não encriptados"
+
+msgid "Server indicated a failure"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "No name"
+msgstr "Nome desconhecido"
+
+#, fuzzy
+#| msgid "No public key"
+msgid "No key"
+msgstr "Sem chave pública"
+
+msgid "Legacy key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Buffer too short"
+msgid "Request too short"
+msgstr "Buffer demasiado curto"
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "Request too long"
+msgstr "Linha demasiado longa"
+
+msgid "Object is in termination state"
+msgstr ""
+
+msgid "No certificate chain"
+msgstr "Sem cadeia de certificados"
+
+msgid "Certificate is too large"
+msgstr "Certificado é demasiado grande"
+
+msgid "Invalid record"
+msgstr "Registo inválido"
+
+msgid "The MAC does not verify"
+msgstr "O MAC não se verifica"
+
+msgid "Unexpected message"
+msgstr "Mensagem inesperada"
+
+msgid "Compression or decompression failed"
+msgstr "Compressão ou descompressão falhada"
+
+msgid "A counter would wrap"
+msgstr "Um contador daria a volta"
+
+msgid "Fatal alert message received"
+msgstr "Mensagem de alerta fatal recebida"
+
+msgid "No cipher algorithm"
+msgstr "Algoritmo de criptografia inexistente"
+
+msgid "Missing client certificate"
+msgstr "Certificado cliente em falta"
+
+msgid "Close notification received"
+msgstr "Notificação de encerramento recebida"
+
+msgid "Ticket expired"
+msgstr "Ticket expirou"
+
+msgid "Bad ticket"
+msgstr "Ticket errado"
+
+msgid "Unknown identity"
+msgstr "Identidade desconhecida"
+
+msgid "Bad certificate message in handshake"
+msgstr "Mensagem de certificado errada no handshake"
+
+msgid "Bad certificate request message in handshake"
+msgstr "Mensagem de pedido de certificado errada no handshake"
+
+msgid "Bad certificate verify message in handshake"
+msgstr "Mensagem de verificação de certificado errada no handshake"
+
+msgid "Bad change cipher message in handshake"
+msgstr "Mensagem de alteração de certificado errada no handshake"
+
+msgid "Bad client hello message in handshake"
+msgstr "Mensagem de hello do cliente errada no handshake"
+
+msgid "Bad server hello message in handshake"
+msgstr "Mensagem de hello do servidor errada no handshake"
+
+msgid "Bad server hello done message in handshake"
+msgstr "Mensagem de hello done do servidor errada no handshake"
+
+msgid "Bad finished message in handshake"
+msgstr "Mensagem de conclusão errada no handshake"
+
+msgid "Bad server key exchange message in handshake"
+msgstr "Mensagem de troca de chaves do servidor errada no handshake"
+
+msgid "Bad client key exchange message in handshake"
+msgstr "Mensagem de troca de chaves do cliente errada no handshake"
+
+msgid "Bogus string"
+msgstr "Sequência de caracteres adulterada"
+
+msgid "Forbidden"
+msgstr ""
+
+msgid "Key disabled"
+msgstr "Chave desabilitada"
+
+msgid "Not possible with a card based key"
+msgstr "Não possível com uma chave baseada num cartão"
+
+msgid "Invalid lock object"
+msgstr "Objecto de tranca inválido"
+
+msgid "True"
+msgstr ""
+
+msgid "False"
+msgstr ""
+
+msgid "General IPC error"
+msgstr "Erro genérico de IPC"
+
+msgid "IPC accept call failed"
+msgstr "Chamada de aceitação de IPC falhada"
+
+msgid "IPC connect call failed"
+msgstr "Chamada de conexão de IPC falhada"
+
+msgid "Invalid IPC response"
+msgstr "Resposta de IPC inválida"
+
+msgid "Invalid value passed to IPC"
+msgstr "Valor inválido passado ao IPC"
+
+msgid "Incomplete line passed to IPC"
+msgstr "Linha inválida passada ao IPC"
+
+msgid "Line passed to IPC too long"
+msgstr "Linha passada ao IPC demasiado longa"
+
+msgid "Nested IPC commands"
+msgstr "Comandos IPC aninhados"
+
+msgid "No data callback in IPC"
+msgstr "Sem retorno de chamada de dados no IPC"
+
+msgid "No inquire callback in IPC"
+msgstr "Sem retorno de chamada de inquirição no IPC"
+
+msgid "Not an IPC server"
+msgstr "Não é um servidor IPC"
+
+msgid "Not an IPC client"
+msgstr "Não é um cliente IPC"
+
+msgid "Problem starting IPC server"
+msgstr "Problema na iniciação do servidor IPC"
+
+msgid "IPC read error"
+msgstr "Erro de leitura de IPC"
+
+msgid "IPC write error"
+msgstr "Erro de escrita de IPC"
+
+msgid "Too much data for IPC layer"
+msgstr "Demasiados dados para a camada IPC"
+
+msgid "Unexpected IPC command"
+msgstr "Comando IPC inesperado"
+
+msgid "Unknown IPC command"
+msgstr "Comando IPC desconhecido"
+
+msgid "IPC syntax error"
+msgstr "Erro de sintaxe IPC"
+
+msgid "IPC call has been cancelled"
+msgstr "Chamada de IPC foi cancelada"
+
+msgid "No input source for IPC"
+msgstr "Sem fonte de entrada para o IPC"
+
+msgid "No output source for IPC"
+msgstr "Nenhuma fonte de saída para IPC"
+
+msgid "IPC parameter error"
+msgstr "Erro de parâmetro IPC"
+
+msgid "Unknown IPC inquire"
+msgstr "Inquirição IPC desconhecida"
+
+#, fuzzy
+#| msgid "No crypto engine"
+msgid "Crypto engine too old"
+msgstr "Sem motor de encriptação"
+
+msgid "Screen or window too small"
+msgstr ""
+
+msgid "Screen or window too large"
+msgstr ""
+
+msgid "Required environment variable not set"
+msgstr ""
+
+msgid "User ID already exists"
+msgstr ""
+
+msgid "Name already exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated name"
+msgstr "Valor duplicado"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Object is too young"
+msgstr "Certificado demasiado novo"
+
+#, fuzzy
+#| msgid "Provided object is too short"
+msgid "Object is too old"
+msgstr "O objecto fornecido é demasiado curto"
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Unknown flag"
+msgstr "Nome desconhecido"
+
+#, fuzzy
+#| msgid "Invalid operation code"
+msgid "Invalid execution order"
+msgstr "Código de operação inválido"
+
+msgid "Already fetched"
+msgstr ""
+
+msgid "Try again later"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Wrong name"
+msgstr "Nome desconhecido"
+
+msgid "System bug detected"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown system error"
+msgid "Unknown DNS error"
+msgstr "Erro de sistema desconhecido"
+
+#, fuzzy
+#| msgid "Invalid OID string"
+msgid "Invalid DNS section"
+msgstr "Sequência OID inválida"
+
+#, fuzzy
+#| msgid "Invalid S-expression"
+msgid "Invalid textual address form"
+msgstr "Expressão simbólica inválida"
+
+#, fuzzy
+#| msgid "Missing issuer certificate"
+msgid "Missing DNS query packet"
+msgstr "Certificado do emissor em falta"
+
+msgid "Missing DNS answer packet"
+msgstr ""
+
+msgid "Connection closed in DNS"
+msgstr ""
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "Verification failed in DNS"
+msgstr "Desencriptação falhada"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "DNS Timeout"
+msgstr "Tempo limite"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "General LDAP error"
+msgstr "Erro genérico de IPC"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP attribute error"
+msgstr "Erro genérico"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP name error"
+msgstr "Erro genérico"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP security error"
+msgstr "Erro Assuan genérico"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP service error"
+msgstr "Erro genérico"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP update error"
+msgstr "Erro Assuan genérico"
+
+msgid "Experimental LDAP error code"
+msgstr ""
+
+#, fuzzy
+#| msgid "IPC write error"
+msgid "Private LDAP error code"
+msgstr "Erro de escrita de IPC"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other general LDAP error"
+msgstr "Erro genérico de IPC"
+
+#, fuzzy
+#| msgid "IPC connect call failed"
+msgid "LDAP connecting failed (X)"
+msgstr "Chamada de conexão de IPC falhada"
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral limit exceeded"
+msgstr "Erro genérico"
+
+msgid "LDAP client loop"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "No LDAP results returned"
+msgstr "Reinicialização de cartão necessária"
+
+#, fuzzy
+#| msgid "Element not found"
+msgid "LDAP control not found"
+msgstr "Elemento não encontrado"
+
+#, fuzzy
+#| msgid "Not supported"
+msgid "Not supported by LDAP"
+msgstr "Não suportado"
+
+#, fuzzy
+#| msgid "Unexpected error"
+msgid "LDAP connect error"
+msgstr "Erro inesperado"
+
+msgid "Out of memory in LDAP"
+msgstr ""
+
+msgid "Bad parameter to an LDAP routine"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported operation"
+msgid "User cancelled LDAP operation"
+msgstr "Operação não suportada"
+
+#, fuzzy
+#| msgid "Bad certificate"
+msgid "Bad LDAP search filter"
+msgstr "Certificado errado"
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "Unknown LDAP authentication method"
+msgstr "Extensão desconhecida"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "Timeout in LDAP"
+msgstr "Tempo limite"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP decoding error"
+msgstr "Erro no dirmngr"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP encoding error"
+msgstr "Erro no dirmngr"
+
+#, fuzzy
+#| msgid "IPC read error"
+msgid "LDAP local error"
+msgstr "Erro de leitura de IPC"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot contact LDAP server"
+msgstr "Não é um servidor IPC"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP success"
+msgstr "Sucesso"
+
+#, fuzzy
+#| msgid "Configuration error"
+msgid "LDAP operations error"
+msgstr "Erro de configuração"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP protocol error"
+msgstr "Violação de protocolo"
+
+msgid "Time limit exceeded in LDAP"
+msgstr ""
+
+msgid "Size limit exceeded in LDAP"
+msgstr ""
+
+msgid "LDAP compare false"
+msgstr ""
+
+msgid "LDAP compare true"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "LDAP authentication method not supported"
+msgstr "Extensão desconhecida"
+
+msgid "Strong(er) LDAP authentication required"
+msgstr ""
+
+#, fuzzy
+#| msgid "Fatal alert message received"
+msgid "Partial LDAP results+referral received"
+msgstr "Mensagem de alerta fatal recebida"
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral"
+msgstr "Erro genérico"
+
+msgid "Administrative LDAP limit exceeded"
+msgstr ""
+
+msgid "Critical LDAP extension is unavailable"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Confidentiality required by LDAP"
+msgstr "Reinicialização de cartão necessária"
+
+msgid "LDAP SASL bind in progress"
+msgstr ""
+
+msgid "No such LDAP attribute"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid attribute"
+msgid "Undefined LDAP attribute type"
+msgstr "Atributo inválido"
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate matching in LDAP"
+msgstr "Protecção não suportada"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Constraint violation in LDAP"
+msgstr "Violação de protocolo"
+
+msgid "LDAP type or value exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid syntax in LDAP"
+msgstr "Estado inválido"
+
+#, fuzzy
+#| msgid "No CMS object"
+msgid "No such LDAP object"
+msgstr "Sem objecto CMS"
+
+#, fuzzy
+#| msgid "Hardware problem"
+msgid "LDAP alias problem"
+msgstr "Problema de hardware"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid DN syntax in LDAP"
+msgstr "Estado inválido"
+
+msgid "LDAP entry is a leaf"
+msgstr ""
+
+#, fuzzy
+#| msgid "Encoding problem"
+msgid "LDAP alias dereferencing problem"
+msgstr "Problema de codificação"
+
+msgid "LDAP proxy authorization failure (X)"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate LDAP authentication"
+msgstr "Protecção não suportada"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid LDAP credentials"
+msgstr "Cartão inválido"
+
+msgid "Insufficient access for LDAP"
+msgstr ""
+
+msgid "LDAP server is busy"
+msgstr ""
+
+#, fuzzy
+#| msgid "No keyserver available"
+msgid "LDAP server is unavailable"
+msgstr "Sem servidor de chaves disponível"
+
+msgid "LDAP server is unwilling to perform"
+msgstr ""
+
+msgid "Loop detected by LDAP"
+msgstr ""
+
+#, fuzzy
+#| msgid "Missing action"
+msgid "LDAP naming violation"
+msgstr "Acção em falta"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP object class violation"
+msgstr "Violação de protocolo"
+
+#, fuzzy
+#| msgid "Operation not yet finished"
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "Operação ainda não completada"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation not allowed on RDN"
+msgstr "Operação cancelada"
+
+msgid "Already exists (LDAP)"
+msgstr ""
+
+msgid "Cannot modify LDAP object class"
+msgstr ""
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "LDAP results too large"
+msgstr "Linha demasiado longa"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation affects multiple DSAs"
+msgstr "Operação cancelada"
+
+msgid "Virtual LDAP list view error"
+msgstr ""
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other LDAP error"
+msgstr "Erro genérico de IPC"
+
+#, fuzzy
+#| msgid "Resources exhausted"
+msgid "Resources exhausted in LCUP"
+msgstr "Recursos esgotados"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Security violation in LCUP"
+msgstr "Violação de protocolo"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid data in LCUP"
+msgstr "Estado inválido"
+
+#, fuzzy
+#| msgid "Unsupported certificate"
+msgid "Unsupported scheme in LCUP"
+msgstr "Certificado não suportado"
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Reload required in LCUP"
+msgstr "Reinicialização de cartão necessária"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP cancelled"
+msgstr "Sucesso"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "No LDAP operation to cancel"
+msgstr "Não operacional"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "Too late to cancel LDAP"
+msgstr "Não operacional"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot cancel LDAP"
+msgstr "Não é um servidor IPC"
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "LDAP assertion failed"
+msgstr "Desencriptação falhada"
+
+msgid "Proxied authorization denied by LDAP"
+msgstr ""
+
+msgid "User defined error code 1"
+msgstr "Código de erro definido pelo utilizador 1"
+
+msgid "User defined error code 2"
+msgstr "Código de erro definido pelo utilizador 2"
+
+msgid "User defined error code 3"
+msgstr "Código de erro definido pelo utilizador 3"
+
+msgid "User defined error code 4"
+msgstr "Código de erro definido pelo utilizador 4"
+
+msgid "User defined error code 5"
+msgstr "Código de erro definido pelo utilizador 5"
+
+msgid "User defined error code 6"
+msgstr "Código de erro definido pelo utilizador 6"
+
+msgid "User defined error code 7"
+msgstr "Código de erro definido pelo utilizador 7"
+
+msgid "User defined error code 8"
+msgstr "Código de erro definido pelo utilizador 8"
+
+msgid "User defined error code 9"
+msgstr "Código de erro definido pelo utilizador 9"
+
+msgid "User defined error code 10"
+msgstr "Código de erro definido pelo utilizador 10"
+
+msgid "User defined error code 11"
+msgstr "Código de erro definido pelo utilizador 11"
+
+msgid "User defined error code 12"
+msgstr "Código de erro definido pelo utilizador 12"
+
+msgid "User defined error code 13"
+msgstr "Código de erro definido pelo utilizador 13"
+
+msgid "User defined error code 14"
+msgstr "Código de erro definido pelo utilizador 14"
+
+msgid "User defined error code 15"
+msgstr "Código de erro definido pelo utilizador 15"
+
+msgid "User defined error code 16"
+msgstr "Código de erro definido pelo utilizador 16"
+
+msgid "System error w/o errno"
+msgstr "Erro de sistema sem errno"
+
+msgid "Unknown system error"
+msgstr "Erro de sistema desconhecido"
+
+msgid "End of file"
+msgstr "Fim do ficheiro"
+
+msgid "Unknown error code"
+msgstr "Código de erro desconhecido"
+
+#, c-format
+msgid "Usage: %s GPG-ERROR [...]\n"
+msgstr "Utilização: %s GPG-ERROR [...]\n"
+
+#, c-format
+msgid "%s: warning: could not recognize %s\n"
+msgstr "%s: aviso: não consegui reconhecer %s\n"
+
+#, fuzzy
+#~| msgid "Resources exhausted"
+#~ msgid "LCUP Resources exhausted"
+#~ msgstr "Recursos esgotados"
+
+#, fuzzy
+#~| msgid "Invalid data"
+#~ msgid "LCUP Invalid data"
+#~ msgstr "Dados inválidos"
+
+#, fuzzy
+#~| msgid "General error"
+#~ msgid "LDAP Other general error"
+#~ msgstr "Erro genérico"
+
+#, fuzzy
+#~| msgid "dirmngr error"
+#~ msgid "Encoding error"
+#~ msgstr "Erro no dirmngr"
diff --git a/po/quot.sed b/po/quot.sed
new file mode 100644
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 100644
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/ro.po b/po/ro.po
new file mode 100644
index 0000000..72a52f7
--- /dev/null
+++ b/po/ro.po
@@ -0,0 +1,1523 @@
+# Mesajele în limba română pentru libgpg-error.
+# Copyright (C) 2005 Free Software Foundation, Inc.
+# Acest fişier este distribuit sub aceeaşi licenţă ca şi pachetul libgpg-error.
+# Laurentiu Buzdugan <[email protected]>, 2005.
+#
+#
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: libgpg-error 1.1\n"
+"Report-Msgid-Bugs-To: [email protected]\n"
+"PO-Revision-Date: 2013-02-23 20:10+0100\n"
+"Last-Translator: Laurentiu Buzdugan <[email protected]>\n"
+"Language-Team: Romanian <[email protected]>\n"
+"Language: ro\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"
+
+msgid "Unspecified source"
+msgstr "Sursă nespecificată"
+
+msgid "gcrypt"
+msgstr "gcrypt"
+
+msgid "GnuPG"
+msgstr "GnuPG"
+
+msgid "GpgSM"
+msgstr "GpgSM"
+
+msgid "GPG Agent"
+msgstr "GPG Agent"
+
+msgid "Pinentry"
+msgstr "Introducere pin (pinentry)"
+
+msgid "SCD"
+msgstr "SCD"
+
+msgid "GPGME"
+msgstr "GPGME"
+
+msgid "Keybox"
+msgstr "Keybox"
+
+msgid "KSBA"
+msgstr "KSBA"
+
+msgid "Dirmngr"
+msgstr "Dirmngr"
+
+msgid "GSTI"
+msgstr "GSTI"
+
+msgid "GPA"
+msgstr "GPA"
+
+msgid "Kleopatra"
+msgstr "Kleopatra"
+
+msgid "G13"
+msgstr "G13"
+
+msgid "Assuan"
+msgstr "Assuan"
+
+msgid "TLS"
+msgstr ""
+
+#, fuzzy
+msgid "Any source"
+msgstr "Sursă necunoscută"
+
+msgid "User defined source 1"
+msgstr "Sursă definită de utilizator 1"
+
+msgid "User defined source 2"
+msgstr "Sursă definită de utilizator 2"
+
+msgid "User defined source 3"
+msgstr "Sursă definită de utilizator 3"
+
+msgid "User defined source 4"
+msgstr "Sursă definită de utilizator 4"
+
+msgid "Unknown source"
+msgstr "Sursă necunoscută"
+
+msgid "Success"
+msgstr "Succes"
+
+msgid "General error"
+msgstr "Eroare generală"
+
+msgid "Unknown packet"
+msgstr "Pachet necunoscut"
+
+msgid "Unknown version in packet"
+msgstr "versiune necunoscută în pachet"
+
+msgid "Invalid public key algorithm"
+msgstr "Algoritm cu cheie publică invalid"
+
+msgid "Invalid digest algorithm"
+msgstr "Algoritm rezumat invalid"
+
+msgid "Bad public key"
+msgstr "Cheie publică incorectă"
+
+msgid "Bad secret key"
+msgstr "Cheie secretă incorectă"
+
+msgid "Bad signature"
+msgstr "Semnătură incorectă"
+
+msgid "No public key"
+msgstr "Nici o cheie publică"
+
+msgid "Checksum error"
+msgstr "Eroare checksum"
+
+msgid "Bad passphrase"
+msgstr "Frază-parolă incorectă"
+
+msgid "Invalid cipher algorithm"
+msgstr "Algoritm cifrare invalid"
+
+msgid "Cannot open keyring"
+msgstr "Inel de chei deschis"
+
+msgid "Invalid packet"
+msgstr "Pachet invalid"
+
+msgid "Invalid armor"
+msgstr "Armură invalidă"
+
+msgid "No user ID"
+msgstr "Nici un ID utilizator."
+
+msgid "No secret key"
+msgstr "Nici o cheie secretă"
+
+msgid "Wrong secret key used"
+msgstr "A fost folosită o cheie secretă greşită"
+
+msgid "Bad session key"
+msgstr "Cheie de sesiune incorectă"
+
+msgid "Unknown compression algorithm"
+msgstr "Algoritm compresie necunoscut"
+
+msgid "Number is not prime"
+msgstr "Numărul nu este prim"
+
+msgid "Invalid encoding method"
+msgstr "Valoare de encodare invalidă"
+
+msgid "Invalid encryption scheme"
+msgstr "Schemă de cifrare invalidă"
+
+msgid "Invalid signature scheme"
+msgstr "Schemă de semnături invalidă"
+
+msgid "Invalid attribute"
+msgstr "Argument invalid"
+
+msgid "No value"
+msgstr "Nici o valoare"
+
+msgid "Not found"
+msgstr "Nu a fost găsit(ă)"
+
+msgid "Value not found"
+msgstr "Valoarea nu a fost găsită"
+
+msgid "Syntax error"
+msgstr "Eroare de sintaxă"
+
+msgid "Bad MPI value"
+msgstr "Valoare MPI incorectă"
+
+msgid "Invalid passphrase"
+msgstr "Frază-parolă invalidă"
+
+msgid "Invalid signature class"
+msgstr "Clasă semnături invalidă"
+
+msgid "Resources exhausted"
+msgstr "Resurse epuizate"
+
+msgid "Invalid keyring"
+msgstr "Inel de chei invalid"
+
+msgid "Trust DB error"
+msgstr "Eroare bază de date încredere"
+
+msgid "Bad certificate"
+msgstr "Certificat incorect"
+
+msgid "Invalid user ID"
+msgstr "ID utilizator invalid"
+
+msgid "Unexpected error"
+msgstr "Eroare neaşteptată"
+
+msgid "Time conflict"
+msgstr "Conflict de timp"
+
+msgid "Keyserver error"
+msgstr "Eroare server de chei"
+
+msgid "Wrong public key algorithm"
+msgstr "Algoritm cheie publică greşit"
+
+msgid "Tribute to D. A."
+msgstr "Tribut lui D. A."
+
+msgid "Weak encryption key"
+msgstr "Cheie de cifrare slabă"
+
+msgid "Invalid key length"
+msgstr "Lungime cheie invalidă"
+
+msgid "Invalid argument"
+msgstr "Argument invalid"
+
+msgid "Syntax error in URI"
+msgstr "Eroare de sintaxă în URI"
+
+msgid "Invalid URI"
+msgstr "URI incorect"
+
+msgid "Network error"
+msgstr "Eroare reţea"
+
+msgid "Unknown host"
+msgstr "Gazdă necunoscută"
+
+msgid "Selftest failed"
+msgstr "Auto-test eşuat"
+
+msgid "Data not encrypted"
+msgstr "Date necifrate"
+
+msgid "Data not processed"
+msgstr "Date neprocesate"
+
+msgid "Unusable public key"
+msgstr "Cheie publică de nefolosit"
+
+msgid "Unusable secret key"
+msgstr "cheie secretă de nefolosit"
+
+msgid "Invalid value"
+msgstr "Valoare invalidă"
+
+msgid "Bad certificate chain"
+msgstr "Lanţ certificate incorect"
+
+msgid "Missing certificate"
+msgstr "Certificat lipsă"
+
+msgid "No data"
+msgstr "Nici o dată"
+
+msgid "Bug"
+msgstr "Bug"
+
+msgid "Not supported"
+msgstr "Nu este suportat(ă)"
+
+msgid "Invalid operation code"
+msgstr "Cod operaţie invalid"
+
+msgid "Timeout"
+msgstr "Pauză"
+
+msgid "Internal error"
+msgstr "Eroare internă"
+
+msgid "EOF (gcrypt)"
+msgstr "EOF (gcrypt)"
+
+msgid "Invalid object"
+msgstr "Obiect invalid"
+
+msgid "Provided object is too short"
+msgstr "Obiectul furnizat e prea scurt"
+
+msgid "Provided object is too large"
+msgstr "Obiectul furnizat e prea larg"
+
+msgid "Missing item in object"
+msgstr "Articol lipsă în obiect"
+
+msgid "Not implemented"
+msgstr "Nu a fost implementat(ă)"
+
+msgid "Conflicting use"
+msgstr "Folosire în conflict"
+
+msgid "Invalid cipher mode"
+msgstr "Mod cifru invalid"
+
+msgid "Invalid flag"
+msgstr "Atribut invalid"
+
+msgid "Invalid handle"
+msgstr "Handle invalid"
+
+msgid "Result truncated"
+msgstr "Rezultat invalid"
+
+msgid "Incomplete line"
+msgstr "Linie incompletă"
+
+msgid "Invalid response"
+msgstr "Răspuns invalid"
+
+msgid "No agent running"
+msgstr "Nu rulează nici un agent"
+
+#, fuzzy
+#| msgid "agent error"
+msgid "Agent error"
+msgstr "eroare agent"
+
+msgid "Invalid data"
+msgstr "Date invalide"
+
+#, fuzzy
+msgid "Unspecific Assuan server fault"
+msgstr "Eroare server Assuan"
+
+#, fuzzy
+msgid "General Assuan error"
+msgstr "Eroare generală"
+
+msgid "Invalid session key"
+msgstr "Cheie de sesiune invalidă"
+
+msgid "Invalid S-expression"
+msgstr "Expresie-S invalidă"
+
+msgid "Unsupported algorithm"
+msgstr "Algoritm nesuportat"
+
+msgid "No pinentry"
+msgstr "Nici introducere pin (pinentry)"
+
+msgid "pinentry error"
+msgstr "eroare introducere pin (pinentry) "
+
+msgid "Bad PIN"
+msgstr "PIN incorect"
+
+msgid "Invalid name"
+msgstr "Nume invalid"
+
+msgid "Bad data"
+msgstr "Date incorecte"
+
+msgid "Invalid parameter"
+msgstr "Parametru invalid"
+
+msgid "Wrong card"
+msgstr "Card greşit"
+
+msgid "No dirmngr"
+msgstr "Nici un dirmngr"
+
+msgid "dirmngr error"
+msgstr "eroare dirmngr"
+
+msgid "Certificate revoked"
+msgstr "Certificat revocat"
+
+msgid "No CRL known"
+msgstr "Nici un CRL cunoscut"
+
+msgid "CRL too old"
+msgstr "CRL prea vechi"
+
+msgid "Line too long"
+msgstr "Linie prea lungă"
+
+msgid "Not trusted"
+msgstr "Nu este de încredere"
+
+msgid "Operation cancelled"
+msgstr "Operaţiune anulată"
+
+msgid "Bad CA certificate"
+msgstr "Certificat CA incorect"
+
+msgid "Certificate expired"
+msgstr "Certificat expirat"
+
+msgid "Certificate too young"
+msgstr "Certificat prea recent"
+
+msgid "Unsupported certificate"
+msgstr "Certificat nesuportat"
+
+msgid "Unknown S-expression"
+msgstr "Expresie-S necunoscută"
+
+msgid "Unsupported protection"
+msgstr "Protecţie nesuportată"
+
+msgid "Corrupted protection"
+msgstr "Protecţie coruptă"
+
+msgid "Ambiguous name"
+msgstr "Nume ambiguu"
+
+msgid "Card error"
+msgstr "Eroare card"
+
+msgid "Card reset required"
+msgstr "Este necesară resetarea cardului"
+
+msgid "Card removed"
+msgstr "Card scos"
+
+msgid "Invalid card"
+msgstr "Card invalid"
+
+msgid "Card not present"
+msgstr "Cardul nu este prezent"
+
+msgid "No PKCS15 application"
+msgstr "Nici o aplicaţie PKCS15"
+
+msgid "Not confirmed"
+msgstr "Neconfirmat(ă)"
+
+msgid "Configuration error"
+msgstr "Eroare de configurare"
+
+msgid "No policy match"
+msgstr "Nici o potrivire de politici"
+
+msgid "Invalid index"
+msgstr "Index invalid"
+
+msgid "Invalid ID"
+msgstr "ID invalid"
+
+msgid "No SmartCard daemon"
+msgstr "Nici un daemon SmartCard"
+
+msgid "SmartCard daemon error"
+msgstr "Eroare daemon SmartCard"
+
+msgid "Unsupported protocol"
+msgstr "Protocol nesuportat"
+
+msgid "Bad PIN method"
+msgstr "Metodă PIN incorectă"
+
+msgid "Card not initialized"
+msgstr "Card neiniţializat"
+
+msgid "Unsupported operation"
+msgstr "Operaţie nesuportată"
+
+msgid "Wrong key usage"
+msgstr "Folosire cheie greşită"
+
+msgid "Nothing found"
+msgstr "Nu a fost găsit nimic"
+
+msgid "Wrong blob type"
+msgstr "Tip de blob incorect"
+
+msgid "Missing value"
+msgstr "Valoare lipsă"
+
+msgid "Hardware problem"
+msgstr "Problemă hardware"
+
+msgid "PIN blocked"
+msgstr "PIN blocat"
+
+msgid "Conditions of use not satisfied"
+msgstr "Condiţii de folosire nesatisfăcute"
+
+msgid "PINs are not synced"
+msgstr "PIN-urile nu sunt sincronizate"
+
+msgid "Invalid CRL"
+msgstr "CRL invalid"
+
+msgid "BER error"
+msgstr "Eroare BER"
+
+msgid "Invalid BER"
+msgstr "BER invalid"
+
+msgid "Element not found"
+msgstr "Elementul nu a fost găsit"
+
+msgid "Identifier not found"
+msgstr "Identificator nu a fost găsit"
+
+msgid "Invalid tag"
+msgstr "Etichetă invalidă"
+
+msgid "Invalid length"
+msgstr "Lungime invalidă"
+
+msgid "Invalid key info"
+msgstr "Informaţii cheie invalide"
+
+msgid "Unexpected tag"
+msgstr "Etichetă neaşteptată"
+
+msgid "Not DER encoded"
+msgstr "Nu e encodat DER"
+
+msgid "No CMS object"
+msgstr "Nici un obiect CMS"
+
+msgid "Invalid CMS object"
+msgstr "Obiect CMS invalid"
+
+msgid "Unknown CMS object"
+msgstr "Obiect CMS necunoscut"
+
+msgid "Unsupported CMS object"
+msgstr "Obiect CMS nesuportat"
+
+msgid "Unsupported encoding"
+msgstr "Encodare nesuportată"
+
+msgid "Unsupported CMS version"
+msgstr "Versiune CMS nesuportată"
+
+msgid "Unknown algorithm"
+msgstr "Algoritm necunoscut"
+
+msgid "Invalid crypto engine"
+msgstr "Motor cifrare invalid"
+
+msgid "Public key not trusted"
+msgstr "Cheia publică nu este de încredere"
+
+msgid "Decryption failed"
+msgstr "Decriptarea a eşuat"
+
+msgid "Key expired"
+msgstr "Cheie expirată"
+
+msgid "Signature expired"
+msgstr "Semnătură expirată"
+
+msgid "Encoding problem"
+msgstr "Problemă de encodare"
+
+msgid "Invalid state"
+msgstr "Stare invalidă"
+
+msgid "Duplicated value"
+msgstr "Valoare dublă"
+
+msgid "Missing action"
+msgstr "Acţiune lipsă"
+
+msgid "ASN.1 module not found"
+msgstr "Modulul ASN.1 nu a fost găsit"
+
+msgid "Invalid OID string"
+msgstr "Şir OID invalid"
+
+msgid "Invalid time"
+msgstr "Timp invalid"
+
+msgid "Invalid CRL object"
+msgstr "Obiect CRL invalid"
+
+msgid "Unsupported CRL version"
+msgstr "Versiune CRL nesuportată"
+
+msgid "Invalid certificate object"
+msgstr "Obiect certificat incorect"
+
+msgid "Unknown name"
+msgstr "Nume necunoscut"
+
+msgid "A locale function failed"
+msgstr "O funcţie locale a eşuat"
+
+msgid "Not locked"
+msgstr "Neforţat(ă)"
+
+msgid "Protocol violation"
+msgstr "Violare de protocol"
+
+msgid "Invalid MAC"
+msgstr "MAC invalid"
+
+msgid "Invalid request"
+msgstr "Cerere invalidă"
+
+#, fuzzy
+msgid "Unknown extension"
+msgstr "Expresie-S necunoscută"
+
+#, fuzzy
+msgid "Unknown critical extension"
+msgstr "Expresie-S necunoscută"
+
+#, fuzzy
+msgid "Locked"
+msgstr "Neforţat(ă)"
+
+#, fuzzy
+msgid "Unknown option"
+msgstr "Expresie-S necunoscută"
+
+#, fuzzy
+msgid "Unknown command"
+msgstr "Cod de eroare necunoscut"
+
+#, fuzzy
+msgid "Not operational"
+msgstr "Operaţie nesuportată"
+
+#, fuzzy
+msgid "No passphrase given"
+msgstr "Frază-parolă incorectă"
+
+msgid "No PIN given"
+msgstr ""
+
+#, fuzzy
+msgid "Not enabled"
+msgstr "Neforţat(ă)"
+
+#, fuzzy
+msgid "No crypto engine"
+msgstr "Motor cifrare invalid"
+
+#, fuzzy
+msgid "Missing key"
+msgstr "Valoare lipsă"
+
+#, fuzzy
+msgid "Too many objects"
+msgstr "Nici un obiect CMS"
+
+msgid "Limit reached"
+msgstr ""
+
+#, fuzzy
+msgid "Not initialized"
+msgstr "Card neiniţializat"
+
+#, fuzzy
+msgid "Missing issuer certificate"
+msgstr "Certificat lipsă"
+
+msgid "No keyserver available"
+msgstr ""
+
+#, fuzzy
+msgid "Invalid elliptic curve"
+msgstr "Timp invalid"
+
+#, fuzzy
+msgid "Unknown elliptic curve"
+msgstr "Sursă necunoscută"
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated key"
+msgstr "Valoare dublă"
+
+#, fuzzy
+#| msgid "Ambiguous name"
+msgid "Ambiguous result"
+msgstr "Nume ambiguu"
+
+#, fuzzy
+msgid "No crypto context"
+msgstr "Motor cifrare invalid"
+
+#, fuzzy
+msgid "Wrong crypto context"
+msgstr "Motor cifrare invalid"
+
+#, fuzzy
+#| msgid "Invalid crypto engine"
+msgid "Bad crypto context"
+msgstr "Motor cifrare invalid"
+
+msgid "Conflict in the crypto context"
+msgstr ""
+
+#, fuzzy
+#| msgid "No public key"
+msgid "Broken public key"
+msgstr "Nici o cheie publică"
+
+#, fuzzy
+#| msgid "No secret key"
+msgid "Broken secret key"
+msgstr "Nici o cheie secretă"
+
+#, fuzzy
+#| msgid "Invalid digest algorithm"
+msgid "Invalid MAC algorithm"
+msgstr "Algoritm rezumat invalid"
+
+#, fuzzy
+msgid "Operation fully cancelled"
+msgstr "Operaţiune anulată"
+
+#, fuzzy
+msgid "Operation not yet finished"
+msgstr "Operaţiune anulată"
+
+msgid "Buffer too short"
+msgstr "Buffer prea scurt"
+
+msgid "Invalid length specifier in S-expression"
+msgstr "Specificarea lungimii invalidă în expresia-S"
+
+msgid "String too long in S-expression"
+msgstr "Şir prea lung în expresia-S"
+
+msgid "Unmatched parentheses in S-expression"
+msgstr "Paranteză fără pereche în expresia-S"
+
+msgid "S-expression not canonical"
+msgstr "Expresia-S nu este canonică"
+
+msgid "Bad character in S-expression"
+msgstr "Caracter invalid în expresia-S"
+
+msgid "Bad quotation in S-expression"
+msgstr "Ghilimele incorecte în expresia-S"
+
+msgid "Zero prefix in S-expression"
+msgstr "Prefix zero în expresia-S"
+
+msgid "Nested display hints in S-expression"
+msgstr "Indicaţii de afişare încuibărite în expresia-S"
+
+msgid "Unmatched display hints"
+msgstr "Indicaţii de afişare fără pereche"
+
+msgid "Unexpected reserved punctuation in S-expression"
+msgstr "Punctuaţie rezervată neaşteptată în expresia-S"
+
+msgid "Bad hexadecimal character in S-expression"
+msgstr "Caracter hexazecimal incorect în expresia-S"
+
+msgid "Odd hexadecimal numbers in S-expression"
+msgstr "Numere hexazecimale ciudate în expresia-S"
+
+msgid "Bad octal character in S-expression"
+msgstr "Caracter octal incorect în expresia-S"
+
+msgid "All subkeys are expired or revoked"
+msgstr ""
+
+#, fuzzy
+#| msgid "Data not encrypted"
+msgid "Database is corrupted"
+msgstr "Date necifrate"
+
+msgid "Server indicated a failure"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "No name"
+msgstr "Nume necunoscut"
+
+#, fuzzy
+#| msgid "No public key"
+msgid "No key"
+msgstr "Nici o cheie publică"
+
+msgid "Legacy key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Buffer too short"
+msgid "Request too short"
+msgstr "Buffer prea scurt"
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "Request too long"
+msgstr "Linie prea lungă"
+
+msgid "Object is in termination state"
+msgstr ""
+
+#, fuzzy
+#| msgid "Bad certificate chain"
+msgid "No certificate chain"
+msgstr "Lanţ certificate incorect"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Certificate is too large"
+msgstr "Certificat prea recent"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid record"
+msgstr "Card invalid"
+
+msgid "The MAC does not verify"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unexpected tag"
+msgid "Unexpected message"
+msgstr "Etichetă neaşteptată"
+
+msgid "Compression or decompression failed"
+msgstr ""
+
+msgid "A counter would wrap"
+msgstr ""
+
+msgid "Fatal alert message received"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid cipher algorithm"
+msgid "No cipher algorithm"
+msgstr "Algoritm cifrare invalid"
+
+#, fuzzy
+msgid "Missing client certificate"
+msgstr "Certificat lipsă"
+
+#, fuzzy
+#| msgid "Certificate revoked"
+msgid "Close notification received"
+msgstr "Certificat revocat"
+
+#, fuzzy
+#| msgid "Key expired"
+msgid "Ticket expired"
+msgstr "Cheie expirată"
+
+#, fuzzy
+#| msgid "Bad public key"
+msgid "Bad ticket"
+msgstr "Cheie publică incorectă"
+
+#, fuzzy
+#| msgid "Unknown packet"
+msgid "Unknown identity"
+msgstr "Pachet necunoscut"
+
+#, fuzzy
+#| msgid "Bad certificate chain"
+msgid "Bad certificate message in handshake"
+msgstr "Lanţ certificate incorect"
+
+msgid "Bad certificate request message in handshake"
+msgstr ""
+
+msgid "Bad certificate verify message in handshake"
+msgstr ""
+
+msgid "Bad change cipher message in handshake"
+msgstr ""
+
+msgid "Bad client hello message in handshake"
+msgstr ""
+
+msgid "Bad server hello message in handshake"
+msgstr ""
+
+msgid "Bad server hello done message in handshake"
+msgstr ""
+
+msgid "Bad finished message in handshake"
+msgstr ""
+
+msgid "Bad server key exchange message in handshake"
+msgstr ""
+
+msgid "Bad client key exchange message in handshake"
+msgstr ""
+
+msgid "Bogus string"
+msgstr ""
+
+msgid "Forbidden"
+msgstr ""
+
+#, fuzzy
+#| msgid "Key expired"
+msgid "Key disabled"
+msgstr "Cheie expirată"
+
+msgid "Not possible with a card based key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid object"
+msgid "Invalid lock object"
+msgstr "Obiect invalid"
+
+msgid "True"
+msgstr ""
+
+msgid "False"
+msgstr ""
+
+#, fuzzy
+msgid "General IPC error"
+msgstr "Eroare generală"
+
+msgid "IPC accept call failed"
+msgstr ""
+
+msgid "IPC connect call failed"
+msgstr ""
+
+#, fuzzy
+msgid "Invalid IPC response"
+msgstr "Răspuns invalid"
+
+#, fuzzy
+msgid "Invalid value passed to IPC"
+msgstr "Valoare invalidă"
+
+#, fuzzy
+msgid "Incomplete line passed to IPC"
+msgstr "Linie incompletă"
+
+#, fuzzy
+msgid "Line passed to IPC too long"
+msgstr "Linie prea lungă"
+
+msgid "Nested IPC commands"
+msgstr ""
+
+msgid "No data callback in IPC"
+msgstr ""
+
+msgid "No inquire callback in IPC"
+msgstr ""
+
+msgid "Not an IPC server"
+msgstr ""
+
+msgid "Not an IPC client"
+msgstr ""
+
+msgid "Problem starting IPC server"
+msgstr ""
+
+#, fuzzy
+msgid "IPC read error"
+msgstr "Eroare card"
+
+#, fuzzy
+msgid "IPC write error"
+msgstr "Eroare card"
+
+msgid "Too much data for IPC layer"
+msgstr ""
+
+#, fuzzy
+msgid "Unexpected IPC command"
+msgstr "Etichetă neaşteptată"
+
+#, fuzzy
+msgid "Unknown IPC command"
+msgstr "Cod de eroare necunoscut"
+
+#, fuzzy
+msgid "IPC syntax error"
+msgstr "Eroare de sintaxă"
+
+msgid "IPC call has been cancelled"
+msgstr ""
+
+msgid "No input source for IPC"
+msgstr ""
+
+msgid "No output source for IPC"
+msgstr ""
+
+#, fuzzy
+msgid "IPC parameter error"
+msgstr "Eroare card"
+
+#, fuzzy
+msgid "Unknown IPC inquire"
+msgstr "Sursă necunoscută"
+
+#, fuzzy
+msgid "Crypto engine too old"
+msgstr "Motor cifrare invalid"
+
+msgid "Screen or window too small"
+msgstr ""
+
+msgid "Screen or window too large"
+msgstr ""
+
+msgid "Required environment variable not set"
+msgstr ""
+
+msgid "User ID already exists"
+msgstr ""
+
+msgid "Name already exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated name"
+msgstr "Valoare dublă"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Object is too young"
+msgstr "Certificat prea recent"
+
+#, fuzzy
+#| msgid "Provided object is too short"
+msgid "Object is too old"
+msgstr "Obiectul furnizat e prea scurt"
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Unknown flag"
+msgstr "Nume necunoscut"
+
+#, fuzzy
+#| msgid "Invalid operation code"
+msgid "Invalid execution order"
+msgstr "Cod operaţie invalid"
+
+msgid "Already fetched"
+msgstr ""
+
+msgid "Try again later"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Wrong name"
+msgstr "Nume necunoscut"
+
+msgid "System bug detected"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown system error"
+msgid "Unknown DNS error"
+msgstr "Eroare de sistem necunoscută"
+
+#, fuzzy
+#| msgid "Invalid OID string"
+msgid "Invalid DNS section"
+msgstr "Şir OID invalid"
+
+#, fuzzy
+#| msgid "Invalid S-expression"
+msgid "Invalid textual address form"
+msgstr "Expresie-S invalidă"
+
+#, fuzzy
+msgid "Missing DNS query packet"
+msgstr "Certificat lipsă"
+
+msgid "Missing DNS answer packet"
+msgstr ""
+
+msgid "Connection closed in DNS"
+msgstr ""
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "Verification failed in DNS"
+msgstr "Decriptarea a eşuat"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "DNS Timeout"
+msgstr "Pauză"
+
+#, fuzzy
+msgid "General LDAP error"
+msgstr "Eroare generală"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP attribute error"
+msgstr "Eroare generală"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP name error"
+msgstr "Eroare generală"
+
+#, fuzzy
+msgid "General LDAP security error"
+msgstr "Eroare generală"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP service error"
+msgstr "Eroare generală"
+
+#, fuzzy
+msgid "General LDAP update error"
+msgstr "Eroare generală"
+
+msgid "Experimental LDAP error code"
+msgstr ""
+
+#, fuzzy
+msgid "Private LDAP error code"
+msgstr "Eroare card"
+
+#, fuzzy
+msgid "Other general LDAP error"
+msgstr "Eroare generală"
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "LDAP connecting failed (X)"
+msgstr "Decriptarea a eşuat"
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral limit exceeded"
+msgstr "Eroare generală"
+
+msgid "LDAP client loop"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "No LDAP results returned"
+msgstr "Este necesară resetarea cardului"
+
+#, fuzzy
+#| msgid "Element not found"
+msgid "LDAP control not found"
+msgstr "Elementul nu a fost găsit"
+
+#, fuzzy
+#| msgid "Not supported"
+msgid "Not supported by LDAP"
+msgstr "Nu este suportat(ă)"
+
+#, fuzzy
+#| msgid "Unexpected error"
+msgid "LDAP connect error"
+msgstr "Eroare neaşteptată"
+
+msgid "Out of memory in LDAP"
+msgstr ""
+
+msgid "Bad parameter to an LDAP routine"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported operation"
+msgid "User cancelled LDAP operation"
+msgstr "Operaţie nesuportată"
+
+#, fuzzy
+#| msgid "Bad certificate"
+msgid "Bad LDAP search filter"
+msgstr "Certificat incorect"
+
+#, fuzzy
+msgid "Unknown LDAP authentication method"
+msgstr "Expresie-S necunoscută"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "Timeout in LDAP"
+msgstr "Pauză"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP decoding error"
+msgstr "eroare dirmngr"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP encoding error"
+msgstr "eroare dirmngr"
+
+#, fuzzy
+msgid "LDAP local error"
+msgstr "Eroare card"
+
+msgid "Cannot contact LDAP server"
+msgstr ""
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP success"
+msgstr "Succes"
+
+#, fuzzy
+#| msgid "Configuration error"
+msgid "LDAP operations error"
+msgstr "Eroare de configurare"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP protocol error"
+msgstr "Violare de protocol"
+
+msgid "Time limit exceeded in LDAP"
+msgstr ""
+
+msgid "Size limit exceeded in LDAP"
+msgstr ""
+
+msgid "LDAP compare false"
+msgstr ""
+
+msgid "LDAP compare true"
+msgstr ""
+
+#, fuzzy
+msgid "LDAP authentication method not supported"
+msgstr "Expresie-S necunoscută"
+
+msgid "Strong(er) LDAP authentication required"
+msgstr ""
+
+msgid "Partial LDAP results+referral received"
+msgstr ""
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral"
+msgstr "Eroare generală"
+
+msgid "Administrative LDAP limit exceeded"
+msgstr ""
+
+msgid "Critical LDAP extension is unavailable"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Confidentiality required by LDAP"
+msgstr "Este necesară resetarea cardului"
+
+msgid "LDAP SASL bind in progress"
+msgstr ""
+
+msgid "No such LDAP attribute"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid attribute"
+msgid "Undefined LDAP attribute type"
+msgstr "Argument invalid"
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate matching in LDAP"
+msgstr "Protecţie nesuportată"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Constraint violation in LDAP"
+msgstr "Violare de protocol"
+
+msgid "LDAP type or value exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid syntax in LDAP"
+msgstr "Stare invalidă"
+
+#, fuzzy
+#| msgid "No CMS object"
+msgid "No such LDAP object"
+msgstr "Nici un obiect CMS"
+
+#, fuzzy
+#| msgid "Hardware problem"
+msgid "LDAP alias problem"
+msgstr "Problemă hardware"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid DN syntax in LDAP"
+msgstr "Stare invalidă"
+
+msgid "LDAP entry is a leaf"
+msgstr ""
+
+#, fuzzy
+#| msgid "Encoding problem"
+msgid "LDAP alias dereferencing problem"
+msgstr "Problemă de encodare"
+
+msgid "LDAP proxy authorization failure (X)"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate LDAP authentication"
+msgstr "Protecţie nesuportată"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid LDAP credentials"
+msgstr "Card invalid"
+
+msgid "Insufficient access for LDAP"
+msgstr ""
+
+msgid "LDAP server is busy"
+msgstr ""
+
+msgid "LDAP server is unavailable"
+msgstr ""
+
+msgid "LDAP server is unwilling to perform"
+msgstr ""
+
+msgid "Loop detected by LDAP"
+msgstr ""
+
+#, fuzzy
+#| msgid "Missing action"
+msgid "LDAP naming violation"
+msgstr "Acţiune lipsă"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP object class violation"
+msgstr "Violare de protocol"
+
+#, fuzzy
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "Operaţiune anulată"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation not allowed on RDN"
+msgstr "Operaţiune anulată"
+
+msgid "Already exists (LDAP)"
+msgstr ""
+
+msgid "Cannot modify LDAP object class"
+msgstr ""
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "LDAP results too large"
+msgstr "Linie prea lungă"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation affects multiple DSAs"
+msgstr "Operaţiune anulată"
+
+msgid "Virtual LDAP list view error"
+msgstr ""
+
+#, fuzzy
+msgid "Other LDAP error"
+msgstr "Eroare generală"
+
+#, fuzzy
+#| msgid "Resources exhausted"
+msgid "Resources exhausted in LCUP"
+msgstr "Resurse epuizate"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Security violation in LCUP"
+msgstr "Violare de protocol"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid data in LCUP"
+msgstr "Stare invalidă"
+
+#, fuzzy
+#| msgid "Unsupported certificate"
+msgid "Unsupported scheme in LCUP"
+msgstr "Certificat nesuportat"
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Reload required in LCUP"
+msgstr "Este necesară resetarea cardului"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP cancelled"
+msgstr "Succes"
+
+#, fuzzy
+msgid "No LDAP operation to cancel"
+msgstr "Operaţie nesuportată"
+
+#, fuzzy
+msgid "Too late to cancel LDAP"
+msgstr "Operaţie nesuportată"
+
+msgid "Cannot cancel LDAP"
+msgstr ""
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "LDAP assertion failed"
+msgstr "Decriptarea a eşuat"
+
+msgid "Proxied authorization denied by LDAP"
+msgstr ""
+
+msgid "User defined error code 1"
+msgstr "Cod de eroare definit de utilizator 1"
+
+msgid "User defined error code 2"
+msgstr "Cod de eroare definit de utilizator 2"
+
+msgid "User defined error code 3"
+msgstr "Cod de eroare definit de utilizator 3"
+
+msgid "User defined error code 4"
+msgstr "Cod de eroare definit de utilizator 4"
+
+msgid "User defined error code 5"
+msgstr "Cod de eroare definit de utilizator 5"
+
+msgid "User defined error code 6"
+msgstr "Cod de eroare definit de utilizator 6"
+
+msgid "User defined error code 7"
+msgstr "Cod de eroare definit de utilizator 7"
+
+msgid "User defined error code 8"
+msgstr "Cod de eroare definit de utilizator 8"
+
+msgid "User defined error code 9"
+msgstr "Cod de eroare definit de utilizator 9"
+
+msgid "User defined error code 10"
+msgstr "Cod de eroare definit de utilizator 10"
+
+msgid "User defined error code 11"
+msgstr "Cod de eroare definit de utilizator 11"
+
+msgid "User defined error code 12"
+msgstr "Cod de eroare definit de utilizator 12"
+
+msgid "User defined error code 13"
+msgstr "Cod de eroare definit de utilizator 13"
+
+msgid "User defined error code 14"
+msgstr "Cod de eroare definit de utilizator 14"
+
+msgid "User defined error code 15"
+msgstr "Cod de eroare definit de utilizator 15"
+
+msgid "User defined error code 16"
+msgstr "Cod de eroare definit de utilizator 16"
+
+msgid "System error w/o errno"
+msgstr ""
+
+msgid "Unknown system error"
+msgstr "Eroare de sistem necunoscută"
+
+msgid "End of file"
+msgstr "Sfârşit de fişier"
+
+msgid "Unknown error code"
+msgstr "Cod de eroare necunoscut"
+
+#, c-format
+msgid "Usage: %s GPG-ERROR [...]\n"
+msgstr "Folosire: %s EROARE-GPG [...]\n"
+
+#, c-format
+msgid "%s: warning: could not recognize %s\n"
+msgstr "%s: avertisment: nu am putut recunoaşte %s\n"
+
+#, fuzzy
+#~| msgid "Resources exhausted"
+#~ msgid "LCUP Resources exhausted"
+#~ msgstr "Resurse epuizate"
+
+#, fuzzy
+#~| msgid "Invalid data"
+#~ msgid "LCUP Invalid data"
+#~ msgstr "Date invalide"
+
+#, fuzzy
+#~| msgid "General error"
+#~ msgid "LDAP Other general error"
+#~ msgstr "Eroare generală"
+
+#, fuzzy
+#~| msgid "dirmngr error"
+#~ msgid "Encoding error"
+#~ msgstr "eroare dirmngr"
diff --git a/po/ru.po b/po/ru.po
new file mode 100644
index 0000000..a511618
--- /dev/null
+++ b/po/ru.po
@@ -0,0 +1,1335 @@
+# Russian translation for libgpg-error.
+# Copyright (C) 2015 Free Software Foundation, Inc.
+# This file is distributed under the same license as the original package.
+# Ineiev <[email protected]>, 2014, 2015
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: libgpg-error\n"
+"Report-Msgid-Bugs-To: [email protected]\n"
+"PO-Revision-Date: 2015-09-27 12:04+0000\n"
+"Last-Translator: Ineiev <[email protected]>\n"
+"Language-Team: Russian <[email protected]>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "Unspecified source"
+msgstr "Неуказанный источник"
+
+msgid "gcrypt"
+msgstr "gcrypt"
+
+msgid "GnuPG"
+msgstr "GnuPG"
+
+msgid "GpgSM"
+msgstr "GpgSM"
+
+msgid "GPG Agent"
+msgstr "Агент GPG"
+
+msgid "Pinentry"
+msgstr "Ввод PIN"
+
+msgid "SCD"
+msgstr "SCD"
+
+msgid "GPGME"
+msgstr "GPGME"
+
+msgid "Keybox"
+msgstr "Щит для ключей"
+
+msgid "KSBA"
+msgstr "KSBA"
+
+msgid "Dirmngr"
+msgstr "Dirmngr"
+
+msgid "GSTI"
+msgstr "GSTI"
+
+msgid "GPA"
+msgstr "GPA"
+
+msgid "Kleopatra"
+msgstr "Kleopatra"
+
+msgid "G13"
+msgstr "G13"
+
+msgid "Assuan"
+msgstr "Assuan"
+
+msgid "TLS"
+msgstr "TLS"
+
+msgid "Any source"
+msgstr "Любой источник"
+
+msgid "User defined source 1"
+msgstr "Пользовательский источник 1"
+
+msgid "User defined source 2"
+msgstr "Пользовательский источник 2"
+
+msgid "User defined source 3"
+msgstr "Пользовательский источник 3"
+
+msgid "User defined source 4"
+msgstr "Пользовательский источник 4"
+
+msgid "Unknown source"
+msgstr "Неизвестный источник"
+
+msgid "Success"
+msgstr "Успешное завершение"
+
+msgid "General error"
+msgstr "Общая ошибка"
+
+msgid "Unknown packet"
+msgstr "Неизвестный пакет"
+
+msgid "Unknown version in packet"
+msgstr "Неизвестная версия в пакете"
+
+msgid "Invalid public key algorithm"
+msgstr "Недопустимый алгоритм шифрования с открытым ключом"
+
+msgid "Invalid digest algorithm"
+msgstr "Недопустимая хэш-функция"
+
+msgid "Bad public key"
+msgstr "Плохой открытый ключ"
+
+msgid "Bad secret key"
+msgstr "Плохой закрытый ключ"
+
+msgid "Bad signature"
+msgstr "Плохая подпись"
+
+msgid "No public key"
+msgstr "Нет открытого ключа"
+
+msgid "Checksum error"
+msgstr "Ошибка контрольной суммы"
+
+msgid "Bad passphrase"
+msgstr "Плохая фраза-пароль"
+
+msgid "Invalid cipher algorithm"
+msgstr "Недопустимый алгоритм симметричного шифрования"
+
+msgid "Cannot open keyring"
+msgstr "Таблица ключей открыта"
+
+msgid "Invalid packet"
+msgstr "Недопустимый пакет"
+
+msgid "Invalid armor"
+msgstr "Недопустимый текстовый формат"
+
+msgid "No user ID"
+msgstr "Нет ID пользователя"
+
+msgid "No secret key"
+msgstr "Нет закрытого ключа"
+
+msgid "Wrong secret key used"
+msgstr "Использован неверный закрытый ключ"
+
+msgid "Bad session key"
+msgstr "Плохой сеансовый ключ"
+
+msgid "Unknown compression algorithm"
+msgstr "Неизвестный алгоритм сжатия"
+
+msgid "Number is not prime"
+msgstr "Число не простое"
+
+msgid "Invalid encoding method"
+msgstr "Недопустимый метод кодирования"
+
+msgid "Invalid encryption scheme"
+msgstr "Недопустимая схема шифрования"
+
+msgid "Invalid signature scheme"
+msgstr "Недопустимая схема подписи"
+
+msgid "Invalid attribute"
+msgstr "Недопустимый атрибут"
+
+msgid "No value"
+msgstr "Нет значения"
+
+msgid "Not found"
+msgstr "Не найдено"
+
+msgid "Value not found"
+msgstr "Значение не найдено"
+
+msgid "Syntax error"
+msgstr "Синтаксическая ошибка"
+
+msgid "Bad MPI value"
+msgstr "Плохое значение MPI"
+
+msgid "Invalid passphrase"
+msgstr "Неверная фраза-пароль"
+
+msgid "Invalid signature class"
+msgstr "Недопустимый класс подписи"
+
+msgid "Resources exhausted"
+msgstr "Нехватка ресурсов"
+
+msgid "Invalid keyring"
+msgstr "Неверная таблица ключей"
+
+msgid "Trust DB error"
+msgstr "Ошибка таблицы доверия"
+
+msgid "Bad certificate"
+msgstr "Плохой сертификат"
+
+msgid "Invalid user ID"
+msgstr "Недопустимый ID пользователя"
+
+msgid "Unexpected error"
+msgstr "Неожиданная ошибка"
+
+msgid "Time conflict"
+msgstr "Противоречие времен"
+
+msgid "Keyserver error"
+msgstr "Ошибка сервера ключей"
+
+msgid "Wrong public key algorithm"
+msgstr "Неверный алгоритм шифрования с открытым ключом"
+
+msgid "Tribute to D. A."
+msgstr "Благодаря D. A."
+
+msgid "Weak encryption key"
+msgstr "Слабый ключ шифрования"
+
+msgid "Invalid key length"
+msgstr "Недопустимая длина ключа"
+
+msgid "Invalid argument"
+msgstr "Недопустимый аргумент"
+
+msgid "Syntax error in URI"
+msgstr "Синтаксическая ошибка в URI"
+
+msgid "Invalid URI"
+msgstr "Недопустимый URI"
+
+msgid "Network error"
+msgstr "Ошибка сети"
+
+msgid "Unknown host"
+msgstr "Неизвестный хост"
+
+msgid "Selftest failed"
+msgstr "Сбой при самопроверке"
+
+msgid "Data not encrypted"
+msgstr "Данные не зашифрованы"
+
+msgid "Data not processed"
+msgstr "Данные не обработаны"
+
+msgid "Unusable public key"
+msgstr "Непригодный открытый ключ"
+
+msgid "Unusable secret key"
+msgstr "Непригодный закрытый ключ"
+
+msgid "Invalid value"
+msgstr "Недопустимое значение"
+
+msgid "Bad certificate chain"
+msgstr "Плохая сертификатная цепь"
+
+msgid "Missing certificate"
+msgstr "Не хватает сертификата"
+
+msgid "No data"
+msgstr "Нет данных"
+
+msgid "Bug"
+msgstr "Ошибка в программе"
+
+msgid "Not supported"
+msgstr "Не поддерживается"
+
+msgid "Invalid operation code"
+msgstr "Недопустимый код операции"
+
+msgid "Timeout"
+msgstr "Лимит времени"
+
+msgid "Internal error"
+msgstr "Внутренняя ошибка"
+
+msgid "EOF (gcrypt)"
+msgstr "Конец файла (gcrypt)"
+
+msgid "Invalid object"
+msgstr "Недопустимый объект"
+
+msgid "Provided object is too short"
+msgstr "Введенный объект слишком мал"
+
+msgid "Provided object is too large"
+msgstr "Введенный объект слишком велик"
+
+msgid "Missing item in object"
+msgstr "В объекте недостает элемента"
+
+msgid "Not implemented"
+msgstr "Не реализовано"
+
+msgid "Conflicting use"
+msgstr "Противоречивое использование"
+
+msgid "Invalid cipher mode"
+msgstr "Недопустимый решим шифрования"
+
+msgid "Invalid flag"
+msgstr "Недопустимый признак"
+
+msgid "Invalid handle"
+msgstr "Недопустимый указатель"
+
+msgid "Result truncated"
+msgstr "Результат усечен"
+
+msgid "Incomplete line"
+msgstr "Неполная строка"
+
+msgid "Invalid response"
+msgstr "Недопустимый ответ"
+
+msgid "No agent running"
+msgstr "Агент не работает"
+
+msgid "Agent error"
+msgstr "Ошибка агента"
+
+msgid "Invalid data"
+msgstr "Недопустимые данные"
+
+msgid "Unspecific Assuan server fault"
+msgstr "Неуточненный отказ сервера Assuan"
+
+msgid "General Assuan error"
+msgstr "Общая ошибка Assuan"
+
+msgid "Invalid session key"
+msgstr "Недопустимый сеансовый ключ"
+
+msgid "Invalid S-expression"
+msgstr "Недопустимое S-выражение"
+
+msgid "Unsupported algorithm"
+msgstr "Алгоритм не поддерживается"
+
+msgid "No pinentry"
+msgstr "Нет модуля ввода PIN"
+
+msgid "pinentry error"
+msgstr "ошибка ввода PIN"
+
+msgid "Bad PIN"
+msgstr "Плохой PIN"
+
+msgid "Invalid name"
+msgstr "Недопустимое имя"
+
+msgid "Bad data"
+msgstr "Плохие данные"
+
+msgid "Invalid parameter"
+msgstr "Недопустимый параметр"
+
+msgid "Wrong card"
+msgstr "Неверная карта"
+
+msgid "No dirmngr"
+msgstr "Нет dirmngr"
+
+msgid "dirmngr error"
+msgstr "ошибка dirmngr"
+
+msgid "Certificate revoked"
+msgstr "Сертификат отозван"
+
+msgid "No CRL known"
+msgstr "Список отозванных сертификатов неизвестен"
+
+msgid "CRL too old"
+msgstr "Список отозванных сертификатов слишком стар"
+
+msgid "Line too long"
+msgstr "Слишком длинная строка"
+
+msgid "Not trusted"
+msgstr "Не доверенный"
+
+msgid "Operation cancelled"
+msgstr "Операция отменена"
+
+msgid "Bad CA certificate"
+msgstr "Плохой сертификат центра сертификации"
+
+msgid "Certificate expired"
+msgstr "Срок действия сертификата истек"
+
+msgid "Certificate too young"
+msgstr "Сертификат слишком новый"
+
+msgid "Unsupported certificate"
+msgstr "Сертификат не поддерживается"
+
+msgid "Unknown S-expression"
+msgstr "Неизвестное S-выражение"
+
+msgid "Unsupported protection"
+msgstr "Защита не поддерживается"
+
+msgid "Corrupted protection"
+msgstr "Повреждение защиты"
+
+msgid "Ambiguous name"
+msgstr "Неоднозначное имя"
+
+msgid "Card error"
+msgstr "Ошибка карты"
+
+msgid "Card reset required"
+msgstr "Требуется перезапуск карты"
+
+msgid "Card removed"
+msgstr "Карта удалена"
+
+msgid "Invalid card"
+msgstr "Непригодная карта"
+
+msgid "Card not present"
+msgstr "Карта отсутствует"
+
+msgid "No PKCS15 application"
+msgstr "Нет приложения PKCS15"
+
+msgid "Not confirmed"
+msgstr "Нет подтверждения"
+
+msgid "Configuration error"
+msgstr "Ошибка конфигурации"
+
+msgid "No policy match"
+msgstr "Проблема с правилами"
+
+msgid "Invalid index"
+msgstr "Недопустимый индекс"
+
+msgid "Invalid ID"
+msgstr "Недопустимый идентификатор"
+
+msgid "No SmartCard daemon"
+msgstr "Нет демона смарткарт"
+
+msgid "SmartCard daemon error"
+msgstr "Ошибка демона смарткарт"
+
+msgid "Unsupported protocol"
+msgstr "Протокол не поддерживается"
+
+msgid "Bad PIN method"
+msgstr "Плохой метод PIN"
+
+msgid "Card not initialized"
+msgstr "Карта не инициализирована"
+
+msgid "Unsupported operation"
+msgstr "Операция не поддерживается"
+
+msgid "Wrong key usage"
+msgstr "Неверное применение ключей"
+
+msgid "Nothing found"
+msgstr "Ничего не найдено"
+
+msgid "Wrong blob type"
+msgstr "Кусок неподходящего типа"
+
+msgid "Missing value"
+msgstr "Не хватает значения"
+
+msgid "Hardware problem"
+msgstr "Аппаратная проблема"
+
+msgid "PIN blocked"
+msgstr "PIN заблокирован"
+
+msgid "Conditions of use not satisfied"
+msgstr "Нарушены условия пользования"
+
+msgid "PINs are not synced"
+msgstr "Разные PIN не синхронизированы"
+
+msgid "Invalid CRL"
+msgstr "Недопустимый список отозванных сертификатов"
+
+msgid "BER error"
+msgstr "Ошибка BER"
+
+msgid "Invalid BER"
+msgstr "Недопустимый BER"
+
+msgid "Element not found"
+msgstr "Элемент не найден"
+
+msgid "Identifier not found"
+msgstr "Идентификатор не найден"
+
+msgid "Invalid tag"
+msgstr "Недопустимый тег"
+
+msgid "Invalid length"
+msgstr "Недопустимая длина"
+
+msgid "Invalid key info"
+msgstr "Недопустимая информация ключа"
+
+msgid "Unexpected tag"
+msgstr "Неожиданный тег"
+
+msgid "Not DER encoded"
+msgstr "Не закодировано по DER"
+
+msgid "No CMS object"
+msgstr "Нет объекта CMS"
+
+msgid "Invalid CMS object"
+msgstr "Недопустимый объект CMS"
+
+msgid "Unknown CMS object"
+msgstr "Неизвестный объект CMS"
+
+msgid "Unsupported CMS object"
+msgstr "Объект CMS не поддерживается"
+
+msgid "Unsupported encoding"
+msgstr "Кодировка не поддерживается"
+
+msgid "Unsupported CMS version"
+msgstr "Версия CMS не поддерживается"
+
+msgid "Unknown algorithm"
+msgstr "Неизвестный алгоритм"
+
+msgid "Invalid crypto engine"
+msgstr "Недопустимый криптомеханизм"
+
+msgid "Public key not trusted"
+msgstr "Открытый ключ не доверенный"
+
+msgid "Decryption failed"
+msgstr "Сбой расшифровки"
+
+msgid "Key expired"
+msgstr "Срок действия ключа истек"
+
+msgid "Signature expired"
+msgstr "Срок действия подписи истек"
+
+msgid "Encoding problem"
+msgstr "Проблема с кодировкой"
+
+msgid "Invalid state"
+msgstr "Недопустимое состояние"
+
+msgid "Duplicated value"
+msgstr "Величина продублирована"
+
+msgid "Missing action"
+msgstr "Не хватает действия"
+
+msgid "ASN.1 module not found"
+msgstr "Модуль ASN.1 не найден"
+
+msgid "Invalid OID string"
+msgstr "Недопустимая строка OID"
+
+msgid "Invalid time"
+msgstr "Недопустимое время"
+
+msgid "Invalid CRL object"
+msgstr "Недопустимый объект списка отозванных сертификатов"
+
+msgid "Unsupported CRL version"
+msgstr "Версия списка отозванных сертификатов не поддерживается"
+
+msgid "Invalid certificate object"
+msgstr "Недопустимый объект сертификата"
+
+msgid "Unknown name"
+msgstr "Неизвестное имя"
+
+msgid "A locale function failed"
+msgstr "Сбой функции локализации"
+
+msgid "Not locked"
+msgstr "Нет блокировки"
+
+msgid "Protocol violation"
+msgstr "Нарушение протокола"
+
+msgid "Invalid MAC"
+msgstr "Недопустимый MAC"
+
+msgid "Invalid request"
+msgstr "Недопустимый запрос"
+
+msgid "Unknown extension"
+msgstr "Неизвестное расширение"
+
+msgid "Unknown critical extension"
+msgstr "Неизвестное критическое расширение"
+
+msgid "Locked"
+msgstr "Заблокировано"
+
+msgid "Unknown option"
+msgstr "Неизвестный параметр"
+
+msgid "Unknown command"
+msgstr "Неизвестная команда"
+
+msgid "Not operational"
+msgstr "Не работоспособно"
+
+msgid "No passphrase given"
+msgstr "Фраза-пароль не задана"
+
+msgid "No PIN given"
+msgstr "PIN не задан"
+
+msgid "Not enabled"
+msgstr "Отключено"
+
+msgid "No crypto engine"
+msgstr "Нет криптомеханизма"
+
+msgid "Missing key"
+msgstr "Не хватает ключа"
+
+msgid "Too many objects"
+msgstr "Слишком много объектов"
+
+msgid "Limit reached"
+msgstr "Достигнут предел"
+
+msgid "Not initialized"
+msgstr "Не инициализировано"
+
+msgid "Missing issuer certificate"
+msgstr "Не хватает сертификата издателя"
+
+msgid "No keyserver available"
+msgstr "Серверы ключей недоступны"
+
+msgid "Invalid elliptic curve"
+msgstr "Недопустимая эллиптическая кривая"
+
+msgid "Unknown elliptic curve"
+msgstr "Неизвестная эллиптическая кривая"
+
+msgid "Duplicated key"
+msgstr "Ключ продублирован"
+
+msgid "Ambiguous result"
+msgstr "Неоднозначный результат"
+
+msgid "No crypto context"
+msgstr "Нет криптоконтекста"
+
+msgid "Wrong crypto context"
+msgstr "Неверный криптоконтекст"
+
+msgid "Bad crypto context"
+msgstr "Плохой криптоконтекст"
+
+msgid "Conflict in the crypto context"
+msgstr "Противоречивый криптоконтекст"
+
+msgid "Broken public key"
+msgstr "Открытый ключ поврежден"
+
+msgid "Broken secret key"
+msgstr "Закрытый ключ поврежден"
+
+msgid "Invalid MAC algorithm"
+msgstr "Недопустимый алгоритм MAC"
+
+msgid "Operation fully cancelled"
+msgstr "Операция полностью отменена"
+
+msgid "Operation not yet finished"
+msgstr "Операция еще не завершена"
+
+msgid "Buffer too short"
+msgstr "Слишком короткий буфер"
+
+msgid "Invalid length specifier in S-expression"
+msgstr "Недопустимый спецификатор длины в S-выражении"
+
+msgid "String too long in S-expression"
+msgstr "Слишком длинная строка в S-выражении"
+
+msgid "Unmatched parentheses in S-expression"
+msgstr "Непарные скобки в S-выражении"
+
+msgid "S-expression not canonical"
+msgstr "S-выражение неканонично"
+
+msgid "Bad character in S-expression"
+msgstr "Плохой символ в S-выражении"
+
+msgid "Bad quotation in S-expression"
+msgstr "Плохие кавычки в S-выражении"
+
+msgid "Zero prefix in S-expression"
+msgstr "Нулевой префикс в S-выражении"
+
+msgid "Nested display hints in S-expression"
+msgstr "Вложенные квадратные скобки в S-выражении"
+
+msgid "Unmatched display hints"
+msgstr "Непарные квадратные скобки"
+
+msgid "Unexpected reserved punctuation in S-expression"
+msgstr "Неожиданная зарезервированная пунктуации в S-выражении"
+
+msgid "Bad hexadecimal character in S-expression"
+msgstr "Плохой шестнадцатеричный символ в S-выражении"
+
+msgid "Odd hexadecimal numbers in S-expression"
+msgstr "Шестнадцатеричные числа нечетной длины в S-выражении"
+
+msgid "Bad octal character in S-expression"
+msgstr "Плохой восьмеричный символ в S-выражении"
+
+msgid "All subkeys are expired or revoked"
+msgstr ""
+
+#, fuzzy
+#| msgid "Data not encrypted"
+msgid "Database is corrupted"
+msgstr "Данные не зашифрованы"
+
+msgid "Server indicated a failure"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "No name"
+msgstr "Неизвестное имя"
+
+#, fuzzy
+#| msgid "No public key"
+msgid "No key"
+msgstr "Нет открытого ключа"
+
+msgid "Legacy key"
+msgstr "Старый ключ"
+
+msgid "Request too short"
+msgstr "Слишком короткий запрос"
+
+msgid "Request too long"
+msgstr "Слишком длинный запрос"
+
+msgid "Object is in termination state"
+msgstr "Объект прекращает работу"
+
+msgid "No certificate chain"
+msgstr "Нет сертификатной цепи"
+
+msgid "Certificate is too large"
+msgstr "Сертификат слишком велик"
+
+msgid "Invalid record"
+msgstr "Недопустимая запись"
+
+msgid "The MAC does not verify"
+msgstr "MAC не проходит проверку"
+
+msgid "Unexpected message"
+msgstr "Неожиданное сообщение"
+
+msgid "Compression or decompression failed"
+msgstr "Сбой сжатия или извлечения"
+
+msgid "A counter would wrap"
+msgstr "Было бы переполнение счетчика"
+
+msgid "Fatal alert message received"
+msgstr "Получено критическое предупреждение"
+
+msgid "No cipher algorithm"
+msgstr "Нет алгоритма симметричного шифрования"
+
+msgid "Missing client certificate"
+msgstr "Не хватает сертификата клиента"
+
+msgid "Close notification received"
+msgstr "Получено уведомление о завершении"
+
+msgid "Ticket expired"
+msgstr "Срок действия квитанции истек"
+
+msgid "Bad ticket"
+msgstr "Плохая квитанция"
+
+msgid "Unknown identity"
+msgstr "Личность неизвестна"
+
+msgid "Bad certificate message in handshake"
+msgstr "Плохое сертификатное сообщение при установлении связи"
+
+msgid "Bad certificate request message in handshake"
+msgstr "Плохое сообщение-запрос сертификата при установлении связи"
+
+msgid "Bad certificate verify message in handshake"
+msgstr "Плохое сообщение-проверка сертификата при установлении связи"
+
+msgid "Bad change cipher message in handshake"
+msgstr "Плохое сообщение смены шифра при установлении связи"
+
+msgid "Bad client hello message in handshake"
+msgstr "Плохое начальное сообщение клиента при установлении связи"
+
+msgid "Bad server hello message in handshake"
+msgstr "Плохое начальное сообщение сервера при установлении связи"
+
+msgid "Bad server hello done message in handshake"
+msgstr "Плохая квитанция сервера на начальное сообщение при установлении связи"
+
+msgid "Bad finished message in handshake"
+msgstr "Плохое завершающее сообщение при установлении связи"
+
+msgid "Bad server key exchange message in handshake"
+msgstr "Плохое сообщение обмена ключами сервера при установлении связи"
+
+msgid "Bad client key exchange message in handshake"
+msgstr "Плохое сообщение обмена ключами клиента при установлении связи"
+
+msgid "Bogus string"
+msgstr "Несуразная строка"
+
+msgid "Forbidden"
+msgstr "Запрещено"
+
+msgid "Key disabled"
+msgstr "Ключ отключен"
+
+msgid "Not possible with a card based key"
+msgstr "Невозможно для ключа на карте"
+
+msgid "Invalid lock object"
+msgstr "Недопустимый объект блокировки"
+
+msgid "True"
+msgstr ""
+
+msgid "False"
+msgstr ""
+
+msgid "General IPC error"
+msgstr "Общая ошибка IPC"
+
+msgid "IPC accept call failed"
+msgstr "Сбой принятия вызова IPC"
+
+msgid "IPC connect call failed"
+msgstr "Сбой вызова соединения IPC"
+
+msgid "Invalid IPC response"
+msgstr "Недопустимый ответ IPC"
+
+msgid "Invalid value passed to IPC"
+msgstr "В IPC передано недопустимое значение"
+
+msgid "Incomplete line passed to IPC"
+msgstr "В IPC передана неполная строка"
+
+msgid "Line passed to IPC too long"
+msgstr "В IPC передана слишком длинная строка"
+
+msgid "Nested IPC commands"
+msgstr "Вложенные команды IPC"
+
+msgid "No data callback in IPC"
+msgstr "В IPC нет функции обработки данных"
+
+msgid "No inquire callback in IPC"
+msgstr "В IPC нет функции обработки запроса"
+
+msgid "Not an IPC server"
+msgstr "Не сервер IPC"
+
+msgid "Not an IPC client"
+msgstr "Не клиент IPC"
+
+msgid "Problem starting IPC server"
+msgstr "Проблема запуска сервера IPC"
+
+msgid "IPC read error"
+msgstr "Ошибка чтения IPC"
+
+msgid "IPC write error"
+msgstr "Ошибка записи IPC"
+
+msgid "Too much data for IPC layer"
+msgstr "Слишком много данных для уровня IPC"
+
+msgid "Unexpected IPC command"
+msgstr "Неожиданная команда IPC"
+
+msgid "Unknown IPC command"
+msgstr "Неизвестная команда IPC"
+
+msgid "IPC syntax error"
+msgstr "Синтаксическая ошибка IPC"
+
+msgid "IPC call has been cancelled"
+msgstr "Вызов IPC отменен"
+
+msgid "No input source for IPC"
+msgstr "Нет источника входа для IPC"
+
+msgid "No output source for IPC"
+msgstr "Нет источника выхода для IPC"
+
+msgid "IPC parameter error"
+msgstr "Ошибка в параметре IPC"
+
+msgid "Unknown IPC inquire"
+msgstr "Неизвестный запрос IPC"
+
+#, fuzzy
+#| msgid "No crypto engine"
+msgid "Crypto engine too old"
+msgstr "Нет криптомеханизма"
+
+msgid "Screen or window too small"
+msgstr ""
+
+msgid "Screen or window too large"
+msgstr ""
+
+msgid "Required environment variable not set"
+msgstr ""
+
+#, fuzzy
+#| msgid "Already exists (LDAP)"
+msgid "User ID already exists"
+msgstr "Уже есть (LDAP)"
+
+#, fuzzy
+#| msgid "Already exists (LDAP)"
+msgid "Name already exists"
+msgstr "Уже есть (LDAP)"
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated name"
+msgstr "Величина продублирована"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Object is too young"
+msgstr "Сертификат слишком новый"
+
+#, fuzzy
+#| msgid "Provided object is too short"
+msgid "Object is too old"
+msgstr "Введенный объект слишком мал"
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Unknown flag"
+msgstr "Неизвестное имя"
+
+#, fuzzy
+#| msgid "Invalid operation code"
+msgid "Invalid execution order"
+msgstr "Недопустимый код операции"
+
+msgid "Already fetched"
+msgstr ""
+
+msgid "Try again later"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Wrong name"
+msgstr "Неизвестное имя"
+
+msgid "System bug detected"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown system error"
+msgid "Unknown DNS error"
+msgstr "Неизвестная системная ошибка"
+
+#, fuzzy
+#| msgid "Invalid OID string"
+msgid "Invalid DNS section"
+msgstr "Недопустимая строка OID"
+
+#, fuzzy
+#| msgid "Invalid S-expression"
+msgid "Invalid textual address form"
+msgstr "Недопустимое S-выражение"
+
+#, fuzzy
+#| msgid "Missing issuer certificate"
+msgid "Missing DNS query packet"
+msgstr "Не хватает сертификата издателя"
+
+msgid "Missing DNS answer packet"
+msgstr ""
+
+msgid "Connection closed in DNS"
+msgstr ""
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "Verification failed in DNS"
+msgstr "Сбой расшифровки"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "DNS Timeout"
+msgstr "Лимит времени"
+
+msgid "General LDAP error"
+msgstr "Общая ошибка LDAP"
+
+msgid "General LDAP attribute error"
+msgstr "Общая ошибка в атрибуте LDAP"
+
+msgid "General LDAP name error"
+msgstr "Общая ошибка в имени LDAP"
+
+msgid "General LDAP security error"
+msgstr "Общая ошибка безопасности LDAP"
+
+msgid "General LDAP service error"
+msgstr "Общая ошибка службы LDAP"
+
+msgid "General LDAP update error"
+msgstr "Общая ошибка обновления LDAP"
+
+msgid "Experimental LDAP error code"
+msgstr "Экспериментальный код ошибки LDAP"
+
+msgid "Private LDAP error code"
+msgstr "Внутренний код ошибки LDAP"
+
+msgid "Other general LDAP error"
+msgstr "Другая общая ошибка LDAP"
+
+msgid "LDAP connecting failed (X)"
+msgstr "Отказ соединения LDAP (X)"
+
+msgid "LDAP referral limit exceeded"
+msgstr "Исчерпан лимит ссылок LDAP"
+
+msgid "LDAP client loop"
+msgstr "Цикл клиента LDAP"
+
+msgid "No LDAP results returned"
+msgstr "Нет результатов LDAP"
+
+msgid "LDAP control not found"
+msgstr "Элемент управления LDAP не найден"
+
+msgid "Not supported by LDAP"
+msgstr "Не поддерживается функцией LDAP"
+
+msgid "LDAP connect error"
+msgstr "Ошибка соединения LDAP"
+
+msgid "Out of memory in LDAP"
+msgstr "Исчерпана память в LDAP"
+
+msgid "Bad parameter to an LDAP routine"
+msgstr "Неверный параметр процедуры LDAP"
+
+msgid "User cancelled LDAP operation"
+msgstr "Пользователь отменил операцию LDAP"
+
+msgid "Bad LDAP search filter"
+msgstr "Плохой фильтр поиска LDAP"
+
+msgid "Unknown LDAP authentication method"
+msgstr "Неизвестный метод аутентификации LDAP"
+
+msgid "Timeout in LDAP"
+msgstr "Лимит времени в LDAP"
+
+msgid "LDAP decoding error"
+msgstr "Ошибка декодирования LDAP"
+
+msgid "LDAP encoding error"
+msgstr "Ошибка кодирования LDAP"
+
+msgid "LDAP local error"
+msgstr "Локальная ошибка LDAP"
+
+msgid "Cannot contact LDAP server"
+msgstr "Не удалось связаться с сервером LDAP"
+
+msgid "LDAP success"
+msgstr "Успешное выполнение LDAP"
+
+msgid "LDAP operations error"
+msgstr "Ошибка операций LDAP"
+
+msgid "LDAP protocol error"
+msgstr "Ошибка протокола LDAP"
+
+msgid "Time limit exceeded in LDAP"
+msgstr "Исчерпан лимит времени в LDAP"
+
+msgid "Size limit exceeded in LDAP"
+msgstr "Исчерпан лимит размера в LDAP"
+
+msgid "LDAP compare false"
+msgstr "Сравнение LDAP: ложь"
+
+msgid "LDAP compare true"
+msgstr "Сравнение LDAP: истина"
+
+msgid "LDAP authentication method not supported"
+msgstr "Метод аутентификации LDAP не поддерживается"
+
+msgid "Strong(er) LDAP authentication required"
+msgstr "Требуется (более) сильная аутентификация LDAP"
+
+msgid "Partial LDAP results+referral received"
+msgstr "Получены частичные результаты LDAP со ссылкой"
+
+msgid "LDAP referral"
+msgstr "Ссылка LDAP"
+
+msgid "Administrative LDAP limit exceeded"
+msgstr "Исчерпан административный лимит LDAP"
+
+msgid "Critical LDAP extension is unavailable"
+msgstr "Недоступно критичное расширение LDAP"
+
+msgid "Confidentiality required by LDAP"
+msgstr "Конфиденциальность, требуемая LDAP"
+
+msgid "LDAP SASL bind in progress"
+msgstr "Выполняется связка SASL LDAP"
+
+msgid "No such LDAP attribute"
+msgstr "Такого атрибута LDAP нет"
+
+msgid "Undefined LDAP attribute type"
+msgstr "Неопределенный тип атрибута LDAP"
+
+msgid "Inappropriate matching in LDAP"
+msgstr "Неподходящее соответствие в LDAP"
+
+msgid "Constraint violation in LDAP"
+msgstr "Нарушение ограничений в LDAP"
+
+msgid "LDAP type or value exists"
+msgstr "Тип или значение LDAP существует"
+
+msgid "Invalid syntax in LDAP"
+msgstr "Ошибка синтаксиса в LDAP"
+
+msgid "No such LDAP object"
+msgstr "Такого объекта LDAP нет"
+
+msgid "LDAP alias problem"
+msgstr "Проблема синонима LDAP"
+
+msgid "Invalid DN syntax in LDAP"
+msgstr "Ошибка синтаксиса DN в LDAP"
+
+msgid "LDAP entry is a leaf"
+msgstr "Элемент LDAP - лист"
+
+msgid "LDAP alias dereferencing problem"
+msgstr "Проблема разыменования синонима LDAP"
+
+msgid "LDAP proxy authorization failure (X)"
+msgstr "Отказ авторизации промежуточного сервера (X)"
+
+msgid "Inappropriate LDAP authentication"
+msgstr "Неподходящая аутентификация LDAP"
+
+msgid "Invalid LDAP credentials"
+msgstr "Неверная верительная грамота LDAP"
+
+msgid "Insufficient access for LDAP"
+msgstr "Недостаточный доступ для LDAP"
+
+msgid "LDAP server is busy"
+msgstr "Сервер LDAP занят"
+
+msgid "LDAP server is unavailable"
+msgstr "Сервер LDAP недоступен"
+
+msgid "LDAP server is unwilling to perform"
+msgstr "Сервер LDAP отказывается работать"
+
+msgid "Loop detected by LDAP"
+msgstr "Функцией LDAP обнаружен цикл"
+
+msgid "LDAP naming violation"
+msgstr "Нарушение в именах LDAP"
+
+msgid "LDAP object class violation"
+msgstr "Нарушение в классе объекта LDAP"
+
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "Операция LDAP допустима только для листов"
+
+msgid "LDAP operation not allowed on RDN"
+msgstr "Операция LDAP над RDN не разрешена"
+
+msgid "Already exists (LDAP)"
+msgstr "Уже есть (LDAP)"
+
+msgid "Cannot modify LDAP object class"
+msgstr "Невозможно изменить класс объекта LDAP"
+
+msgid "LDAP results too large"
+msgstr "Слишком большой объем результатов LDAP"
+
+msgid "LDAP operation affects multiple DSAs"
+msgstr "Операция LDAP влияет на многие DSA"
+
+msgid "Virtual LDAP list view error"
+msgstr "Ошибка просмотра виртуального списка LDAP"
+
+msgid "Other LDAP error"
+msgstr "Другая ошибка LDAP"
+
+msgid "Resources exhausted in LCUP"
+msgstr "Нехватка ресурсов в LCUP"
+
+msgid "Security violation in LCUP"
+msgstr "Нарушение безопасности в LCUP"
+
+msgid "Invalid data in LCUP"
+msgstr "Недопустимые данные в LCUP"
+
+msgid "Unsupported scheme in LCUP"
+msgstr "Схема не поддерживается в LCUP"
+
+msgid "Reload required in LCUP"
+msgstr "Требуется перезапуск в LCUP"
+
+msgid "LDAP cancelled"
+msgstr "Отбой LDAP"
+
+msgid "No LDAP operation to cancel"
+msgstr "Нет операции LDAP, которую можно было бы отменить"
+
+msgid "Too late to cancel LDAP"
+msgstr "Отменять LDAP слишком поздно"
+
+msgid "Cannot cancel LDAP"
+msgstr "Не удается отменить LDAP"
+
+msgid "LDAP assertion failed"
+msgstr "Отказ в установке LDAP"
+
+msgid "Proxied authorization denied by LDAP"
+msgstr "LDAP отказал в опосредованной авторизации"
+
+msgid "User defined error code 1"
+msgstr "Пользовательский код ошибки 1"
+
+msgid "User defined error code 2"
+msgstr "Пользовательский код ошибки 2"
+
+msgid "User defined error code 3"
+msgstr "Пользовательский код ошибки 3"
+
+msgid "User defined error code 4"
+msgstr "Пользовательский код ошибки 4"
+
+msgid "User defined error code 5"
+msgstr "Пользовательский код ошибки 5"
+
+msgid "User defined error code 6"
+msgstr "Пользовательский код ошибки 6"
+
+msgid "User defined error code 7"
+msgstr "Пользовательский код ошибки 7"
+
+msgid "User defined error code 8"
+msgstr "Пользовательский код ошибки 8"
+
+msgid "User defined error code 9"
+msgstr "Пользовательский код ошибки 9"
+
+msgid "User defined error code 10"
+msgstr "Пользовательский код ошибки 10"
+
+msgid "User defined error code 11"
+msgstr "Пользовательский код ошибки 11"
+
+msgid "User defined error code 12"
+msgstr "Пользовательский код ошибки 12"
+
+msgid "User defined error code 13"
+msgstr "Пользовательский код ошибки 13"
+
+msgid "User defined error code 14"
+msgstr "Пользовательский код ошибки 14"
+
+msgid "User defined error code 15"
+msgstr "Пользовательский код ошибки 15"
+
+msgid "User defined error code 16"
+msgstr "Пользовательский код ошибки 16"
+
+msgid "System error w/o errno"
+msgstr "Системная ошибка без номера"
+
+msgid "Unknown system error"
+msgstr "Неизвестная системная ошибка"
+
+msgid "End of file"
+msgstr "Конец файла"
+
+msgid "Unknown error code"
+msgstr "Неизвестный код ошибки"
+
+#, c-format
+msgid "Usage: %s GPG-ERROR [...]\n"
+msgstr "Вызов: %s GPG-ERROR [...]\n"
+
+#, c-format
+msgid "%s: warning: could not recognize %s\n"
+msgstr "%s: внимание: не распознано %s\n"
diff --git a/po/sr.po b/po/sr.po
new file mode 100644
index 0000000..4ddcf72
--- /dev/null
+++ b/po/sr.po
@@ -0,0 +1,1526 @@
+# Serbian translation for libgpg-error.
+# Copyright (C) 2014 Free Software Foundation, Inc.
+# This file is distributed under the same license as the libgpg-error package.
+# Мирослав Николић <[email protected]>, 2014.
+msgid ""
+msgstr ""
+"Project-Id-Version: libgpg-error-1.7\n"
+"Report-Msgid-Bugs-To: [email protected]\n"
+"PO-Revision-Date: 2014-11-03 11:42+0200\n"
+"Last-Translator: Мирослав Николић <[email protected]>\n"
+"Language-Team: Serbian <(nothing)>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+
+msgid "Unspecified source"
+msgstr "Ненаведени извор"
+
+msgid "gcrypt"
+msgstr "гкрипт"
+
+msgid "GnuPG"
+msgstr "ГнуПГ"
+
+msgid "GpgSM"
+msgstr "ГпгСМ"
+
+msgid "GPG Agent"
+msgstr "ГПГ агент"
+
+msgid "Pinentry"
+msgstr "Унос пина"
+
+msgid "SCD"
+msgstr "СЦД"
+
+msgid "GPGME"
+msgstr "ГПГМЕ"
+
+msgid "Keybox"
+msgstr "Поље кључа"
+
+msgid "KSBA"
+msgstr "КСБА"
+
+msgid "Dirmngr"
+msgstr "Управник директоријума"
+
+msgid "GSTI"
+msgstr "ГСТИ"
+
+msgid "GPA"
+msgstr "ГПА"
+
+msgid "Kleopatra"
+msgstr "Клеопатра"
+
+msgid "G13"
+msgstr ""
+
+msgid "Assuan"
+msgstr ""
+
+msgid "TLS"
+msgstr ""
+
+msgid "Any source"
+msgstr "Било који извор"
+
+msgid "User defined source 1"
+msgstr "1. корисников извор"
+
+msgid "User defined source 2"
+msgstr "2. корисников извор"
+
+msgid "User defined source 3"
+msgstr "3. корисников извор"
+
+msgid "User defined source 4"
+msgstr "4. корисников извор"
+
+msgid "Unknown source"
+msgstr "Непознат извор"
+
+msgid "Success"
+msgstr "Успешно"
+
+msgid "General error"
+msgstr "Општа грешка"
+
+msgid "Unknown packet"
+msgstr "Непознат пакет"
+
+msgid "Unknown version in packet"
+msgstr "Непознато издање у пакету"
+
+msgid "Invalid public key algorithm"
+msgstr "Неисправан алгоритам јавног кључа"
+
+msgid "Invalid digest algorithm"
+msgstr "Непознат алгоритам апсорпције"
+
+msgid "Bad public key"
+msgstr "Лош јавни кључ"
+
+msgid "Bad secret key"
+msgstr "Лош тајни кључ"
+
+msgid "Bad signature"
+msgstr "Лош потпис"
+
+msgid "No public key"
+msgstr "Нема јавног кључа"
+
+msgid "Checksum error"
+msgstr "Грешка провере суме"
+
+msgid "Bad passphrase"
+msgstr "Лоша пропусна реч"
+
+msgid "Invalid cipher algorithm"
+msgstr "Неисправан алгоритам шифровања"
+
+msgid "Cannot open keyring"
+msgstr "Привезак кључева је отворен"
+
+msgid "Invalid packet"
+msgstr "Неисправан пакет"
+
+msgid "Invalid armor"
+msgstr "Неисправан штит"
+
+msgid "No user ID"
+msgstr "Нема ИБ-а корисника"
+
+msgid "No secret key"
+msgstr "Нема тајног кључа"
+
+msgid "Wrong secret key used"
+msgstr "Коришћен је погрешан тајни кључ"
+
+msgid "Bad session key"
+msgstr "Лош кључ сесије"
+
+msgid "Unknown compression algorithm"
+msgstr "Непознат алгоритам сажимања"
+
+msgid "Number is not prime"
+msgstr "Број није прост"
+
+msgid "Invalid encoding method"
+msgstr "Неисправан начин кодирања"
+
+msgid "Invalid encryption scheme"
+msgstr "Неисправна шема шифровања"
+
+msgid "Invalid signature scheme"
+msgstr "Неисправна шема потписа"
+
+msgid "Invalid attribute"
+msgstr "Неисправна особина"
+
+msgid "No value"
+msgstr "Нема вредности"
+
+msgid "Not found"
+msgstr "Нисам пронашао"
+
+msgid "Value not found"
+msgstr "Нисам пронашао вредност"
+
+msgid "Syntax error"
+msgstr "Садржајна грешка"
+
+msgid "Bad MPI value"
+msgstr "Лоша МПИ вредност"
+
+msgid "Invalid passphrase"
+msgstr "Неисправна пропусна реч"
+
+msgid "Invalid signature class"
+msgstr "Неисправан разред потписа"
+
+msgid "Resources exhausted"
+msgstr "Изворишта су истрошена"
+
+msgid "Invalid keyring"
+msgstr "Неисправан прстен кључа"
+
+msgid "Trust DB error"
+msgstr "Грешка поверења БП-а"
+
+msgid "Bad certificate"
+msgstr "Лош уверење"
+
+msgid "Invalid user ID"
+msgstr "Неисправан ИБ-а корисника"
+
+msgid "Unexpected error"
+msgstr "Неочекивана грешка"
+
+msgid "Time conflict"
+msgstr "Сукоб времена"
+
+msgid "Keyserver error"
+msgstr "Грешка сервера кључа"
+
+msgid "Wrong public key algorithm"
+msgstr "Погрешан алгоритам јавног кључа"
+
+msgid "Tribute to D. A."
+msgstr "У част Д. А."
+
+msgid "Weak encryption key"
+msgstr "Слаб кључ шифровања"
+
+msgid "Invalid key length"
+msgstr "Неисправна дужина кључа"
+
+msgid "Invalid argument"
+msgstr "Неисправан аргумент"
+
+msgid "Syntax error in URI"
+msgstr "Грешка израза у путањи"
+
+msgid "Invalid URI"
+msgstr "Неисправна путања"
+
+msgid "Network error"
+msgstr "Грешка мреже"
+
+msgid "Unknown host"
+msgstr "Непознат домаћин"
+
+msgid "Selftest failed"
+msgstr "Самопроба није успела"
+
+msgid "Data not encrypted"
+msgstr "Подаци нису шифровани"
+
+msgid "Data not processed"
+msgstr "Подаци нису обрађени"
+
+msgid "Unusable public key"
+msgstr "Неупотребљив јавни кључ"
+
+msgid "Unusable secret key"
+msgstr "Неупотребљив тајни кључ"
+
+msgid "Invalid value"
+msgstr "Неисправна вредност"
+
+msgid "Bad certificate chain"
+msgstr "Лош ланац уверења"
+
+msgid "Missing certificate"
+msgstr "Недостаје уверење"
+
+msgid "No data"
+msgstr "Нема података"
+
+msgid "Bug"
+msgstr "Грешка"
+
+msgid "Not supported"
+msgstr "Није подржано"
+
+msgid "Invalid operation code"
+msgstr "Неисправна шифра радње"
+
+msgid "Timeout"
+msgstr "Време је истекло"
+
+msgid "Internal error"
+msgstr "Унутрашња грешка"
+
+msgid "EOF (gcrypt)"
+msgstr "КРД (gcrypt)"
+
+msgid "Invalid object"
+msgstr "Неисправан предмет"
+
+msgid "Provided object is too short"
+msgstr "Достављени предмет је прекратак"
+
+msgid "Provided object is too large"
+msgstr "Достављени предмет је предуг"
+
+msgid "Missing item in object"
+msgstr "Недостаје ставка у предмету"
+
+msgid "Not implemented"
+msgstr "Није примењено"
+
+msgid "Conflicting use"
+msgstr "Противна употреба"
+
+msgid "Invalid cipher mode"
+msgstr "Неисправан код шифрера"
+
+msgid "Invalid flag"
+msgstr "Неисправна опција"
+
+msgid "Invalid handle"
+msgstr "Неисправна ручка"
+
+msgid "Result truncated"
+msgstr "Резултат је скраћен"
+
+msgid "Incomplete line"
+msgstr "Непотпун ред"
+
+msgid "Invalid response"
+msgstr "Неисправан одговор"
+
+msgid "No agent running"
+msgstr "Нема покренутог агента"
+
+#, fuzzy
+#| msgid "agent error"
+msgid "Agent error"
+msgstr "грешка агента"
+
+msgid "Invalid data"
+msgstr "Неисправни подаци"
+
+msgid "Unspecific Assuan server fault"
+msgstr "Необичан неуспех Асуан сервера"
+
+msgid "General Assuan error"
+msgstr "Општа грешка Асуана"
+
+msgid "Invalid session key"
+msgstr "Неисправан кључ сесије"
+
+msgid "Invalid S-expression"
+msgstr "Неисправан С-израз"
+
+msgid "Unsupported algorithm"
+msgstr "Неподржани алгоритам"
+
+msgid "No pinentry"
+msgstr "Нема уноса пина"
+
+msgid "pinentry error"
+msgstr "грешка уноса пина"
+
+msgid "Bad PIN"
+msgstr "Лош ПИН"
+
+msgid "Invalid name"
+msgstr "Неисправан назив"
+
+msgid "Bad data"
+msgstr "Лоши подаци"
+
+msgid "Invalid parameter"
+msgstr "Неисправан параметар"
+
+msgid "Wrong card"
+msgstr "Лоша картица"
+
+msgid "No dirmngr"
+msgstr "Нема управника директоријумом"
+
+msgid "dirmngr error"
+msgstr "грешка управника директоријумом"
+
+msgid "Certificate revoked"
+msgstr "Уверење је опозвано"
+
+msgid "No CRL known"
+msgstr "Нема познатог ЦРЛ-а"
+
+msgid "CRL too old"
+msgstr "ЦРЛ је престар"
+
+msgid "Line too long"
+msgstr "Ред је предуг"
+
+msgid "Not trusted"
+msgstr "Није од поверења"
+
+msgid "Operation cancelled"
+msgstr "Радња је отказана"
+
+msgid "Bad CA certificate"
+msgstr "Лоше уверење издавача"
+
+msgid "Certificate expired"
+msgstr "Уверење је истекло"
+
+msgid "Certificate too young"
+msgstr "Уверење је превише ново"
+
+msgid "Unsupported certificate"
+msgstr "Неподржано уверење"
+
+msgid "Unknown S-expression"
+msgstr "Непознат С-израз"
+
+msgid "Unsupported protection"
+msgstr "Неподржана заштита"
+
+msgid "Corrupted protection"
+msgstr "Оштећена заштита"
+
+msgid "Ambiguous name"
+msgstr "Нејасан назив"
+
+msgid "Card error"
+msgstr "Грешка картице"
+
+msgid "Card reset required"
+msgstr "Потребно је поновно постављање картице"
+
+msgid "Card removed"
+msgstr "Картица је уклоњена"
+
+msgid "Invalid card"
+msgstr "Неисправна картица"
+
+msgid "Card not present"
+msgstr "Картица није присутна"
+
+msgid "No PKCS15 application"
+msgstr "Нема ПКЦС15 програма"
+
+msgid "Not confirmed"
+msgstr "Није потврђено"
+
+msgid "Configuration error"
+msgstr "Грешка подешавања"
+
+msgid "No policy match"
+msgstr "Нема одговарајуће политике"
+
+msgid "Invalid index"
+msgstr "Неисправан индекс"
+
+msgid "Invalid ID"
+msgstr "Неисправан ИБ"
+
+msgid "No SmartCard daemon"
+msgstr "Нема позадинца паметне картице"
+
+msgid "SmartCard daemon error"
+msgstr "Грешка позадинца паметне картице"
+
+msgid "Unsupported protocol"
+msgstr "Неподржан протокол"
+
+msgid "Bad PIN method"
+msgstr "Лош начин ПИН-а"
+
+msgid "Card not initialized"
+msgstr "Картица није покренута"
+
+msgid "Unsupported operation"
+msgstr "Неподржана радња"
+
+msgid "Wrong key usage"
+msgstr "Погрешна употреба кључа"
+
+msgid "Nothing found"
+msgstr "Нисам нашао ништа"
+
+msgid "Wrong blob type"
+msgstr "Погрешна врста бвоб-а"
+
+msgid "Missing value"
+msgstr "Недостаје вредност"
+
+msgid "Hardware problem"
+msgstr "Хардверски проблем"
+
+msgid "PIN blocked"
+msgstr "ПИН је блокиран"
+
+msgid "Conditions of use not satisfied"
+msgstr "Услови коришћења нису задовољени"
+
+msgid "PINs are not synced"
+msgstr "ПИН-ови нису усаглашени"
+
+msgid "Invalid CRL"
+msgstr "Неисправан ЦРЛ"
+
+msgid "BER error"
+msgstr "Грешка БЕР-а"
+
+msgid "Invalid BER"
+msgstr "Неисправан БЕР"
+
+msgid "Element not found"
+msgstr "Нисам пронашао елемент"
+
+msgid "Identifier not found"
+msgstr "Нисам пронашао одредника"
+
+msgid "Invalid tag"
+msgstr "Неисправна ознака"
+
+msgid "Invalid length"
+msgstr "Неисправна дужина"
+
+msgid "Invalid key info"
+msgstr "Неисправни подаци кључа"
+
+msgid "Unexpected tag"
+msgstr "Неочекивана ознака"
+
+msgid "Not DER encoded"
+msgstr "Није кодирано ДЕР-ом"
+
+msgid "No CMS object"
+msgstr "Није ЦМС предмет"
+
+msgid "Invalid CMS object"
+msgstr "Неисправан ЦМС предмет"
+
+msgid "Unknown CMS object"
+msgstr "Непознат ЦМС предмет"
+
+msgid "Unsupported CMS object"
+msgstr "Неподржан ЦМС предмет"
+
+msgid "Unsupported encoding"
+msgstr "Неподржано кодирање"
+
+msgid "Unsupported CMS version"
+msgstr "Неподржано ЦМС издање"
+
+msgid "Unknown algorithm"
+msgstr "Непознат алгоритам"
+
+msgid "Invalid crypto engine"
+msgstr "Неисправан погон шифровања"
+
+msgid "Public key not trusted"
+msgstr "Јавни кључ није поверљив"
+
+msgid "Decryption failed"
+msgstr "Дешифровање није успело"
+
+msgid "Key expired"
+msgstr "Кључ је истекао"
+
+msgid "Signature expired"
+msgstr "Потпис је истекао"
+
+msgid "Encoding problem"
+msgstr "Проблем кодирања"
+
+msgid "Invalid state"
+msgstr "Неисправно стање"
+
+msgid "Duplicated value"
+msgstr "Удвостручена вредност"
+
+msgid "Missing action"
+msgstr "Недостаје радња"
+
+msgid "ASN.1 module not found"
+msgstr "Нисам пронашао модул АСН.1"
+
+msgid "Invalid OID string"
+msgstr "Неисправна ОИД ниска"
+
+msgid "Invalid time"
+msgstr "Неисправно време"
+
+msgid "Invalid CRL object"
+msgstr "Неисправан ЦРЛ предмет"
+
+msgid "Unsupported CRL version"
+msgstr "Неподржано ЦРЛ издање"
+
+msgid "Invalid certificate object"
+msgstr "Неисправан предмет уверења"
+
+msgid "Unknown name"
+msgstr "Непознат назив"
+
+msgid "A locale function failed"
+msgstr "Језичка функција није успела"
+
+msgid "Not locked"
+msgstr "Није закључано"
+
+msgid "Protocol violation"
+msgstr "Кршење протокола"
+
+msgid "Invalid MAC"
+msgstr "Неисправан МАК"
+
+msgid "Invalid request"
+msgstr "Неисправан захтев"
+
+msgid "Unknown extension"
+msgstr "Непознато проширење"
+
+msgid "Unknown critical extension"
+msgstr "Непознат критичан израз"
+
+msgid "Locked"
+msgstr "Закључано"
+
+msgid "Unknown option"
+msgstr "Непозната опција"
+
+msgid "Unknown command"
+msgstr "Непозната наредба"
+
+msgid "Not operational"
+msgstr "Није делотворно"
+
+msgid "No passphrase given"
+msgstr "Није дата пропусна реч"
+
+msgid "No PIN given"
+msgstr "Није дат ПИН"
+
+#, fuzzy
+#| msgid "Not locked"
+msgid "Not enabled"
+msgstr "Није закључано"
+
+#, fuzzy
+#| msgid "Invalid crypto engine"
+msgid "No crypto engine"
+msgstr "Неисправан погон шифровања"
+
+#, fuzzy
+#| msgid "Missing value"
+msgid "Missing key"
+msgstr "Недостаје вредност"
+
+#, fuzzy
+#| msgid "No CMS object"
+msgid "Too many objects"
+msgstr "Није ЦМС предмет"
+
+msgid "Limit reached"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card not initialized"
+msgid "Not initialized"
+msgstr "Картица није покренута"
+
+#, fuzzy
+#| msgid "Missing certificate"
+msgid "Missing issuer certificate"
+msgstr "Недостаје уверење"
+
+msgid "No keyserver available"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid time"
+msgid "Invalid elliptic curve"
+msgstr "Неисправно време"
+
+#, fuzzy
+#| msgid "Unknown source"
+msgid "Unknown elliptic curve"
+msgstr "Непознат извор"
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated key"
+msgstr "Удвостручена вредност"
+
+#, fuzzy
+#| msgid "Ambiguous name"
+msgid "Ambiguous result"
+msgstr "Нејасан назив"
+
+msgid "No crypto context"
+msgstr ""
+
+msgid "Wrong crypto context"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid crypto engine"
+msgid "Bad crypto context"
+msgstr "Неисправан погон шифровања"
+
+msgid "Conflict in the crypto context"
+msgstr ""
+
+#, fuzzy
+#| msgid "No public key"
+msgid "Broken public key"
+msgstr "Нема јавног кључа"
+
+#, fuzzy
+#| msgid "No secret key"
+msgid "Broken secret key"
+msgstr "Нема тајног кључа"
+
+#, fuzzy
+#| msgid "Invalid digest algorithm"
+msgid "Invalid MAC algorithm"
+msgstr "Непознат алгоритам апсорпције"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "Operation fully cancelled"
+msgstr "Радња је отказана"
+
+msgid "Operation not yet finished"
+msgstr "Радња није још завршена"
+
+msgid "Buffer too short"
+msgstr "Међумеморија је прекратка"
+
+msgid "Invalid length specifier in S-expression"
+msgstr "Неисправан одредник дужине у С-изразу"
+
+msgid "String too long in S-expression"
+msgstr "Ниска је предуга у С-изразу"
+
+msgid "Unmatched parentheses in S-expression"
+msgstr "Неодговарајуће заграде у С-изразу"
+
+msgid "S-expression not canonical"
+msgstr "С-израз није правилан"
+
+msgid "Bad character in S-expression"
+msgstr "Лош знак у С-изразу"
+
+msgid "Bad quotation in S-expression"
+msgstr "Лоше цитирање у С-изразу"
+
+msgid "Zero prefix in S-expression"
+msgstr "Нулти префикс у С-изразу"
+
+msgid "Nested display hints in S-expression"
+msgstr "Уграђени савети приказа у С-изразу"
+
+msgid "Unmatched display hints"
+msgstr "Неодговарајући савети приказа"
+
+msgid "Unexpected reserved punctuation in S-expression"
+msgstr "Неочекивана резервисана тачка у С-изразу"
+
+msgid "Bad hexadecimal character in S-expression"
+msgstr "Лош хексадецимални знак у С-изразу"
+
+msgid "Odd hexadecimal numbers in S-expression"
+msgstr "Непарни хексадецимални бројеви у С-изразу"
+
+#, fuzzy
+#| msgid "Bad octadecimal character in S-expression"
+msgid "Bad octal character in S-expression"
+msgstr "Лош октадецимални знак у С-изразу"
+
+msgid "All subkeys are expired or revoked"
+msgstr ""
+
+#, fuzzy
+#| msgid "Data not encrypted"
+msgid "Database is corrupted"
+msgstr "Подаци нису шифровани"
+
+msgid "Server indicated a failure"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "No name"
+msgstr "Непознат назив"
+
+#, fuzzy
+#| msgid "No public key"
+msgid "No key"
+msgstr "Нема јавног кључа"
+
+msgid "Legacy key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Buffer too short"
+msgid "Request too short"
+msgstr "Међумеморија је прекратка"
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "Request too long"
+msgstr "Ред је предуг"
+
+msgid "Object is in termination state"
+msgstr ""
+
+#, fuzzy
+#| msgid "Bad certificate chain"
+msgid "No certificate chain"
+msgstr "Лош ланац уверења"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Certificate is too large"
+msgstr "Уверење је превише ново"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid record"
+msgstr "Неисправна картица"
+
+msgid "The MAC does not verify"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unexpected tag"
+msgid "Unexpected message"
+msgstr "Неочекивана ознака"
+
+msgid "Compression or decompression failed"
+msgstr ""
+
+msgid "A counter would wrap"
+msgstr ""
+
+msgid "Fatal alert message received"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid cipher algorithm"
+msgid "No cipher algorithm"
+msgstr "Неисправан алгоритам шифровања"
+
+#, fuzzy
+#| msgid "Missing certificate"
+msgid "Missing client certificate"
+msgstr "Недостаје уверење"
+
+#, fuzzy
+#| msgid "Certificate revoked"
+msgid "Close notification received"
+msgstr "Уверење је опозвано"
+
+#, fuzzy
+#| msgid "Key expired"
+msgid "Ticket expired"
+msgstr "Кључ је истекао"
+
+#, fuzzy
+#| msgid "Bad public key"
+msgid "Bad ticket"
+msgstr "Лош јавни кључ"
+
+#, fuzzy
+#| msgid "Unknown packet"
+msgid "Unknown identity"
+msgstr "Непознат пакет"
+
+#, fuzzy
+#| msgid "Bad certificate chain"
+msgid "Bad certificate message in handshake"
+msgstr "Лош ланац уверења"
+
+msgid "Bad certificate request message in handshake"
+msgstr ""
+
+msgid "Bad certificate verify message in handshake"
+msgstr ""
+
+msgid "Bad change cipher message in handshake"
+msgstr ""
+
+msgid "Bad client hello message in handshake"
+msgstr ""
+
+msgid "Bad server hello message in handshake"
+msgstr ""
+
+msgid "Bad server hello done message in handshake"
+msgstr ""
+
+msgid "Bad finished message in handshake"
+msgstr ""
+
+msgid "Bad server key exchange message in handshake"
+msgstr ""
+
+msgid "Bad client key exchange message in handshake"
+msgstr ""
+
+msgid "Bogus string"
+msgstr ""
+
+msgid "Forbidden"
+msgstr ""
+
+#, fuzzy
+#| msgid "Key expired"
+msgid "Key disabled"
+msgstr "Кључ је истекао"
+
+msgid "Not possible with a card based key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid object"
+msgid "Invalid lock object"
+msgstr "Неисправан предмет"
+
+msgid "True"
+msgstr ""
+
+msgid "False"
+msgstr ""
+
+msgid "General IPC error"
+msgstr "Општа грешка ИПЦ-а"
+
+msgid "IPC accept call failed"
+msgstr "Прихватање позива ИПЦ-а није успело"
+
+msgid "IPC connect call failed"
+msgstr "Повезивање позива ИПЦ-а није успело"
+
+msgid "Invalid IPC response"
+msgstr "Неисправан ИПЦ одговор"
+
+msgid "Invalid value passed to IPC"
+msgstr "Неисправна вредност прослеђена ИПЦ-у"
+
+msgid "Incomplete line passed to IPC"
+msgstr "Непотпун ред је прослеђен ИПЦ-у"
+
+msgid "Line passed to IPC too long"
+msgstr "Ред прослеђен ИПЦ-у је предуг"
+
+msgid "Nested IPC commands"
+msgstr "Уграђене ИПЦ наредбе"
+
+msgid "No data callback in IPC"
+msgstr "Нема опозива података у ИПЦ-у"
+
+msgid "No inquire callback in IPC"
+msgstr "Нема опозива распитивања у ИПЦ-у"
+
+msgid "Not an IPC server"
+msgstr "Није ИПЦ сервер"
+
+msgid "Not an IPC client"
+msgstr "Није ИПЦ клијент"
+
+msgid "Problem starting IPC server"
+msgstr "Проблем покретања ИПЦ сервера"
+
+msgid "IPC read error"
+msgstr "Грешка читања ИПЦ-а"
+
+msgid "IPC write error"
+msgstr "Грешка писања ИПЦ-а"
+
+msgid "Too much data for IPC layer"
+msgstr "Превише података за ИПЦ слој"
+
+msgid "Unexpected IPC command"
+msgstr "Неочекивана ИПЦ наредба"
+
+msgid "Unknown IPC command"
+msgstr "Непозната ИПЦ наредба"
+
+msgid "IPC syntax error"
+msgstr "Садржајна грешка ИПЦ-а"
+
+msgid "IPC call has been cancelled"
+msgstr "ИПЦ позив је отказан"
+
+msgid "No input source for IPC"
+msgstr "Нема извора улаза за ИПЦ"
+
+msgid "No output source for IPC"
+msgstr "Нема извора излаза за ИПЦ"
+
+msgid "IPC parameter error"
+msgstr "Грешка параметра ИПЦ-а"
+
+msgid "Unknown IPC inquire"
+msgstr "Непознато распитивање ИПЦ-а"
+
+#, fuzzy
+#| msgid "Invalid crypto engine"
+msgid "Crypto engine too old"
+msgstr "Неисправан погон шифровања"
+
+msgid "Screen or window too small"
+msgstr ""
+
+msgid "Screen or window too large"
+msgstr ""
+
+msgid "Required environment variable not set"
+msgstr ""
+
+msgid "User ID already exists"
+msgstr ""
+
+msgid "Name already exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated name"
+msgstr "Удвостручена вредност"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Object is too young"
+msgstr "Уверење је превише ново"
+
+#, fuzzy
+#| msgid "Provided object is too short"
+msgid "Object is too old"
+msgstr "Достављени предмет је прекратак"
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Unknown flag"
+msgstr "Непознат назив"
+
+#, fuzzy
+#| msgid "Invalid operation code"
+msgid "Invalid execution order"
+msgstr "Неисправна шифра радње"
+
+msgid "Already fetched"
+msgstr ""
+
+msgid "Try again later"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Wrong name"
+msgstr "Непознат назив"
+
+msgid "System bug detected"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown system error"
+msgid "Unknown DNS error"
+msgstr "Непозната грешка система"
+
+#, fuzzy
+#| msgid "Invalid OID string"
+msgid "Invalid DNS section"
+msgstr "Неисправна ОИД ниска"
+
+#, fuzzy
+#| msgid "Invalid S-expression"
+msgid "Invalid textual address form"
+msgstr "Неисправан С-израз"
+
+#, fuzzy
+#| msgid "Missing certificate"
+msgid "Missing DNS query packet"
+msgstr "Недостаје уверење"
+
+msgid "Missing DNS answer packet"
+msgstr ""
+
+msgid "Connection closed in DNS"
+msgstr ""
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "Verification failed in DNS"
+msgstr "Дешифровање није успело"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "DNS Timeout"
+msgstr "Време је истекло"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "General LDAP error"
+msgstr "Општа грешка ИПЦ-а"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP attribute error"
+msgstr "Општа грешка"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP name error"
+msgstr "Општа грешка"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP security error"
+msgstr "Општа грешка Асуана"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP service error"
+msgstr "Општа грешка"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP update error"
+msgstr "Општа грешка Асуана"
+
+msgid "Experimental LDAP error code"
+msgstr ""
+
+#, fuzzy
+#| msgid "IPC write error"
+msgid "Private LDAP error code"
+msgstr "Грешка писања ИПЦ-а"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other general LDAP error"
+msgstr "Општа грешка ИПЦ-а"
+
+#, fuzzy
+#| msgid "IPC connect call failed"
+msgid "LDAP connecting failed (X)"
+msgstr "Повезивање позива ИПЦ-а није успело"
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral limit exceeded"
+msgstr "Општа грешка"
+
+msgid "LDAP client loop"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "No LDAP results returned"
+msgstr "Потребно је поновно постављање картице"
+
+#, fuzzy
+#| msgid "Element not found"
+msgid "LDAP control not found"
+msgstr "Нисам пронашао елемент"
+
+#, fuzzy
+#| msgid "Not supported"
+msgid "Not supported by LDAP"
+msgstr "Није подржано"
+
+#, fuzzy
+#| msgid "Unexpected error"
+msgid "LDAP connect error"
+msgstr "Неочекивана грешка"
+
+msgid "Out of memory in LDAP"
+msgstr ""
+
+msgid "Bad parameter to an LDAP routine"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported operation"
+msgid "User cancelled LDAP operation"
+msgstr "Неподржана радња"
+
+#, fuzzy
+#| msgid "Bad certificate"
+msgid "Bad LDAP search filter"
+msgstr "Лош уверење"
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "Unknown LDAP authentication method"
+msgstr "Непознато проширење"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "Timeout in LDAP"
+msgstr "Време је истекло"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP decoding error"
+msgstr "грешка управника директоријумом"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP encoding error"
+msgstr "грешка управника директоријумом"
+
+#, fuzzy
+#| msgid "IPC read error"
+msgid "LDAP local error"
+msgstr "Грешка читања ИПЦ-а"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot contact LDAP server"
+msgstr "Није ИПЦ сервер"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP success"
+msgstr "Успешно"
+
+#, fuzzy
+#| msgid "Configuration error"
+msgid "LDAP operations error"
+msgstr "Грешка подешавања"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP protocol error"
+msgstr "Кршење протокола"
+
+msgid "Time limit exceeded in LDAP"
+msgstr ""
+
+msgid "Size limit exceeded in LDAP"
+msgstr ""
+
+msgid "LDAP compare false"
+msgstr ""
+
+msgid "LDAP compare true"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "LDAP authentication method not supported"
+msgstr "Непознато проширење"
+
+msgid "Strong(er) LDAP authentication required"
+msgstr ""
+
+msgid "Partial LDAP results+referral received"
+msgstr ""
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral"
+msgstr "Општа грешка"
+
+msgid "Administrative LDAP limit exceeded"
+msgstr ""
+
+msgid "Critical LDAP extension is unavailable"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Confidentiality required by LDAP"
+msgstr "Потребно је поновно постављање картице"
+
+msgid "LDAP SASL bind in progress"
+msgstr ""
+
+msgid "No such LDAP attribute"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid attribute"
+msgid "Undefined LDAP attribute type"
+msgstr "Неисправна особина"
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate matching in LDAP"
+msgstr "Неподржана заштита"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Constraint violation in LDAP"
+msgstr "Кршење протокола"
+
+msgid "LDAP type or value exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid syntax in LDAP"
+msgstr "Неисправно стање"
+
+#, fuzzy
+#| msgid "No CMS object"
+msgid "No such LDAP object"
+msgstr "Није ЦМС предмет"
+
+#, fuzzy
+#| msgid "Hardware problem"
+msgid "LDAP alias problem"
+msgstr "Хардверски проблем"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid DN syntax in LDAP"
+msgstr "Неисправно стање"
+
+msgid "LDAP entry is a leaf"
+msgstr ""
+
+#, fuzzy
+#| msgid "Encoding problem"
+msgid "LDAP alias dereferencing problem"
+msgstr "Проблем кодирања"
+
+msgid "LDAP proxy authorization failure (X)"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate LDAP authentication"
+msgstr "Неподржана заштита"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid LDAP credentials"
+msgstr "Неисправна картица"
+
+msgid "Insufficient access for LDAP"
+msgstr ""
+
+msgid "LDAP server is busy"
+msgstr ""
+
+msgid "LDAP server is unavailable"
+msgstr ""
+
+msgid "LDAP server is unwilling to perform"
+msgstr ""
+
+msgid "Loop detected by LDAP"
+msgstr ""
+
+#, fuzzy
+#| msgid "Missing action"
+msgid "LDAP naming violation"
+msgstr "Недостаје радња"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP object class violation"
+msgstr "Кршење протокола"
+
+#, fuzzy
+#| msgid "Operation not yet finished"
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "Радња није још завршена"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation not allowed on RDN"
+msgstr "Радња је отказана"
+
+msgid "Already exists (LDAP)"
+msgstr ""
+
+msgid "Cannot modify LDAP object class"
+msgstr ""
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "LDAP results too large"
+msgstr "Ред је предуг"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation affects multiple DSAs"
+msgstr "Радња је отказана"
+
+msgid "Virtual LDAP list view error"
+msgstr ""
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other LDAP error"
+msgstr "Општа грешка ИПЦ-а"
+
+#, fuzzy
+#| msgid "Resources exhausted"
+msgid "Resources exhausted in LCUP"
+msgstr "Изворишта су истрошена"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Security violation in LCUP"
+msgstr "Кршење протокола"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid data in LCUP"
+msgstr "Неисправно стање"
+
+#, fuzzy
+#| msgid "Unsupported certificate"
+msgid "Unsupported scheme in LCUP"
+msgstr "Неподржано уверење"
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Reload required in LCUP"
+msgstr "Потребно је поновно постављање картице"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP cancelled"
+msgstr "Успешно"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "No LDAP operation to cancel"
+msgstr "Није делотворно"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "Too late to cancel LDAP"
+msgstr "Није делотворно"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot cancel LDAP"
+msgstr "Није ИПЦ сервер"
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "LDAP assertion failed"
+msgstr "Дешифровање није успело"
+
+msgid "Proxied authorization denied by LDAP"
+msgstr ""
+
+msgid "User defined error code 1"
+msgstr "1. код грешке који је одредио корисник"
+
+msgid "User defined error code 2"
+msgstr "2. код грешке који је одредио корисник"
+
+msgid "User defined error code 3"
+msgstr "3. код грешке који је одредио корисник"
+
+msgid "User defined error code 4"
+msgstr "4. код грешке који је одредио корисник"
+
+msgid "User defined error code 5"
+msgstr "5. код грешке који је одредио корисник"
+
+msgid "User defined error code 6"
+msgstr "6. код грешке који је одредио корисник"
+
+msgid "User defined error code 7"
+msgstr "7. код грешке који је одредио корисник"
+
+msgid "User defined error code 8"
+msgstr "8. код грешке који је одредио корисник"
+
+msgid "User defined error code 9"
+msgstr "9. код грешке који је одредио корисник"
+
+msgid "User defined error code 10"
+msgstr "10. код грешке који је одредио корисник"
+
+msgid "User defined error code 11"
+msgstr "11. код грешке који је одредио корисник"
+
+msgid "User defined error code 12"
+msgstr "12. код грешке који је одредио корисник"
+
+msgid "User defined error code 13"
+msgstr "13. код грешке који је одредио корисник"
+
+msgid "User defined error code 14"
+msgstr "14. код грешке који је одредио корисник"
+
+msgid "User defined error code 15"
+msgstr "15. код грешке који је одредио корисник"
+
+msgid "User defined error code 16"
+msgstr "16. код грешке који је одредио корисник"
+
+msgid "System error w/o errno"
+msgstr "Број в/о грешке системске грешке"
+
+msgid "Unknown system error"
+msgstr "Непозната грешка система"
+
+msgid "End of file"
+msgstr "Крај датотеке"
+
+msgid "Unknown error code"
+msgstr "Непознат код грешке"
+
+#, c-format
+msgid "Usage: %s GPG-ERROR [...]\n"
+msgstr "Употреба: %s GPG-ERROR [...]\n"
+
+#, c-format
+msgid "%s: warning: could not recognize %s\n"
+msgstr "%s: упозорење: не могу да препознам „%s“\n"
+
+#, fuzzy
+#~| msgid "Resources exhausted"
+#~ msgid "LCUP Resources exhausted"
+#~ msgstr "Изворишта су истрошена"
+
+#, fuzzy
+#~| msgid "Invalid data"
+#~ msgid "LCUP Invalid data"
+#~ msgstr "Неисправни подаци"
+
+#, fuzzy
+#~| msgid "General error"
+#~ msgid "LDAP Other general error"
+#~ msgstr "Општа грешка"
+
+#, fuzzy
+#~| msgid "dirmngr error"
+#~ msgid "Encoding error"
+#~ msgstr "грешка управника директоријумом"
diff --git a/po/sv.po b/po/sv.po
new file mode 100644
index 0000000..70d42db
--- /dev/null
+++ b/po/sv.po
@@ -0,0 +1,1514 @@
+# Swedish translation for libgpg-error.
+# Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc.
+# This file is distributed under the same license as the libgpg-error package.
+# Daniel Nylander <[email protected]>, 2006, 2007, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: libgpg-error 1.7\n"
+"Report-Msgid-Bugs-To: [email protected]\n"
+"PO-Revision-Date: 2013-02-23 20:10+0100\n"
+"Last-Translator: Daniel Nylander <[email protected]>\n"
+"Language-Team: Swedish <[email protected]>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "Unspecified source"
+msgstr "Ospecificerad källa"
+
+msgid "gcrypt"
+msgstr "gcrypt"
+
+msgid "GnuPG"
+msgstr "GnuPG"
+
+msgid "GpgSM"
+msgstr "GpgSM"
+
+msgid "GPG Agent"
+msgstr "GPG Agent"
+
+msgid "Pinentry"
+msgstr "PIN-inmatning"
+
+msgid "SCD"
+msgstr "SCD"
+
+msgid "GPGME"
+msgstr "GPGME"
+
+msgid "Keybox"
+msgstr "Nyckellåda"
+
+msgid "KSBA"
+msgstr "KSBA"
+
+msgid "Dirmngr"
+msgstr "Dirmngr"
+
+msgid "GSTI"
+msgstr "GSTI"
+
+msgid "GPA"
+msgstr "GPA"
+
+msgid "Kleopatra"
+msgstr "Kleopatra"
+
+msgid "G13"
+msgstr "G13"
+
+msgid "Assuan"
+msgstr "Assuan"
+
+msgid "TLS"
+msgstr ""
+
+msgid "Any source"
+msgstr "Alla källor"
+
+msgid "User defined source 1"
+msgstr "Användardefinierad källa 1"
+
+msgid "User defined source 2"
+msgstr "Användardefinierad källa 2"
+
+msgid "User defined source 3"
+msgstr "Användardefinierad källa 3"
+
+msgid "User defined source 4"
+msgstr "Användardefinierad källa 4"
+
+msgid "Unknown source"
+msgstr "Okänd källa"
+
+msgid "Success"
+msgstr "Lyckades"
+
+msgid "General error"
+msgstr "Allmänt fel"
+
+msgid "Unknown packet"
+msgstr "Okänt paket"
+
+msgid "Unknown version in packet"
+msgstr "Okänd version i paket"
+
+msgid "Invalid public key algorithm"
+msgstr "Ogiltig publik nyckel-algoritm"
+
+msgid "Invalid digest algorithm"
+msgstr "Ogiltig sammandragsalgoritm"
+
+msgid "Bad public key"
+msgstr "Felaktig publik nyckel"
+
+msgid "Bad secret key"
+msgstr "Felaktig hemlig nyckel"
+
+msgid "Bad signature"
+msgstr "Felaktig signatur"
+
+msgid "No public key"
+msgstr "Ingen publik nyckel"
+
+msgid "Checksum error"
+msgstr "Kontrollsummefel"
+
+msgid "Bad passphrase"
+msgstr "Felaktig lösenfras"
+
+msgid "Invalid cipher algorithm"
+msgstr "Ogiltig chifferalgoritm"
+
+msgid "Cannot open keyring"
+msgstr "Nyckelring är öppnad"
+
+msgid "Invalid packet"
+msgstr "Ogiltigt paket"
+
+msgid "Invalid armor"
+msgstr "Ogiltigt ASCII-skal"
+
+msgid "No user ID"
+msgstr "Inget användar-id"
+
+msgid "No secret key"
+msgstr "Ingen hemlig nyckel"
+
+msgid "Wrong secret key used"
+msgstr "Fel hemlig nyckel använd"
+
+msgid "Bad session key"
+msgstr "Felaktig sessionsnyckel"
+
+msgid "Unknown compression algorithm"
+msgstr "Okänd komprimeringsalgoritm"
+
+msgid "Number is not prime"
+msgstr "Tal är inte ett primtal"
+
+msgid "Invalid encoding method"
+msgstr "Ogiltig kodningsmetod"
+
+msgid "Invalid encryption scheme"
+msgstr "Ogiltigt krypteringsschema"
+
+msgid "Invalid signature scheme"
+msgstr "Ogiltigt signaturschema"
+
+msgid "Invalid attribute"
+msgstr "Ogiltigt attribut"
+
+msgid "No value"
+msgstr "Inget värde"
+
+msgid "Not found"
+msgstr "Hittades inte"
+
+msgid "Value not found"
+msgstr "Värdet hittades inte"
+
+msgid "Syntax error"
+msgstr "Syntaxfel"
+
+msgid "Bad MPI value"
+msgstr "Felaktigt MPI-värde"
+
+msgid "Invalid passphrase"
+msgstr "Ogiltig lösenfras"
+
+msgid "Invalid signature class"
+msgstr "Ogiltig signaturklass"
+
+msgid "Resources exhausted"
+msgstr "Resurser överansträngda"
+
+msgid "Invalid keyring"
+msgstr "Ogiltig nyckelring"
+
+msgid "Trust DB error"
+msgstr "Fel i tillitsdatabas"
+
+msgid "Bad certificate"
+msgstr "Felaktigt certifikat"
+
+msgid "Invalid user ID"
+msgstr "Ogiltig användaridentitet"
+
+msgid "Unexpected error"
+msgstr "Oväntat fel"
+
+msgid "Time conflict"
+msgstr "Tidskonflikt"
+
+msgid "Keyserver error"
+msgstr "Fel i nyckelserver"
+
+msgid "Wrong public key algorithm"
+msgstr "Fel publik nyckel-algoritm"
+
+msgid "Tribute to D. A."
+msgstr "Hyllning till D. A."
+
+msgid "Weak encryption key"
+msgstr "Svag krypteringsnyckel"
+
+msgid "Invalid key length"
+msgstr "Ogiltig nyckellängd"
+
+msgid "Invalid argument"
+msgstr "Ogiltigt argument"
+
+msgid "Syntax error in URI"
+msgstr "Syntaxfel i uri"
+
+msgid "Invalid URI"
+msgstr "Ogiltig uri"
+
+msgid "Network error"
+msgstr "Nätverksfel"
+
+msgid "Unknown host"
+msgstr "Okänd värd"
+
+msgid "Selftest failed"
+msgstr "Självtestning misslyckades"
+
+msgid "Data not encrypted"
+msgstr "Data är inte krypterat"
+
+msgid "Data not processed"
+msgstr "Data inte behandlat"
+
+msgid "Unusable public key"
+msgstr "Oanvändbar publik nyckel"
+
+msgid "Unusable secret key"
+msgstr "Oanvändbar hemlig nyckel"
+
+msgid "Invalid value"
+msgstr "Ogiltigt värde"
+
+msgid "Bad certificate chain"
+msgstr "Felaktig certifikatkedja"
+
+msgid "Missing certificate"
+msgstr "Saknar certifikat"
+
+msgid "No data"
+msgstr "Inget data"
+
+msgid "Bug"
+msgstr "Fel"
+
+msgid "Not supported"
+msgstr "Stöds inte"
+
+msgid "Invalid operation code"
+msgstr "Ogiltig åtgärdskod"
+
+msgid "Timeout"
+msgstr "Tidsgräns"
+
+msgid "Internal error"
+msgstr "Internt fel"
+
+msgid "EOF (gcrypt)"
+msgstr "Slut på filen (gcrypt)"
+
+msgid "Invalid object"
+msgstr "Ogiltigt objekt"
+
+msgid "Provided object is too short"
+msgstr "Tillhandahållet objekt är för kort"
+
+msgid "Provided object is too large"
+msgstr "Tillhandahållet objekt är för stort"
+
+msgid "Missing item in object"
+msgstr "Saknar post i objekt"
+
+msgid "Not implemented"
+msgstr "Inte implementerad"
+
+msgid "Conflicting use"
+msgstr "Konflikt i användningen"
+
+msgid "Invalid cipher mode"
+msgstr "Ogiltigt chifferläge"
+
+msgid "Invalid flag"
+msgstr "Ogiltig flagga"
+
+msgid "Invalid handle"
+msgstr "Ogiltig hanterare"
+
+msgid "Result truncated"
+msgstr "Resultat nerskalat"
+
+msgid "Incomplete line"
+msgstr "Ofullständig rad"
+
+msgid "Invalid response"
+msgstr "Ogiltigt svar"
+
+msgid "No agent running"
+msgstr "Ingen agent kör"
+
+#, fuzzy
+#| msgid "agent error"
+msgid "Agent error"
+msgstr "agentfel"
+
+msgid "Invalid data"
+msgstr "Ogiltig data"
+
+msgid "Unspecific Assuan server fault"
+msgstr "Ospecificerat Assuan-serverfel"
+
+msgid "General Assuan error"
+msgstr "Allmänt Assuan-fel"
+
+msgid "Invalid session key"
+msgstr "Ogiltig sessionsnyckel"
+
+msgid "Invalid S-expression"
+msgstr "Ogiltigt S-uttryck"
+
+msgid "Unsupported algorithm"
+msgstr "Algoritmen stöds inte"
+
+msgid "No pinentry"
+msgstr "Ingen PIN-inmatning"
+
+msgid "pinentry error"
+msgstr "PIN-inmatningsfel"
+
+msgid "Bad PIN"
+msgstr "Felaktig PIN-kod"
+
+msgid "Invalid name"
+msgstr "Ogiltigt namn"
+
+msgid "Bad data"
+msgstr "Felaktigt data"
+
+msgid "Invalid parameter"
+msgstr "Ogiltig parameter"
+
+msgid "Wrong card"
+msgstr "Fel kort"
+
+msgid "No dirmngr"
+msgstr "Ingen dirmngr"
+
+msgid "dirmngr error"
+msgstr "dirmngr-fel"
+
+msgid "Certificate revoked"
+msgstr "Certifikatet är spärrat"
+
+msgid "No CRL known"
+msgstr "Ingen känd CRL"
+
+msgid "CRL too old"
+msgstr "CRL för gammal"
+
+msgid "Line too long"
+msgstr "Raden är för lång"
+
+msgid "Not trusted"
+msgstr "Inte betrodd"
+
+msgid "Operation cancelled"
+msgstr "Åtgärden avbröts"
+
+msgid "Bad CA certificate"
+msgstr "Felaktigt CA-certifikat"
+
+msgid "Certificate expired"
+msgstr "Certifikatet har gått ut"
+
+msgid "Certificate too young"
+msgstr "Certifikatet är för ungt"
+
+msgid "Unsupported certificate"
+msgstr "Certifikatet stöds inte"
+
+msgid "Unknown S-expression"
+msgstr "Okänt S-uttryck"
+
+msgid "Unsupported protection"
+msgstr "Skyddet stöds inte"
+
+msgid "Corrupted protection"
+msgstr "Skadat skydd"
+
+msgid "Ambiguous name"
+msgstr "Tvetydigt namn"
+
+msgid "Card error"
+msgstr "Kortfel"
+
+msgid "Card reset required"
+msgstr "Nollställning av kort krävs"
+
+msgid "Card removed"
+msgstr "Kort borttaget"
+
+msgid "Invalid card"
+msgstr "Ogiltigt kort"
+
+msgid "Card not present"
+msgstr "Kortet inte inmatat"
+
+msgid "No PKCS15 application"
+msgstr "Inget PKCS15-program"
+
+msgid "Not confirmed"
+msgstr "Inte bekräftad"
+
+msgid "Configuration error"
+msgstr "Konfigurationsfel"
+
+msgid "No policy match"
+msgstr "Ingen policyträff"
+
+msgid "Invalid index"
+msgstr "Ogiltigt index"
+
+msgid "Invalid ID"
+msgstr "Ogiltigt id"
+
+msgid "No SmartCard daemon"
+msgstr "Ingen SmartCard-demon"
+
+msgid "SmartCard daemon error"
+msgstr "Fel i SmartCard-demon"
+
+msgid "Unsupported protocol"
+msgstr "Protokollet stöds inte"
+
+msgid "Bad PIN method"
+msgstr "Felaktig PIN-metod"
+
+msgid "Card not initialized"
+msgstr "Kortet är inte initierat"
+
+msgid "Unsupported operation"
+msgstr "Åtgärden stöds inte"
+
+msgid "Wrong key usage"
+msgstr "Fel nyckelanvändning"
+
+msgid "Nothing found"
+msgstr "Ingenting hittades"
+
+msgid "Wrong blob type"
+msgstr "Felaktig blob-typ"
+
+msgid "Missing value"
+msgstr "Saknar värde"
+
+msgid "Hardware problem"
+msgstr "Hårdvaruproblem"
+
+msgid "PIN blocked"
+msgstr "PIN-kod blockerad"
+
+msgid "Conditions of use not satisfied"
+msgstr "Användningsvillkoren tillfredsställs inte"
+
+msgid "PINs are not synced"
+msgstr "PIN-koderna är inte synkroniserade"
+
+msgid "Invalid CRL"
+msgstr "Ogiltig CRL"
+
+msgid "BER error"
+msgstr "BER-fel"
+
+msgid "Invalid BER"
+msgstr "Ogiltg BER"
+
+msgid "Element not found"
+msgstr "Elementet hittades inte"
+
+msgid "Identifier not found"
+msgstr "Identifieraren hittades inte"
+
+msgid "Invalid tag"
+msgstr "Ogiltig tagg"
+
+msgid "Invalid length"
+msgstr "Ogiltig längd"
+
+msgid "Invalid key info"
+msgstr "Ogiltig nyckelinformation"
+
+msgid "Unexpected tag"
+msgstr "Oväntad tagg"
+
+msgid "Not DER encoded"
+msgstr "Inte DER-kodat"
+
+msgid "No CMS object"
+msgstr "Inget CMS-objekt"
+
+msgid "Invalid CMS object"
+msgstr "Ogiltigt CMS-objekt"
+
+msgid "Unknown CMS object"
+msgstr "Okänt CMS-objekt"
+
+msgid "Unsupported CMS object"
+msgstr "CMS-objektet stöds inte"
+
+msgid "Unsupported encoding"
+msgstr "Kodningen stöds inte"
+
+msgid "Unsupported CMS version"
+msgstr "CMS-versionen stöds inte"
+
+msgid "Unknown algorithm"
+msgstr "Okänd algoritm"
+
+msgid "Invalid crypto engine"
+msgstr "Ogiltig krypteringsmotor"
+
+msgid "Public key not trusted"
+msgstr "Publika nyckeln inte betrodd"
+
+msgid "Decryption failed"
+msgstr "Dekryptering misslyckades"
+
+msgid "Key expired"
+msgstr "Nyckeln har gått ut"
+
+msgid "Signature expired"
+msgstr "Signaturen har gått ut"
+
+msgid "Encoding problem"
+msgstr "Kodningsproblem"
+
+msgid "Invalid state"
+msgstr "Ogiltigt tillstånd"
+
+msgid "Duplicated value"
+msgstr "Dubblettvärde"
+
+msgid "Missing action"
+msgstr "Saknar åtgärd"
+
+msgid "ASN.1 module not found"
+msgstr "ASN.1-modulen hittades inte"
+
+msgid "Invalid OID string"
+msgstr "Ogiltig OID-sträng"
+
+msgid "Invalid time"
+msgstr "Ogiltig tid"
+
+msgid "Invalid CRL object"
+msgstr "Ogiltigt CRL-objekt"
+
+msgid "Unsupported CRL version"
+msgstr "CRL-versionen stöds inte"
+
+msgid "Invalid certificate object"
+msgstr "Ogiltigt certifikatobjekt"
+
+msgid "Unknown name"
+msgstr "Okänt namn"
+
+msgid "A locale function failed"
+msgstr "En lokalfunktion misslyckades"
+
+msgid "Not locked"
+msgstr "Inte låst"
+
+msgid "Protocol violation"
+msgstr "Protokollöverträdelse"
+
+msgid "Invalid MAC"
+msgstr "Ogiltig MAC"
+
+msgid "Invalid request"
+msgstr "Ogiltig begäran"
+
+msgid "Unknown extension"
+msgstr "Okänd utökning"
+
+msgid "Unknown critical extension"
+msgstr "Okänd kritiskt tillägg"
+
+msgid "Locked"
+msgstr "Låst"
+
+msgid "Unknown option"
+msgstr "Okänd flagga"
+
+msgid "Unknown command"
+msgstr "Okänt kommando"
+
+msgid "Not operational"
+msgstr "Fungerar inte"
+
+msgid "No passphrase given"
+msgstr "Ingen lösenfras angiven"
+
+msgid "No PIN given"
+msgstr "Ingen pinkod angiven"
+
+#, fuzzy
+msgid "Not enabled"
+msgstr "Inte låst"
+
+#, fuzzy
+msgid "No crypto engine"
+msgstr "Ogiltig krypteringsmotor"
+
+#, fuzzy
+msgid "Missing key"
+msgstr "Saknar värde"
+
+#, fuzzy
+msgid "Too many objects"
+msgstr "Inget CMS-objekt"
+
+msgid "Limit reached"
+msgstr ""
+
+#, fuzzy
+msgid "Not initialized"
+msgstr "Kortet är inte initierat"
+
+#, fuzzy
+msgid "Missing issuer certificate"
+msgstr "Saknar certifikat"
+
+msgid "No keyserver available"
+msgstr ""
+
+#, fuzzy
+msgid "Invalid elliptic curve"
+msgstr "Ogiltig tid"
+
+#, fuzzy
+msgid "Unknown elliptic curve"
+msgstr "Okänd källa"
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated key"
+msgstr "Dubblettvärde"
+
+#, fuzzy
+#| msgid "Ambiguous name"
+msgid "Ambiguous result"
+msgstr "Tvetydigt namn"
+
+#, fuzzy
+msgid "No crypto context"
+msgstr "Ogiltig krypteringsmotor"
+
+#, fuzzy
+msgid "Wrong crypto context"
+msgstr "Ogiltig krypteringsmotor"
+
+#, fuzzy
+#| msgid "Invalid crypto engine"
+msgid "Bad crypto context"
+msgstr "Ogiltig krypteringsmotor"
+
+msgid "Conflict in the crypto context"
+msgstr ""
+
+#, fuzzy
+#| msgid "No public key"
+msgid "Broken public key"
+msgstr "Ingen publik nyckel"
+
+#, fuzzy
+#| msgid "No secret key"
+msgid "Broken secret key"
+msgstr "Ingen hemlig nyckel"
+
+#, fuzzy
+#| msgid "Invalid digest algorithm"
+msgid "Invalid MAC algorithm"
+msgstr "Ogiltig sammandragsalgoritm"
+
+#, fuzzy
+msgid "Operation fully cancelled"
+msgstr "Åtgärden avbröts"
+
+msgid "Operation not yet finished"
+msgstr "Åtgärden är ännu inte färdig"
+
+msgid "Buffer too short"
+msgstr "Buffert för liten"
+
+msgid "Invalid length specifier in S-expression"
+msgstr "Ogiltig längdangivare i S-uttryck"
+
+msgid "String too long in S-expression"
+msgstr "Sträng för lång i S-uttryck"
+
+msgid "Unmatched parentheses in S-expression"
+msgstr "Omatchad parentes i S-uttryck"
+
+msgid "S-expression not canonical"
+msgstr "S-uttryck inte korrekt"
+
+msgid "Bad character in S-expression"
+msgstr "Felaktigt tecken i S-uttryck"
+
+msgid "Bad quotation in S-expression"
+msgstr "Fel citering i S-uttryck"
+
+msgid "Zero prefix in S-expression"
+msgstr "Nollprefix i S-uttryck"
+
+msgid "Nested display hints in S-expression"
+msgstr "Nästlade visningstips i S-uttryck"
+
+msgid "Unmatched display hints"
+msgstr "Omatchade visningstips"
+
+msgid "Unexpected reserved punctuation in S-expression"
+msgstr "Oväntat reserverat skiljetecken i S-uttryck"
+
+msgid "Bad hexadecimal character in S-expression"
+msgstr "Felaktigt hexadecimalt tecken i S-uttryck"
+
+msgid "Odd hexadecimal numbers in S-expression"
+msgstr "Udda hexadecimala tal i S-uttryck"
+
+#, fuzzy
+msgid "Bad octal character in S-expression"
+msgstr "Felaktigt oktadecimalt tecken i S-uttryck"
+
+msgid "All subkeys are expired or revoked"
+msgstr ""
+
+#, fuzzy
+#| msgid "Data not encrypted"
+msgid "Database is corrupted"
+msgstr "Data är inte krypterat"
+
+msgid "Server indicated a failure"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "No name"
+msgstr "Okänt namn"
+
+#, fuzzy
+#| msgid "No public key"
+msgid "No key"
+msgstr "Ingen publik nyckel"
+
+msgid "Legacy key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Buffer too short"
+msgid "Request too short"
+msgstr "Buffert för liten"
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "Request too long"
+msgstr "Raden är för lång"
+
+msgid "Object is in termination state"
+msgstr ""
+
+#, fuzzy
+#| msgid "Bad certificate chain"
+msgid "No certificate chain"
+msgstr "Felaktig certifikatkedja"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Certificate is too large"
+msgstr "Certifikatet är för ungt"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid record"
+msgstr "Ogiltigt kort"
+
+msgid "The MAC does not verify"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unexpected tag"
+msgid "Unexpected message"
+msgstr "Oväntad tagg"
+
+msgid "Compression or decompression failed"
+msgstr ""
+
+msgid "A counter would wrap"
+msgstr ""
+
+msgid "Fatal alert message received"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid cipher algorithm"
+msgid "No cipher algorithm"
+msgstr "Ogiltig chifferalgoritm"
+
+#, fuzzy
+msgid "Missing client certificate"
+msgstr "Saknar certifikat"
+
+#, fuzzy
+#| msgid "Certificate revoked"
+msgid "Close notification received"
+msgstr "Certifikatet är spärrat"
+
+#, fuzzy
+#| msgid "Key expired"
+msgid "Ticket expired"
+msgstr "Nyckeln har gått ut"
+
+#, fuzzy
+#| msgid "Bad public key"
+msgid "Bad ticket"
+msgstr "Felaktig publik nyckel"
+
+#, fuzzy
+#| msgid "Unknown packet"
+msgid "Unknown identity"
+msgstr "Okänt paket"
+
+#, fuzzy
+#| msgid "Bad certificate chain"
+msgid "Bad certificate message in handshake"
+msgstr "Felaktig certifikatkedja"
+
+msgid "Bad certificate request message in handshake"
+msgstr ""
+
+msgid "Bad certificate verify message in handshake"
+msgstr ""
+
+msgid "Bad change cipher message in handshake"
+msgstr ""
+
+msgid "Bad client hello message in handshake"
+msgstr ""
+
+msgid "Bad server hello message in handshake"
+msgstr ""
+
+msgid "Bad server hello done message in handshake"
+msgstr ""
+
+msgid "Bad finished message in handshake"
+msgstr ""
+
+msgid "Bad server key exchange message in handshake"
+msgstr ""
+
+msgid "Bad client key exchange message in handshake"
+msgstr ""
+
+msgid "Bogus string"
+msgstr ""
+
+msgid "Forbidden"
+msgstr ""
+
+#, fuzzy
+#| msgid "Key expired"
+msgid "Key disabled"
+msgstr "Nyckeln har gått ut"
+
+msgid "Not possible with a card based key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid object"
+msgid "Invalid lock object"
+msgstr "Ogiltigt objekt"
+
+msgid "True"
+msgstr ""
+
+msgid "False"
+msgstr ""
+
+msgid "General IPC error"
+msgstr "Allmänt IPC-fel"
+
+msgid "IPC accept call failed"
+msgstr "IPC-acceptanrop misslyckades"
+
+msgid "IPC connect call failed"
+msgstr "IPC-anslutningsanrop misslyckades"
+
+msgid "Invalid IPC response"
+msgstr "Ogiltigt IPC-svar"
+
+msgid "Invalid value passed to IPC"
+msgstr "Ogiltigt värde skickat till IPC"
+
+msgid "Incomplete line passed to IPC"
+msgstr "Ofullständig rad skickad till IPC"
+
+msgid "Line passed to IPC too long"
+msgstr "Raden skickad till IPC är för lång"
+
+msgid "Nested IPC commands"
+msgstr "Nästlade IPC-kommandon"
+
+msgid "No data callback in IPC"
+msgstr "Inget datasvarsanrop i IPC"
+
+msgid "No inquire callback in IPC"
+msgstr "Inget datafrågeanrop i IPC"
+
+msgid "Not an IPC server"
+msgstr "Inte en IPC-server"
+
+msgid "Not an IPC client"
+msgstr "Inte en IPC-klient"
+
+msgid "Problem starting IPC server"
+msgstr "Problem med att starta IPC-server"
+
+msgid "IPC read error"
+msgstr "IPC-läsfel"
+
+msgid "IPC write error"
+msgstr "IPC-skrivfel"
+
+msgid "Too much data for IPC layer"
+msgstr "För mycket data för IPC-lager"
+
+msgid "Unexpected IPC command"
+msgstr "Oväntat IPC-kommando"
+
+msgid "Unknown IPC command"
+msgstr "Okänt IPC-kommando"
+
+msgid "IPC syntax error"
+msgstr "IPC-syntaxfel"
+
+msgid "IPC call has been cancelled"
+msgstr "IPC-anropet har avbrutits"
+
+msgid "No input source for IPC"
+msgstr "Ingen inmatningskälla för IPC"
+
+msgid "No output source for IPC"
+msgstr "Ingen utmatningskälla för IPC"
+
+msgid "IPC parameter error"
+msgstr "IPC-parameterfel"
+
+msgid "Unknown IPC inquire"
+msgstr "Okänd IPC-fråga"
+
+#, fuzzy
+msgid "Crypto engine too old"
+msgstr "Ogiltig krypteringsmotor"
+
+msgid "Screen or window too small"
+msgstr ""
+
+msgid "Screen or window too large"
+msgstr ""
+
+msgid "Required environment variable not set"
+msgstr ""
+
+msgid "User ID already exists"
+msgstr ""
+
+msgid "Name already exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated name"
+msgstr "Dubblettvärde"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Object is too young"
+msgstr "Certifikatet är för ungt"
+
+#, fuzzy
+#| msgid "Provided object is too short"
+msgid "Object is too old"
+msgstr "Tillhandahållet objekt är för kort"
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Unknown flag"
+msgstr "Okänt namn"
+
+#, fuzzy
+#| msgid "Invalid operation code"
+msgid "Invalid execution order"
+msgstr "Ogiltig åtgärdskod"
+
+msgid "Already fetched"
+msgstr ""
+
+msgid "Try again later"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Wrong name"
+msgstr "Okänt namn"
+
+msgid "System bug detected"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown system error"
+msgid "Unknown DNS error"
+msgstr "Okänt systemfel"
+
+#, fuzzy
+#| msgid "Invalid OID string"
+msgid "Invalid DNS section"
+msgstr "Ogiltig OID-sträng"
+
+#, fuzzy
+#| msgid "Invalid S-expression"
+msgid "Invalid textual address form"
+msgstr "Ogiltigt S-uttryck"
+
+#, fuzzy
+msgid "Missing DNS query packet"
+msgstr "Saknar certifikat"
+
+msgid "Missing DNS answer packet"
+msgstr ""
+
+msgid "Connection closed in DNS"
+msgstr ""
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "Verification failed in DNS"
+msgstr "Dekryptering misslyckades"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "DNS Timeout"
+msgstr "Tidsgräns"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "General LDAP error"
+msgstr "Allmänt IPC-fel"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP attribute error"
+msgstr "Allmänt fel"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP name error"
+msgstr "Allmänt fel"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP security error"
+msgstr "Allmänt Assuan-fel"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP service error"
+msgstr "Allmänt fel"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP update error"
+msgstr "Allmänt Assuan-fel"
+
+msgid "Experimental LDAP error code"
+msgstr ""
+
+#, fuzzy
+#| msgid "IPC write error"
+msgid "Private LDAP error code"
+msgstr "IPC-skrivfel"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other general LDAP error"
+msgstr "Allmänt IPC-fel"
+
+#, fuzzy
+#| msgid "IPC connect call failed"
+msgid "LDAP connecting failed (X)"
+msgstr "IPC-anslutningsanrop misslyckades"
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral limit exceeded"
+msgstr "Allmänt fel"
+
+msgid "LDAP client loop"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "No LDAP results returned"
+msgstr "Nollställning av kort krävs"
+
+#, fuzzy
+#| msgid "Element not found"
+msgid "LDAP control not found"
+msgstr "Elementet hittades inte"
+
+#, fuzzy
+#| msgid "Not supported"
+msgid "Not supported by LDAP"
+msgstr "Stöds inte"
+
+#, fuzzy
+#| msgid "Unexpected error"
+msgid "LDAP connect error"
+msgstr "Oväntat fel"
+
+msgid "Out of memory in LDAP"
+msgstr ""
+
+msgid "Bad parameter to an LDAP routine"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported operation"
+msgid "User cancelled LDAP operation"
+msgstr "Åtgärden stöds inte"
+
+#, fuzzy
+#| msgid "Bad certificate"
+msgid "Bad LDAP search filter"
+msgstr "Felaktigt certifikat"
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "Unknown LDAP authentication method"
+msgstr "Okänd utökning"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "Timeout in LDAP"
+msgstr "Tidsgräns"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP decoding error"
+msgstr "dirmngr-fel"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP encoding error"
+msgstr "dirmngr-fel"
+
+#, fuzzy
+#| msgid "IPC read error"
+msgid "LDAP local error"
+msgstr "IPC-läsfel"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot contact LDAP server"
+msgstr "Inte en IPC-server"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP success"
+msgstr "Lyckades"
+
+#, fuzzy
+#| msgid "Configuration error"
+msgid "LDAP operations error"
+msgstr "Konfigurationsfel"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP protocol error"
+msgstr "Protokollöverträdelse"
+
+msgid "Time limit exceeded in LDAP"
+msgstr ""
+
+msgid "Size limit exceeded in LDAP"
+msgstr ""
+
+msgid "LDAP compare false"
+msgstr ""
+
+msgid "LDAP compare true"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "LDAP authentication method not supported"
+msgstr "Okänd utökning"
+
+msgid "Strong(er) LDAP authentication required"
+msgstr ""
+
+msgid "Partial LDAP results+referral received"
+msgstr ""
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral"
+msgstr "Allmänt fel"
+
+msgid "Administrative LDAP limit exceeded"
+msgstr ""
+
+msgid "Critical LDAP extension is unavailable"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Confidentiality required by LDAP"
+msgstr "Nollställning av kort krävs"
+
+msgid "LDAP SASL bind in progress"
+msgstr ""
+
+msgid "No such LDAP attribute"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid attribute"
+msgid "Undefined LDAP attribute type"
+msgstr "Ogiltigt attribut"
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate matching in LDAP"
+msgstr "Skyddet stöds inte"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Constraint violation in LDAP"
+msgstr "Protokollöverträdelse"
+
+msgid "LDAP type or value exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid syntax in LDAP"
+msgstr "Ogiltigt tillstånd"
+
+#, fuzzy
+#| msgid "No CMS object"
+msgid "No such LDAP object"
+msgstr "Inget CMS-objekt"
+
+#, fuzzy
+#| msgid "Hardware problem"
+msgid "LDAP alias problem"
+msgstr "Hårdvaruproblem"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid DN syntax in LDAP"
+msgstr "Ogiltigt tillstånd"
+
+msgid "LDAP entry is a leaf"
+msgstr ""
+
+#, fuzzy
+#| msgid "Encoding problem"
+msgid "LDAP alias dereferencing problem"
+msgstr "Kodningsproblem"
+
+msgid "LDAP proxy authorization failure (X)"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate LDAP authentication"
+msgstr "Skyddet stöds inte"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid LDAP credentials"
+msgstr "Ogiltigt kort"
+
+msgid "Insufficient access for LDAP"
+msgstr ""
+
+msgid "LDAP server is busy"
+msgstr ""
+
+msgid "LDAP server is unavailable"
+msgstr ""
+
+msgid "LDAP server is unwilling to perform"
+msgstr ""
+
+msgid "Loop detected by LDAP"
+msgstr ""
+
+#, fuzzy
+#| msgid "Missing action"
+msgid "LDAP naming violation"
+msgstr "Saknar åtgärd"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP object class violation"
+msgstr "Protokollöverträdelse"
+
+#, fuzzy
+#| msgid "Operation not yet finished"
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "Åtgärden är ännu inte färdig"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation not allowed on RDN"
+msgstr "Åtgärden avbröts"
+
+msgid "Already exists (LDAP)"
+msgstr ""
+
+msgid "Cannot modify LDAP object class"
+msgstr ""
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "LDAP results too large"
+msgstr "Raden är för lång"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation affects multiple DSAs"
+msgstr "Åtgärden avbröts"
+
+msgid "Virtual LDAP list view error"
+msgstr ""
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other LDAP error"
+msgstr "Allmänt IPC-fel"
+
+#, fuzzy
+#| msgid "Resources exhausted"
+msgid "Resources exhausted in LCUP"
+msgstr "Resurser överansträngda"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Security violation in LCUP"
+msgstr "Protokollöverträdelse"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid data in LCUP"
+msgstr "Ogiltigt tillstånd"
+
+#, fuzzy
+#| msgid "Unsupported certificate"
+msgid "Unsupported scheme in LCUP"
+msgstr "Certifikatet stöds inte"
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Reload required in LCUP"
+msgstr "Nollställning av kort krävs"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP cancelled"
+msgstr "Lyckades"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "No LDAP operation to cancel"
+msgstr "Fungerar inte"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "Too late to cancel LDAP"
+msgstr "Fungerar inte"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot cancel LDAP"
+msgstr "Inte en IPC-server"
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "LDAP assertion failed"
+msgstr "Dekryptering misslyckades"
+
+msgid "Proxied authorization denied by LDAP"
+msgstr ""
+
+msgid "User defined error code 1"
+msgstr "Användardefinierad felkod 1"
+
+msgid "User defined error code 2"
+msgstr "Användardefinierad felkod 2"
+
+msgid "User defined error code 3"
+msgstr "Användardefinierad felkod 3"
+
+msgid "User defined error code 4"
+msgstr "Användardefinierad felkod 4"
+
+msgid "User defined error code 5"
+msgstr "Användardefinierad felkod 5"
+
+msgid "User defined error code 6"
+msgstr "Användardefinierad felkod 6"
+
+msgid "User defined error code 7"
+msgstr "Användardefinierad felkod 7"
+
+msgid "User defined error code 8"
+msgstr "Användardefinierad felkod 8"
+
+msgid "User defined error code 9"
+msgstr "Användardefinierad felkod 9"
+
+msgid "User defined error code 10"
+msgstr "Användardefinierad felkod 10"
+
+msgid "User defined error code 11"
+msgstr "Användardefinierad felkod 11"
+
+msgid "User defined error code 12"
+msgstr "Användardefinierad felkod 12"
+
+msgid "User defined error code 13"
+msgstr "Användardefinierad felkod 13"
+
+msgid "User defined error code 14"
+msgstr "Användardefinierad felkod 14"
+
+msgid "User defined error code 15"
+msgstr "Användardefinierad felkod 15"
+
+msgid "User defined error code 16"
+msgstr "Användardefinierad felkod 16"
+
+msgid "System error w/o errno"
+msgstr "Systemfel utan felnummer"
+
+msgid "Unknown system error"
+msgstr "Okänt systemfel"
+
+msgid "End of file"
+msgstr "Slut på fil"
+
+msgid "Unknown error code"
+msgstr "Okänd felkod"
+
+#, c-format
+msgid "Usage: %s GPG-ERROR [...]\n"
+msgstr "Användning: %s GPG-ERROR [...]\n"
+
+#, c-format
+msgid "%s: warning: could not recognize %s\n"
+msgstr "%s: varning: kände inte igen %s\n"
+
+#, fuzzy
+#~| msgid "Resources exhausted"
+#~ msgid "LCUP Resources exhausted"
+#~ msgstr "Resurser överansträngda"
+
+#, fuzzy
+#~| msgid "Invalid data"
+#~ msgid "LCUP Invalid data"
+#~ msgstr "Ogiltig data"
+
+#, fuzzy
+#~| msgid "General error"
+#~ msgid "LDAP Other general error"
+#~ msgstr "Allmänt fel"
+
+#, fuzzy
+#~| msgid "dirmngr error"
+#~ msgid "Encoding error"
+#~ msgstr "dirmngr-fel"
diff --git a/po/uk.po b/po/uk.po
new file mode 100644
index 0000000..9685110
--- /dev/null
+++ b/po/uk.po
@@ -0,0 +1,1366 @@
+# Translation of libgpg-error to Ukrainian
+# Copyright (C) 2012 Free Software Foundation, Inc.
+# This file is distributed under the same license as the libgpg-error package.
+#
+# Yuri Chornoivan <[email protected]>, 2012, 2014, 2015.
+msgid ""
+msgstr ""
+"Project-Id-Version: libgpg-error 1.7\n"
+"Report-Msgid-Bugs-To: [email protected]\n"
+"PO-Revision-Date: 2015-07-12 16:21+0300\n"
+"Last-Translator: Yuri Chornoivan <[email protected]>\n"
+"Language-Team: Ukrainian <[email protected]>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+"X-Generator: Lokalize 1.5\n"
+
+msgid "Unspecified source"
+msgstr "Невказане джерело"
+
+msgid "gcrypt"
+msgstr "gcrypt"
+
+msgid "GnuPG"
+msgstr "GnuPG"
+
+msgid "GpgSM"
+msgstr "GpgSM"
+
+msgid "GPG Agent"
+msgstr "Агент GPG"
+
+msgid "Pinentry"
+msgstr "Pinentry"
+
+msgid "SCD"
+msgstr "SCD"
+
+msgid "GPGME"
+msgstr "GPGME"
+
+msgid "Keybox"
+msgstr "Keybox"
+
+msgid "KSBA"
+msgstr "KSBA"
+
+msgid "Dirmngr"
+msgstr "Dirmngr"
+
+msgid "GSTI"
+msgstr "GSTI"
+
+msgid "GPA"
+msgstr "GPA"
+
+msgid "Kleopatra"
+msgstr "Kleopatra"
+
+msgid "G13"
+msgstr "G13"
+
+msgid "Assuan"
+msgstr "Assuan"
+
+msgid "TLS"
+msgstr "TLS"
+
+msgid "Any source"
+msgstr "Будь-яке джерело"
+
+msgid "User defined source 1"
+msgstr "Визначене користувачем джерело 1"
+
+msgid "User defined source 2"
+msgstr "Визначене користувачем джерело 2"
+
+msgid "User defined source 3"
+msgstr "Визначене користувачем джерело 3"
+
+msgid "User defined source 4"
+msgstr "Визначене користувачем джерело 4"
+
+msgid "Unknown source"
+msgstr "Невідоме джерело"
+
+msgid "Success"
+msgstr "Виконано"
+
+msgid "General error"
+msgstr "Загальна помилка"
+
+msgid "Unknown packet"
+msgstr "Невідомий пакет"
+
+msgid "Unknown version in packet"
+msgstr "Невідома версія у пакеті"
+
+msgid "Invalid public key algorithm"
+msgstr "Некоректний алгоритм відкритого ключа"
+
+msgid "Invalid digest algorithm"
+msgstr "Некоректний алгоритм контрольної суми"
+
+msgid "Bad public key"
+msgstr "Помилковий відкритий ключ"
+
+msgid "Bad secret key"
+msgstr "Помилковий закритий ключ"
+
+msgid "Bad signature"
+msgstr "Непридатний підпис"
+
+msgid "No public key"
+msgstr "Немає відкритого ключа"
+
+msgid "Checksum error"
+msgstr "Помилка у контрольній сумі"
+
+msgid "Bad passphrase"
+msgstr "Помилковий пароль"
+
+msgid "Invalid cipher algorithm"
+msgstr "Некоректний алгоритм шифрування"
+
+msgid "Cannot open keyring"
+msgstr "Відкриття сховища ключів"
+
+msgid "Invalid packet"
+msgstr "Некоректний пакет"
+
+msgid "Invalid armor"
+msgstr "Некоректний код ASCII"
+
+msgid "No user ID"
+msgstr "Немає ідентифікатора користувача"
+
+msgid "No secret key"
+msgstr "Немає закритого ключа"
+
+msgid "Wrong secret key used"
+msgstr "Використано помилковий закритий код"
+
+msgid "Bad session key"
+msgstr "Помилковий ключ сеансу"
+
+msgid "Unknown compression algorithm"
+msgstr "Невідомий алгоритм стискання"
+
+msgid "Number is not prime"
+msgstr "Число не є простим"
+
+msgid "Invalid encoding method"
+msgstr "Некоректний алгоритм кодування"
+
+msgid "Invalid encryption scheme"
+msgstr "Некоректна схема шифрування"
+
+msgid "Invalid signature scheme"
+msgstr "Некоректна схема підписування"
+
+msgid "Invalid attribute"
+msgstr "Некоректний атрибут"
+
+msgid "No value"
+msgstr "Немає значення"
+
+msgid "Not found"
+msgstr "Не знайдено"
+
+msgid "Value not found"
+msgstr "Значення не знайдено"
+
+msgid "Syntax error"
+msgstr "Синтаксична помилка"
+
+msgid "Bad MPI value"
+msgstr "Помилкове значення MPI"
+
+msgid "Invalid passphrase"
+msgstr "Некоректний пароль"
+
+msgid "Invalid signature class"
+msgstr "Некоректний клас підпису"
+
+msgid "Resources exhausted"
+msgstr "Вичерпано ресурси"
+
+msgid "Invalid keyring"
+msgstr "Некоректне сховище ключів"
+
+msgid "Trust DB error"
+msgstr "Помилка бази даних щодо надійності"
+
+msgid "Bad certificate"
+msgstr "Помилковий сертифікат"
+
+msgid "Invalid user ID"
+msgstr "Некоректний ідентифікатор користувача"
+
+msgid "Unexpected error"
+msgstr "Неочікувана помилка"
+
+msgid "Time conflict"
+msgstr "Суперечливі дані щодо часу"
+
+msgid "Keyserver error"
+msgstr "Помилка сервера ключів"
+
+msgid "Wrong public key algorithm"
+msgstr "Помилковий алгоритм відкритого ключа"
+
+msgid "Tribute to D. A."
+msgstr "Присвячується D. A."
+
+msgid "Weak encryption key"
+msgstr "Слабкий ключ шифрування"
+
+msgid "Invalid key length"
+msgstr "Некоректна довжина ключа"
+
+msgid "Invalid argument"
+msgstr "Некоректний аргумент"
+
+msgid "Syntax error in URI"
+msgstr "Синтаксична помилку у адресі"
+
+msgid "Invalid URI"
+msgstr "Некоректна адреса"
+
+msgid "Network error"
+msgstr "Помилка мережі"
+
+msgid "Unknown host"
+msgstr "Невідомий вузол"
+
+msgid "Selftest failed"
+msgstr "Помилка під час самоперевірки"
+
+msgid "Data not encrypted"
+msgstr "Дані не зашифровано"
+
+msgid "Data not processed"
+msgstr "Дані не оброблено"
+
+msgid "Unusable public key"
+msgstr "Непридатний до використання відкритий ключ"
+
+msgid "Unusable secret key"
+msgstr "Непридатний до використання закритий ключ"
+
+msgid "Invalid value"
+msgstr "Некоректне значення"
+
+msgid "Bad certificate chain"
+msgstr "Помилковий ланцюжок сертифікації"
+
+msgid "Missing certificate"
+msgstr "Не вистачає сертифіката"
+
+msgid "No data"
+msgstr "Немає даних"
+
+msgid "Bug"
+msgstr "Вада"
+
+msgid "Not supported"
+msgstr "Не підтримується"
+
+msgid "Invalid operation code"
+msgstr "Некоректний код дії"
+
+msgid "Timeout"
+msgstr "Час очікування"
+
+msgid "Internal error"
+msgstr "Внутрішня помилка"
+
+msgid "EOF (gcrypt)"
+msgstr "EOF (gcrypt)"
+
+msgid "Invalid object"
+msgstr "Некоректний об’єкт"
+
+msgid "Provided object is too short"
+msgstr "Наданий об’єкт є надто коротким"
+
+msgid "Provided object is too large"
+msgstr "Наданий об’єкт є надто довгим"
+
+msgid "Missing item in object"
+msgstr "У об’єкті не вистачає елемента"
+
+msgid "Not implemented"
+msgstr "Не реалізовано"
+
+msgid "Conflicting use"
+msgstr "Суперечливе використання"
+
+msgid "Invalid cipher mode"
+msgstr "Некоректний режим шифрування"
+
+msgid "Invalid flag"
+msgstr "Некоректний прапорець"
+
+msgid "Invalid handle"
+msgstr "Некоректний обробник"
+
+msgid "Result truncated"
+msgstr "Список результатів обрізано"
+
+msgid "Incomplete line"
+msgstr "Незавершений рядок"
+
+msgid "Invalid response"
+msgstr "Некоректна відповідь"
+
+msgid "No agent running"
+msgstr "Агент не запущено"
+
+msgid "Agent error"
+msgstr "Помилка агента"
+
+msgid "Invalid data"
+msgstr "Некоректні дані"
+
+msgid "Unspecific Assuan server fault"
+msgstr "Невизначена помилка сервера Assuan"
+
+msgid "General Assuan error"
+msgstr "Загальна помилка бібліотеки Assuan"
+
+msgid "Invalid session key"
+msgstr "Некоректний ключ сеансу"
+
+msgid "Invalid S-expression"
+msgstr "Некоректний S-вираз"
+
+msgid "Unsupported algorithm"
+msgstr "Непідтримуваний алгоритм"
+
+msgid "No pinentry"
+msgstr "Немає pinentry"
+
+msgid "pinentry error"
+msgstr "Помилка pinentry"
+
+msgid "Bad PIN"
+msgstr "Помилковий пінкод"
+
+msgid "Invalid name"
+msgstr "Некоректне назва"
+
+msgid "Bad data"
+msgstr "Помилкові дані"
+
+msgid "Invalid parameter"
+msgstr "Некоректний параметр"
+
+msgid "Wrong card"
+msgstr "Помилкова картка"
+
+msgid "No dirmngr"
+msgstr "Немає dirmngr"
+
+msgid "dirmngr error"
+msgstr "Помилка dirmngr"
+
+msgid "Certificate revoked"
+msgstr "Сертифікат відкликано"
+
+msgid "No CRL known"
+msgstr "Немає жодної відомої CRL"
+
+msgid "CRL too old"
+msgstr "CRL застарий"
+
+msgid "Line too long"
+msgstr "Рядок надто довгий"
+
+msgid "Not trusted"
+msgstr "Ненадійний"
+
+msgid "Operation cancelled"
+msgstr "Дію скасовано"
+
+msgid "Bad CA certificate"
+msgstr "Помилковий сертифікат CA"
+
+msgid "Certificate expired"
+msgstr "Термін дії сертифіката минув"
+
+msgid "Certificate too young"
+msgstr "Сертифікат є надто новим"
+
+msgid "Unsupported certificate"
+msgstr "Непідтримуваний сертифікат"
+
+msgid "Unknown S-expression"
+msgstr "Невідомий S-вираз"
+
+msgid "Unsupported protection"
+msgstr "Непідтримуваний захист"
+
+msgid "Corrupted protection"
+msgstr "Захист пошкоджено"
+
+msgid "Ambiguous name"
+msgstr "Неоднозначна назва"
+
+msgid "Card error"
+msgstr "Помилка під час роботи з карткою"
+
+msgid "Card reset required"
+msgstr "Надіслано запит на скидання картки"
+
+msgid "Card removed"
+msgstr "Картку вилучено"
+
+msgid "Invalid card"
+msgstr "Некоректна картка"
+
+msgid "Card not present"
+msgstr "Немає картки"
+
+msgid "No PKCS15 application"
+msgstr "Немає програми обробки PKCS15"
+
+msgid "Not confirmed"
+msgstr "Не підтверджено"
+
+msgid "Configuration error"
+msgstr "Помилка налаштування"
+
+msgid "No policy match"
+msgstr "Немає відповідного правила"
+
+msgid "Invalid index"
+msgstr "Некоректний індекс"
+
+msgid "Invalid ID"
+msgstr "Некоректний ідентифікатор"
+
+msgid "No SmartCard daemon"
+msgstr "Немає фонової служби SmartCard"
+
+msgid "SmartCard daemon error"
+msgstr "Помилка фонової служби SmartCard"
+
+msgid "Unsupported protocol"
+msgstr "Непідтримуваний протокол"
+
+msgid "Bad PIN method"
+msgstr "Помилковий метод обробки пінкоду"
+
+msgid "Card not initialized"
+msgstr "Картку не ініціалізовано"
+
+msgid "Unsupported operation"
+msgstr "Непідтримувана дія"
+
+msgid "Wrong key usage"
+msgstr "Помилкове використання ключа"
+
+msgid "Nothing found"
+msgstr "Нічого не знайдено"
+
+msgid "Wrong blob type"
+msgstr "Помилковий тип бінарного коду"
+
+msgid "Missing value"
+msgstr "Не вистачає значення"
+
+msgid "Hardware problem"
+msgstr "Апаратні проблеми"
+
+msgid "PIN blocked"
+msgstr "Пінкод заблоковано"
+
+msgid "Conditions of use not satisfied"
+msgstr "Не задоволено умови користування"
+
+msgid "PINs are not synced"
+msgstr "Пінкоди не синхронізовано"
+
+msgid "Invalid CRL"
+msgstr "Некоректне значення CRL"
+
+msgid "BER error"
+msgstr "Помилка BER"
+
+msgid "Invalid BER"
+msgstr "Некоректне значення BER"
+
+msgid "Element not found"
+msgstr "Елемента не знайдено"
+
+msgid "Identifier not found"
+msgstr "Не знайдено ідентифікатора"
+
+msgid "Invalid tag"
+msgstr "Некоректний теґ"
+
+msgid "Invalid length"
+msgstr "Некоректна довжина"
+
+msgid "Invalid key info"
+msgstr "Некоректні дані щодо ключа"
+
+msgid "Unexpected tag"
+msgstr "Неочікуваний теґ"
+
+msgid "Not DER encoded"
+msgstr "Не закодовано DER"
+
+msgid "No CMS object"
+msgstr "Немає об’єкта CMS"
+
+msgid "Invalid CMS object"
+msgstr "Некоректний об’єкт CMS"
+
+msgid "Unknown CMS object"
+msgstr "Невідомий об’єкт CMS"
+
+msgid "Unsupported CMS object"
+msgstr "Непідтримуваний об’єкт CMS"
+
+msgid "Unsupported encoding"
+msgstr "Непідтримуване кодування"
+
+msgid "Unsupported CMS version"
+msgstr "Непідтримувана версія CMS"
+
+msgid "Unknown algorithm"
+msgstr "Невідомий алгоритм"
+
+msgid "Invalid crypto engine"
+msgstr "Некоректний рушій шифрування"
+
+msgid "Public key not trusted"
+msgstr "Відкритий ключ не є надійним"
+
+msgid "Decryption failed"
+msgstr "Спроба розшифрування зазнала невдачі"
+
+msgid "Key expired"
+msgstr "Строк дії ключа вичерпано"
+
+msgid "Signature expired"
+msgstr "Строк дії підпису вичерпано"
+
+msgid "Encoding problem"
+msgstr "Проблема з кодуванням"
+
+msgid "Invalid state"
+msgstr "Некоректний стан"
+
+msgid "Duplicated value"
+msgstr "Дублювання значення"
+
+msgid "Missing action"
+msgstr "Не вистачає дії"
+
+msgid "ASN.1 module not found"
+msgstr "Не знайдено модуля ASN.1"
+
+msgid "Invalid OID string"
+msgstr "Некоректний рядок OID"
+
+msgid "Invalid time"
+msgstr "Некоректний час"
+
+msgid "Invalid CRL object"
+msgstr "Некоректний об’єкт CRL"
+
+msgid "Unsupported CRL version"
+msgstr "Непідтримувана версія CRL"
+
+msgid "Invalid certificate object"
+msgstr "Некоректний об’єкт сертифікації"
+
+msgid "Unknown name"
+msgstr "Невідома назва"
+
+msgid "A locale function failed"
+msgstr "Помилка функції локалізації"
+
+msgid "Not locked"
+msgstr "Не заблоковано"
+
+msgid "Protocol violation"
+msgstr "Порушення протоколу"
+
+msgid "Invalid MAC"
+msgstr "Некоректна MAC-адреса"
+
+msgid "Invalid request"
+msgstr "Некоректний запит"
+
+msgid "Unknown extension"
+msgstr "Невідоме розширення"
+
+msgid "Unknown critical extension"
+msgstr "Невідоме критичне розширення"
+
+msgid "Locked"
+msgstr "Заблоковано"
+
+msgid "Unknown option"
+msgstr "Невідомий параметр"
+
+msgid "Unknown command"
+msgstr "Невідома команда"
+
+msgid "Not operational"
+msgstr "Використання неможливе"
+
+msgid "No passphrase given"
+msgstr "Не вказано пароля"
+
+msgid "No PIN given"
+msgstr "Не вказано пінкоду"
+
+msgid "Not enabled"
+msgstr "Не увімкнено"
+
+msgid "No crypto engine"
+msgstr "Немає рушія шифрування"
+
+msgid "Missing key"
+msgstr "Пропущено ключ"
+
+msgid "Too many objects"
+msgstr "Забагато об’єктів"
+
+msgid "Limit reached"
+msgstr "Досягнуто обмеження"
+
+msgid "Not initialized"
+msgstr "Не ініціалізовано"
+
+msgid "Missing issuer certificate"
+msgstr "Не вистачає сертифіката видавця"
+
+msgid "No keyserver available"
+msgstr "Немає доступних серверів ключів"
+
+msgid "Invalid elliptic curve"
+msgstr "Некоректна еліптична крива"
+
+msgid "Unknown elliptic curve"
+msgstr "Невідома еліптична крива"
+
+msgid "Duplicated key"
+msgstr "Дублювання ключа"
+
+msgid "Ambiguous result"
+msgstr "Неоднозначний результат"
+
+msgid "No crypto context"
+msgstr "Немає контексту шифрування"
+
+msgid "Wrong crypto context"
+msgstr "Помилковий контекст шифрування"
+
+msgid "Bad crypto context"
+msgstr "Некоректний контекст шифрування"
+
+msgid "Conflict in the crypto context"
+msgstr "Конфлікт у контексті шифрування"
+
+msgid "Broken public key"
+msgstr "Пошкоджений відкритий ключ"
+
+msgid "Broken secret key"
+msgstr "Пошкоджений закритий ключ"
+
+msgid "Invalid MAC algorithm"
+msgstr "Некоректний алгоритм MAC"
+
+msgid "Operation fully cancelled"
+msgstr "Дію повністю скасовано"
+
+msgid "Operation not yet finished"
+msgstr "Виконання дії ще не завершено"
+
+msgid "Buffer too short"
+msgstr "Занадто короткий буфер"
+
+msgid "Invalid length specifier in S-expression"
+msgstr "Некоректний специфікатор довжини у S-виразі"
+
+msgid "String too long in S-expression"
+msgstr "Занадто довгий рядок у S-виразі"
+
+msgid "Unmatched parentheses in S-expression"
+msgstr "Незакриті дужки у S-виразі"
+
+msgid "S-expression not canonical"
+msgstr "S-вираз не є канонічним"
+
+msgid "Bad character in S-expression"
+msgstr "Помилковий символ у S-виразі"
+
+msgid "Bad quotation in S-expression"
+msgstr "Помилкові лапки у S-виразі"
+
+msgid "Zero prefix in S-expression"
+msgstr "Нульовий префікс у S-виразі"
+
+msgid "Nested display hints in S-expression"
+msgstr "Вкладені настанови щодо показу у S-виразі"
+
+msgid "Unmatched display hints"
+msgstr "Невідповідні настанови щодо показу"
+
+msgid "Unexpected reserved punctuation in S-expression"
+msgstr "Неочікувана зарезервована пунктуація у S-виразі"
+
+msgid "Bad hexadecimal character in S-expression"
+msgstr "Помилковий шістнадцятковий символ у S-виразі"
+
+msgid "Odd hexadecimal numbers in S-expression"
+msgstr "Дивні шістнадцяткові числа у S-виразі"
+
+msgid "Bad octal character in S-expression"
+msgstr "Помилковий вісімковий символ у S-виразі"
+
+msgid "All subkeys are expired or revoked"
+msgstr ""
+
+#, fuzzy
+#| msgid "Data not encrypted"
+msgid "Database is corrupted"
+msgstr "Дані не зашифровано"
+
+msgid "Server indicated a failure"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "No name"
+msgstr "Невідома назва"
+
+#, fuzzy
+#| msgid "No public key"
+msgid "No key"
+msgstr "Немає відкритого ключа"
+
+msgid "Legacy key"
+msgstr "Застарілий ключ"
+
+msgid "Request too short"
+msgstr "Занадто короткий запит"
+
+msgid "Request too long"
+msgstr "Надто довгий запит"
+
+msgid "Object is in termination state"
+msgstr "Об’єкт перебуває у стані переривання"
+
+msgid "No certificate chain"
+msgstr "Немає ланцюжка сертифікації"
+
+msgid "Certificate is too large"
+msgstr "Сертифікат є надто великим"
+
+msgid "Invalid record"
+msgstr "Некоректний запис"
+
+msgid "The MAC does not verify"
+msgstr "MAC не пройшов перевірку"
+
+msgid "Unexpected message"
+msgstr "Неочікуване повідомлення"
+
+msgid "Compression or decompression failed"
+msgstr "Помилка під час стискання або видобування"
+
+msgid "A counter would wrap"
+msgstr "Відлік буде автоматично розпочато з початку"
+
+msgid "Fatal alert message received"
+msgstr "Отримано критичне попереджувальне повідомлення"
+
+msgid "No cipher algorithm"
+msgstr "Немає алгоритму шифрування"
+
+msgid "Missing client certificate"
+msgstr "Не вистачає сертифіката клієнта"
+
+msgid "Close notification received"
+msgstr "Отримано сповіщення щодо закриття"
+
+msgid "Ticket expired"
+msgstr "Строк дії квитка вичерпано"
+
+msgid "Bad ticket"
+msgstr "Помилковий квиток"
+
+msgid "Unknown identity"
+msgstr "Невідомий профіль"
+
+msgid "Bad certificate message in handshake"
+msgstr "Помилкове повідомлення щодо сертифікації під час підтвердження зв’язку"
+
+msgid "Bad certificate request message in handshake"
+msgstr ""
+"Помилкове повідомлення щодо запиту сертифікації під час підтвердження зв’язку"
+
+msgid "Bad certificate verify message in handshake"
+msgstr ""
+"Помилкове повідомлення щодо перевірки сертифікації під час підтвердження "
+"зв’язку"
+
+msgid "Bad change cipher message in handshake"
+msgstr "Помилкове повідомлення щодо зміни шифру під час підтвердження зв’язку"
+
+msgid "Bad client hello message in handshake"
+msgstr "Помилкове вітальне повідомлення клієнта під час підтвердження зв’язку"
+
+msgid "Bad server hello message in handshake"
+msgstr "Помилкове вітальне повідомлення сервера під час підтвердження зв’язку"
+
+msgid "Bad server hello done message in handshake"
+msgstr ""
+"Помилкове повідомлення про завершення вітання від сервера під час "
+"підтвердження зв’язку"
+
+msgid "Bad finished message in handshake"
+msgstr "Помилкове завершальне повідомлення під час підтвердження зв’язку"
+
+msgid "Bad server key exchange message in handshake"
+msgstr ""
+"Помилкове повідомлення щодо обміну ключами із сервером під час підтвердження "
+"зв’язку"
+
+msgid "Bad client key exchange message in handshake"
+msgstr ""
+"Помилкове повідомлення щодо обміну ключами із клієнтом під час підтвердження "
+"зв’язку"
+
+msgid "Bogus string"
+msgstr "Фіктивний рядок"
+
+msgid "Forbidden"
+msgstr "Заборонено"
+
+msgid "Key disabled"
+msgstr "Ключ вимкнено"
+
+msgid "Not possible with a card based key"
+msgstr "Неможливе для ключа, заснованого на картці"
+
+msgid "Invalid lock object"
+msgstr "Некоректний об’єкт блокування"
+
+msgid "True"
+msgstr ""
+
+msgid "False"
+msgstr ""
+
+msgid "General IPC error"
+msgstr "Загальна помилка IPC"
+
+msgid "IPC accept call failed"
+msgstr "Помилка виклику прийняття IPC"
+
+msgid "IPC connect call failed"
+msgstr "Помилка з’єднувального виклику IPC"
+
+msgid "Invalid IPC response"
+msgstr "Некоректна відповідь IPC"
+
+msgid "Invalid value passed to IPC"
+msgstr "IPC передано некоректне значення"
+
+msgid "Incomplete line passed to IPC"
+msgstr "IPC передано незавершений рядок"
+
+msgid "Line passed to IPC too long"
+msgstr "Рядок, переданий IPC, є надто довгим"
+
+msgid "Nested IPC commands"
+msgstr "Вкладені команди IPC"
+
+msgid "No data callback in IPC"
+msgstr "Немає зворотного виклику щодо даних у IPC"
+
+msgid "No inquire callback in IPC"
+msgstr "Немає інформаційного зворотного виклику у IPC"
+
+msgid "Not an IPC server"
+msgstr "Не є сервером IPC"
+
+msgid "Not an IPC client"
+msgstr "Не є клієнтом IPC"
+
+msgid "Problem starting IPC server"
+msgstr "Проблеми із запуском сервера IPC"
+
+msgid "IPC read error"
+msgstr "Помилка читання IPC"
+
+msgid "IPC write error"
+msgstr "Помилка запису IPC"
+
+msgid "Too much data for IPC layer"
+msgstr "Забагато даних для шару IPC"
+
+msgid "Unexpected IPC command"
+msgstr "Неочікувана команда IPC"
+
+msgid "Unknown IPC command"
+msgstr "Невідома команда IPC"
+
+msgid "IPC syntax error"
+msgstr "Синтаксична помилка IPC"
+
+msgid "IPC call has been cancelled"
+msgstr "Виклик IPC було скасовано"
+
+msgid "No input source for IPC"
+msgstr "Немає джерела вхідних даних для IPC"
+
+msgid "No output source for IPC"
+msgstr "Немає місця виведення даних для IPC"
+
+msgid "IPC parameter error"
+msgstr "Помилка у параметрі IPC"
+
+msgid "Unknown IPC inquire"
+msgstr "Невідомий запит IPC"
+
+#, fuzzy
+#| msgid "No crypto engine"
+msgid "Crypto engine too old"
+msgstr "Немає рушія шифрування"
+
+msgid "Screen or window too small"
+msgstr ""
+
+msgid "Screen or window too large"
+msgstr ""
+
+msgid "Required environment variable not set"
+msgstr ""
+
+#, fuzzy
+#| msgid "Already exists (LDAP)"
+msgid "User ID already exists"
+msgstr "Вже існує (LDAP)"
+
+#, fuzzy
+#| msgid "Already exists (LDAP)"
+msgid "Name already exists"
+msgstr "Вже існує (LDAP)"
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated name"
+msgstr "Дублювання значення"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Object is too young"
+msgstr "Сертифікат є надто новим"
+
+#, fuzzy
+#| msgid "Provided object is too short"
+msgid "Object is too old"
+msgstr "Наданий об’єкт є надто коротким"
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Unknown flag"
+msgstr "Невідома назва"
+
+#, fuzzy
+#| msgid "Invalid operation code"
+msgid "Invalid execution order"
+msgstr "Некоректний код дії"
+
+msgid "Already fetched"
+msgstr ""
+
+msgid "Try again later"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Wrong name"
+msgstr "Невідома назва"
+
+msgid "System bug detected"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown system error"
+msgid "Unknown DNS error"
+msgstr "Невідома системна помилка"
+
+#, fuzzy
+#| msgid "Invalid OID string"
+msgid "Invalid DNS section"
+msgstr "Некоректний рядок OID"
+
+#, fuzzy
+#| msgid "Invalid S-expression"
+msgid "Invalid textual address form"
+msgstr "Некоректний S-вираз"
+
+#, fuzzy
+#| msgid "Missing issuer certificate"
+msgid "Missing DNS query packet"
+msgstr "Не вистачає сертифіката видавця"
+
+msgid "Missing DNS answer packet"
+msgstr ""
+
+msgid "Connection closed in DNS"
+msgstr ""
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "Verification failed in DNS"
+msgstr "Спроба розшифрування зазнала невдачі"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "DNS Timeout"
+msgstr "Час очікування"
+
+msgid "General LDAP error"
+msgstr "Загальна помилка LDAP"
+
+msgid "General LDAP attribute error"
+msgstr "Загальна помилка атрибута LDAP"
+
+msgid "General LDAP name error"
+msgstr "Загальна помилка назви LDAP"
+
+msgid "General LDAP security error"
+msgstr "Загальна помилка захисту LDAP"
+
+msgid "General LDAP service error"
+msgstr "Загальна помилка служби LDAP"
+
+msgid "General LDAP update error"
+msgstr "Загальна помилка оновлення LDAP"
+
+msgid "Experimental LDAP error code"
+msgstr "Експериментальний код помилки LDAP"
+
+msgid "Private LDAP error code"
+msgstr "Код конфіденційної помилки LDAP"
+
+msgid "Other general LDAP error"
+msgstr "Інша загальна помилка LDAP"
+
+msgid "LDAP connecting failed (X)"
+msgstr "Не вдалося з’єднатися із LDAP (X)"
+
+msgid "LDAP referral limit exceeded"
+msgstr "Перевищення обмежень щодо спрямовування у LDAP"
+
+msgid "LDAP client loop"
+msgstr "Циклічний клієнт LDAP"
+
+msgid "No LDAP results returned"
+msgstr "Не повернуто результатів LDAP"
+
+msgid "LDAP control not found"
+msgstr "Не знайдено керування LDAP"
+
+msgid "Not supported by LDAP"
+msgstr "Не підтримується LDAP"
+
+msgid "LDAP connect error"
+msgstr "Помилка з’єднання LDAP"
+
+msgid "Out of memory in LDAP"
+msgstr "Не вистачає пам’яті у LDAP"
+
+msgid "Bad parameter to an LDAP routine"
+msgstr "Помилковий параметр підпрограми LDAP"
+
+msgid "User cancelled LDAP operation"
+msgstr "Дію LDAP скасовано користувачем"
+
+msgid "Bad LDAP search filter"
+msgstr "Помилковий фільтр пошуку LDAP"
+
+msgid "Unknown LDAP authentication method"
+msgstr "Невідомий спосіб розпізнавання LDAP"
+
+msgid "Timeout in LDAP"
+msgstr "Перевищення часу очікування у LDAP"
+
+msgid "LDAP decoding error"
+msgstr "Помилка декодування LDAP"
+
+msgid "LDAP encoding error"
+msgstr "Помилка кодування LDAP"
+
+msgid "LDAP local error"
+msgstr "Локальна помилка LDAP"
+
+msgid "Cannot contact LDAP server"
+msgstr "Не вдалося встановити зв’язок із сервером LDAP"
+
+msgid "LDAP success"
+msgstr "Успіх LDAP"
+
+msgid "LDAP operations error"
+msgstr "Помилка дій LDAP"
+
+msgid "LDAP protocol error"
+msgstr "Помилка протоколу LDAP"
+
+msgid "Time limit exceeded in LDAP"
+msgstr "Перевищено час очікування у LDAP"
+
+msgid "Size limit exceeded in LDAP"
+msgstr "Перевищено обмеження на розмір у LDAP"
+
+msgid "LDAP compare false"
+msgstr "Порівняння LDAP: не збігаються"
+
+msgid "LDAP compare true"
+msgstr "Порівняння LDAP: збігаються"
+
+msgid "LDAP authentication method not supported"
+msgstr "Підтримки методу розпізнавання LDAP не передбачено"
+
+msgid "Strong(er) LDAP authentication required"
+msgstr "Потрібен потужніший спосіб розпізнавання LDAP"
+
+msgid "Partial LDAP results+referral received"
+msgstr "Отримано часткові результати і спрямування LDAP"
+
+msgid "LDAP referral"
+msgstr "Спрямування LDAP"
+
+msgid "Administrative LDAP limit exceeded"
+msgstr "Перевищено адміністративне обмеження LDAP"
+
+msgid "Critical LDAP extension is unavailable"
+msgstr "Недоступне критичне розширення LDAP"
+
+msgid "Confidentiality required by LDAP"
+msgstr "Конфіденційно потрібне LDAP"
+
+msgid "LDAP SASL bind in progress"
+msgstr "Виконуємо прив’язування SASL LDAP"
+
+msgid "No such LDAP attribute"
+msgstr "Немає такого атрибута LDAP"
+
+msgid "Undefined LDAP attribute type"
+msgstr "Невизначний тип атрибута LDAP"
+
+msgid "Inappropriate matching in LDAP"
+msgstr "Неприйнятна відповідність у LDAP"
+
+msgid "Constraint violation in LDAP"
+msgstr "Порушення обмежень у LDAP"
+
+msgid "LDAP type or value exists"
+msgstr "Тип або значення LDAP існує"
+
+msgid "Invalid syntax in LDAP"
+msgstr "Некоректний синтаксис у LDAP"
+
+msgid "No such LDAP object"
+msgstr "Немає такого об’єкта LDAP"
+
+msgid "LDAP alias problem"
+msgstr "Проблема псевдоніма LDAP"
+
+msgid "Invalid DN syntax in LDAP"
+msgstr "Некоректний синтаксис DN у LDAP"
+
+msgid "LDAP entry is a leaf"
+msgstr "Запис LDAP є листком"
+
+msgid "LDAP alias dereferencing problem"
+msgstr "Проблемі з скасування прив’язки псевдоніма LDAP"
+
+msgid "LDAP proxy authorization failure (X)"
+msgstr "Помилка уповноваження проксі LDAP (X)"
+
+msgid "Inappropriate LDAP authentication"
+msgstr "Неприйнятне розпізнавання LDAP"
+
+msgid "Invalid LDAP credentials"
+msgstr "Некоректні реєстраційні дані LDAP"
+
+msgid "Insufficient access for LDAP"
+msgstr "Недостатні права доступу до LDAP"
+
+msgid "LDAP server is busy"
+msgstr "Сервер LDAP зайнято виконанням завдання"
+
+msgid "LDAP server is unavailable"
+msgstr "Сервер LDAP недоступний"
+
+msgid "LDAP server is unwilling to perform"
+msgstr "Сервер LDAP не бажає працювати"
+
+msgid "Loop detected by LDAP"
+msgstr "LDAP виявлено цикл"
+
+msgid "LDAP naming violation"
+msgstr "Порушення іменування LDAP"
+
+msgid "LDAP object class violation"
+msgstr "Порушення класу об’єктів LDAP"
+
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "Дію LDAP не дозволено для об’єктів, які не є листками"
+
+msgid "LDAP operation not allowed on RDN"
+msgstr "Дію LDAP не дозволено над RDN"
+
+msgid "Already exists (LDAP)"
+msgstr "Вже існує (LDAP)"
+
+msgid "Cannot modify LDAP object class"
+msgstr "Не вдалося змінити клас об’єкта LDAP"
+
+msgid "LDAP results too large"
+msgstr "Результати LDAP є надто великими"
+
+msgid "LDAP operation affects multiple DSAs"
+msgstr "Дія LDAP стосується декількох DSA"
+
+msgid "Virtual LDAP list view error"
+msgstr "Помилка перегляду списку віртуальної LDAP"
+
+msgid "Other LDAP error"
+msgstr "Інша помилка LDAP"
+
+msgid "Resources exhausted in LCUP"
+msgstr "Вичерпано ресурси у LCUP"
+
+msgid "Security violation in LCUP"
+msgstr "Порушення захисту у LCUP"
+
+msgid "Invalid data in LCUP"
+msgstr "Некоректні дані у LCUP"
+
+msgid "Unsupported scheme in LCUP"
+msgstr "Непідтримувана схема у LCUP"
+
+msgid "Reload required in LCUP"
+msgstr "Потрібне перезавантаження у LCUP"
+
+msgid "LDAP cancelled"
+msgstr "LDAP скасовано"
+
+msgid "No LDAP operation to cancel"
+msgstr "Немає дії LDAP для скасовування"
+
+msgid "Too late to cancel LDAP"
+msgstr "Запізно для скасовування LDAP"
+
+msgid "Cannot cancel LDAP"
+msgstr "Не вдалося скасувати LDAP"
+
+msgid "LDAP assertion failed"
+msgstr "Помилка оцінки LDAP"
+
+msgid "Proxied authorization denied by LDAP"
+msgstr "Уповноваження за допомогою проксі заборонено LDAP"
+
+msgid "User defined error code 1"
+msgstr "Визначений користувачем код помилки 1"
+
+msgid "User defined error code 2"
+msgstr "Визначений користувачем код помилки 2"
+
+msgid "User defined error code 3"
+msgstr "Визначений користувачем код помилки 3"
+
+msgid "User defined error code 4"
+msgstr "Визначений користувачем код помилки 4"
+
+msgid "User defined error code 5"
+msgstr "Визначений користувачем код помилки 5"
+
+msgid "User defined error code 6"
+msgstr "Визначений користувачем код помилки 6"
+
+msgid "User defined error code 7"
+msgstr "Визначений користувачем код помилки 7"
+
+msgid "User defined error code 8"
+msgstr "Визначений користувачем код помилки 8"
+
+msgid "User defined error code 9"
+msgstr "Визначений користувачем код помилки 9"
+
+msgid "User defined error code 10"
+msgstr "Визначений користувачем код помилки 10"
+
+msgid "User defined error code 11"
+msgstr "Визначений користувачем код помилки 11"
+
+msgid "User defined error code 12"
+msgstr "Визначений користувачем код помилки 12"
+
+msgid "User defined error code 13"
+msgstr "Визначений користувачем код помилки 13"
+
+msgid "User defined error code 14"
+msgstr "Визначений користувачем код помилки 14"
+
+msgid "User defined error code 15"
+msgstr "Визначений користувачем код помилки 15"
+
+msgid "User defined error code 16"
+msgstr "Визначений користувачем код помилки 16"
+
+msgid "System error w/o errno"
+msgstr "Системна помилка без номера"
+
+msgid "Unknown system error"
+msgstr "Невідома системна помилка"
+
+msgid "End of file"
+msgstr "Кінець файла"
+
+msgid "Unknown error code"
+msgstr "Помилка з невідомим кодом"
+
+#, c-format
+msgid "Usage: %s GPG-ERROR [...]\n"
+msgstr "Користування: %s ПОМИЛКА-GPG [...]\n"
+
+#, c-format
+msgid "%s: warning: could not recognize %s\n"
+msgstr "%s: попередження: не вдалося розпізнати %s\n"
+
+#, fuzzy
+#~| msgid "Resources exhausted"
+#~ msgid "LCUP Resources exhausted"
+#~ msgstr "Вичерпано ресурси"
+
+#, fuzzy
+#~| msgid "Invalid data"
+#~ msgid "LCUP Invalid data"
+#~ msgstr "Некоректні дані"
+
+#, fuzzy
+#~| msgid "General error"
+#~ msgid "LDAP Other general error"
+#~ msgstr "Загальна помилка"
+
+#, fuzzy
+#~| msgid "dirmngr error"
+#~ msgid "Encoding error"
+#~ msgstr "Помилка dirmngr"
diff --git a/po/vi.po b/po/vi.po
new file mode 100644
index 0000000..da067f4
--- /dev/null
+++ b/po/vi.po
@@ -0,0 +1,1516 @@
+# Vietnamese translation for Lib. GPG Error.
+# Copyright © 2009 Free Software Foundation, Inc.
+# This file is distributed under the same license as the libgpg-error package.
+# Clytie Siddall <[email protected]>, 2006-2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: libgpg-error 1.7\n"
+"Report-Msgid-Bugs-To: [email protected]\n"
+"PO-Revision-Date: 2013-02-23 20:10+0100\n"
+"Last-Translator: Clytie Siddall <[email protected]>\n"
+"Language-Team: Vietnamese <[email protected]>\n"
+"Language: vi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+"X-Generator: LocFactoryEditor 1.8\n"
+
+msgid "Unspecified source"
+msgstr "Nguồn chưa ghi rõ"
+
+msgid "gcrypt"
+msgstr "gcrypt"
+
+msgid "GnuPG"
+msgstr "GnuPG"
+
+msgid "GpgSM"
+msgstr "GpgSM"
+
+msgid "GPG Agent"
+msgstr "Tác nhân GPG"
+
+msgid "Pinentry"
+msgstr "Pinentry"
+
+msgid "SCD"
+msgstr "SCD"
+
+msgid "GPGME"
+msgstr "GPGME"
+
+msgid "Keybox"
+msgstr "Keybox"
+
+msgid "KSBA"
+msgstr "KSBA"
+
+msgid "Dirmngr"
+msgstr "Dirmngr"
+
+msgid "GSTI"
+msgstr "GSTI"
+
+msgid "GPA"
+msgstr "GPA"
+
+msgid "Kleopatra"
+msgstr "Kleopatra"
+
+msgid "G13"
+msgstr "G13"
+
+msgid "Assuan"
+msgstr "Assuan"
+
+msgid "TLS"
+msgstr ""
+
+msgid "Any source"
+msgstr "Bất cứ nguồn nào"
+
+msgid "User defined source 1"
+msgstr "Nguồn tự xác định 1"
+
+msgid "User defined source 2"
+msgstr "Nguồn tự xác định 2"
+
+msgid "User defined source 3"
+msgstr "Nguồn tự xác định 3"
+
+msgid "User defined source 4"
+msgstr "Nguồn tự xác định 4"
+
+msgid "Unknown source"
+msgstr "Nguồn không rõ"
+
+msgid "Success"
+msgstr "Thành công"
+
+msgid "General error"
+msgstr "Lỗi chung"
+
+msgid "Unknown packet"
+msgstr "Gói tin không rõ"
+
+msgid "Unknown version in packet"
+msgstr "Gặp phiên bản không rõ trong gói tin"
+
+msgid "Invalid public key algorithm"
+msgstr "Thuật toán khoá công không hợp lệ"
+
+msgid "Invalid digest algorithm"
+msgstr "Thuật toán bộ tóm tắt (digest) không hợp lệ"
+
+msgid "Bad public key"
+msgstr "Khoá công sai"
+
+msgid "Bad secret key"
+msgstr "Khoá bí mật sai"
+
+msgid "Bad signature"
+msgstr "Chữ ký sai"
+
+msgid "No public key"
+msgstr "Không có khoá công"
+
+msgid "Checksum error"
+msgstr "Lỗi tổng kiểm tra"
+
+msgid "Bad passphrase"
+msgstr "Cụm từ mật khẩu sai"
+
+msgid "Invalid cipher algorithm"
+msgstr "Thuật toán mật mã không hợp lệ"
+
+msgid "Cannot open keyring"
+msgstr "Vòng khoá đã mở"
+
+msgid "Invalid packet"
+msgstr "Gói tin không hợp lệ"
+
+msgid "Invalid armor"
+msgstr "Bọc sắt không hợp lệ"
+
+msgid "No user ID"
+msgstr "Không có mã số người dùng"
+
+msgid "No secret key"
+msgstr "Không có khoá bí mật"
+
+msgid "Wrong secret key used"
+msgstr "Đã dùng khoá bí mật không đúng"
+
+msgid "Bad session key"
+msgstr "Khoá buổi hợp sai"
+
+msgid "Unknown compression algorithm"
+msgstr "Thuật toán nén không rõ"
+
+msgid "Number is not prime"
+msgstr "Số không phải nguyên tố"
+
+msgid "Invalid encoding method"
+msgstr "Phương pháp mã hoá không hợp lệ"
+
+msgid "Invalid encryption scheme"
+msgstr "Lược đồ mật mã hoá không hợp lệ"
+
+msgid "Invalid signature scheme"
+msgstr "Lược đồ chữ ký không hợp lệ"
+
+msgid "Invalid attribute"
+msgstr "Thuộc tính không hợp lệ"
+
+msgid "No value"
+msgstr "Không có giá trị"
+
+msgid "Not found"
+msgstr "Không tìm thấy"
+
+msgid "Value not found"
+msgstr "Không tìm thấy giá trị"
+
+msgid "Syntax error"
+msgstr "Lỗi cú pháp"
+
+msgid "Bad MPI value"
+msgstr "Giá trị MPI sai"
+
+msgid "Invalid passphrase"
+msgstr "Cụm từ mật khẩu không hợp lệ"
+
+msgid "Invalid signature class"
+msgstr "Hạng chữ ký không hợp lệ"
+
+msgid "Resources exhausted"
+msgstr "Cạn tài nguyên"
+
+msgid "Invalid keyring"
+msgstr "Vòng khoá không hợp lệ"
+
+msgid "Trust DB error"
+msgstr "Lỗi CSDL tin cậy"
+
+msgid "Bad certificate"
+msgstr "Chứng nhận sai"
+
+msgid "Invalid user ID"
+msgstr "Mã số người dùng không hợp lệ"
+
+msgid "Unexpected error"
+msgstr "Gặp lỗi bất thường"
+
+msgid "Time conflict"
+msgstr "Giờ xung đột"
+
+msgid "Keyserver error"
+msgstr "Lỗi máy phục vụ khoá"
+
+msgid "Wrong public key algorithm"
+msgstr "Thuật toán khoá công không đúng"
+
+msgid "Tribute to D. A."
+msgstr "Cống cho D. A."
+
+msgid "Weak encryption key"
+msgstr "Khoá mật mã yếu"
+
+msgid "Invalid key length"
+msgstr "Chiều dài khoá không hợp lệ"
+
+msgid "Invalid argument"
+msgstr "Đối số không hợp lệ"
+
+msgid "Syntax error in URI"
+msgstr "Lỗi cú pháp trong URI"
+
+msgid "Invalid URI"
+msgstr "URI không hợp lệ"
+
+msgid "Network error"
+msgstr "Lỗi chạy mạng"
+
+msgid "Unknown host"
+msgstr "Không nhận ra máy chủ"
+
+msgid "Selftest failed"
+msgstr "Lỗi tự thử"
+
+msgid "Data not encrypted"
+msgstr "Chưa mật mã dữ liệu"
+
+msgid "Data not processed"
+msgstr "Chưa xử lý dữ liệu"
+
+msgid "Unusable public key"
+msgstr "Khoá công vô ích"
+
+msgid "Unusable secret key"
+msgstr "Khoá bí mật vô ích"
+
+msgid "Invalid value"
+msgstr "Giá trị không hợp lệ"
+
+msgid "Bad certificate chain"
+msgstr "Dây chứng nhận sai"
+
+msgid "Missing certificate"
+msgstr "Chứng nhận còn thiếu"
+
+msgid "No data"
+msgstr "Không có dữ liệu"
+
+msgid "Bug"
+msgstr "Lỗi"
+
+msgid "Not supported"
+msgstr "Không được hỗ trợ"
+
+msgid "Invalid operation code"
+msgstr "Mã thao tác không hợp lệ"
+
+msgid "Timeout"
+msgstr "Quá giờ"
+
+msgid "Internal error"
+msgstr "Lỗi nội bộ"
+
+msgid "EOF (gcrypt)"
+msgstr "Kết thúc tập tin (gcrypt)"
+
+msgid "Invalid object"
+msgstr "Đối tượng không hợp lệ"
+
+msgid "Provided object is too short"
+msgstr "Đã cung cấp một đối tượng quá ngắn"
+
+msgid "Provided object is too large"
+msgstr "Đã cung cấp một đối tượng quá lớn"
+
+msgid "Missing item in object"
+msgstr "Thiếu mục trong đối tượng"
+
+msgid "Not implemented"
+msgstr "Không được thực hiện"
+
+msgid "Conflicting use"
+msgstr "Cách sử dụng xung đột"
+
+msgid "Invalid cipher mode"
+msgstr "Chế độ mật mã không hợp lệ"
+
+msgid "Invalid flag"
+msgstr "Cờ không hợp lệ"
+
+msgid "Invalid handle"
+msgstr "Bộ quản lý không hợp lệ"
+
+msgid "Result truncated"
+msgstr "Kết quả bị cắt ngắn"
+
+msgid "Incomplete line"
+msgstr "Dòng không hoàn toàn"
+
+msgid "Invalid response"
+msgstr "Đáp ứng không hợp lệ"
+
+msgid "No agent running"
+msgstr "Không có tác nhân đang chạy"
+
+#, fuzzy
+#| msgid "agent error"
+msgid "Agent error"
+msgstr "lỗi tác nhân"
+
+msgid "Invalid data"
+msgstr "Dữ liệu không hợp lệ"
+
+msgid "Unspecific Assuan server fault"
+msgstr "Lỗi máy phục vụ Assuan chung"
+
+msgid "General Assuan error"
+msgstr "Lỗi Assuan chung"
+
+msgid "Invalid session key"
+msgstr "Khoá buổi hợp không hợp lệ"
+
+msgid "Invalid S-expression"
+msgstr "Biểu thức S không hợp lệ"
+
+msgid "Unsupported algorithm"
+msgstr "Thuật toán không được hỗ trợ"
+
+msgid "No pinentry"
+msgstr "Không có pinentry"
+
+msgid "pinentry error"
+msgstr "Lỗi pinentry"
+
+msgid "Bad PIN"
+msgstr "PIN sai"
+
+msgid "Invalid name"
+msgstr "Tên không hợp lệ"
+
+msgid "Bad data"
+msgstr "Dữ liệu sai"
+
+msgid "Invalid parameter"
+msgstr "Tham số không hợp lệ"
+
+msgid "Wrong card"
+msgstr "Thẻ không đúng"
+
+msgid "No dirmngr"
+msgstr "Không có dirmngr"
+
+msgid "dirmngr error"
+msgstr "Lỗi dirmngr"
+
+msgid "Certificate revoked"
+msgstr "Chứng nhận bị thu hồi"
+
+msgid "No CRL known"
+msgstr "Không co CRL đã biết"
+
+msgid "CRL too old"
+msgstr "CRL quá cũ"
+
+msgid "Line too long"
+msgstr "Dòng quá dài"
+
+msgid "Not trusted"
+msgstr "Không tin cậy"
+
+msgid "Operation cancelled"
+msgstr "Thao tác bị hủy bỏ"
+
+msgid "Bad CA certificate"
+msgstr "Chứng nhận CA (nhà cầm quyền chứng nhận) sai"
+
+msgid "Certificate expired"
+msgstr "Chứng nhận đã hết hạn"
+
+msgid "Certificate too young"
+msgstr "Chứng nhận quá mới"
+
+msgid "Unsupported certificate"
+msgstr "Chứng nhận không được hỗ trợ"
+
+msgid "Unknown S-expression"
+msgstr "Biểu thức S không rõ"
+
+msgid "Unsupported protection"
+msgstr "Sự bảo vệ không được hỗ trợ"
+
+msgid "Corrupted protection"
+msgstr "Sự bảo vệ bị hỏng"
+
+msgid "Ambiguous name"
+msgstr "Tên mờ hồ"
+
+msgid "Card error"
+msgstr "Lỗi thẻ"
+
+msgid "Card reset required"
+msgstr "Cần thiết lập lại thẻ"
+
+msgid "Card removed"
+msgstr "Thẻ bị gỡ bỏ"
+
+msgid "Invalid card"
+msgstr "Thẻ không hợp lệ"
+
+msgid "Card not present"
+msgstr "Không có thẻ"
+
+msgid "No PKCS15 application"
+msgstr "Không có ứng dụng PKCS15"
+
+msgid "Not confirmed"
+msgstr "Chưa xác nhận"
+
+msgid "Configuration error"
+msgstr "Lỗi cấu hình"
+
+msgid "No policy match"
+msgstr "Không có chính sách tương ứng"
+
+msgid "Invalid index"
+msgstr "Chỉ mục không hợp lệ"
+
+msgid "Invalid ID"
+msgstr "Mã số không hợp lệ"
+
+msgid "No SmartCard daemon"
+msgstr "Không có trình nền Thẻ Khéo"
+
+msgid "SmartCard daemon error"
+msgstr "Lỗi trình nền Thẻ Khéo"
+
+msgid "Unsupported protocol"
+msgstr "Giao thức không được hỗ trợ"
+
+msgid "Bad PIN method"
+msgstr "Phương pháp PIN sai"
+
+msgid "Card not initialized"
+msgstr "Chưa sơ khởi thẻ"
+
+msgid "Unsupported operation"
+msgstr "Thao tác không được hỗ trợ"
+
+msgid "Wrong key usage"
+msgstr "Sai dùng khoá"
+
+msgid "Nothing found"
+msgstr "Không tìm thấy"
+
+msgid "Wrong blob type"
+msgstr "Sai kiểu blob"
+
+msgid "Missing value"
+msgstr "Thiếu giá trị"
+
+msgid "Hardware problem"
+msgstr "Lỗi phần cứng"
+
+msgid "PIN blocked"
+msgstr "PIN bị chặn"
+
+msgid "Conditions of use not satisfied"
+msgstr "Chưa thỏa mãn các điều kiện dùng"
+
+msgid "PINs are not synced"
+msgstr "Các PIN chưa đồng bộ"
+
+msgid "Invalid CRL"
+msgstr "CRL không hợp lệ"
+
+msgid "BER error"
+msgstr "Lỗi BER"
+
+msgid "Invalid BER"
+msgstr "BER không hợp lệ"
+
+msgid "Element not found"
+msgstr "Không tìm thấy phần tử"
+
+msgid "Identifier not found"
+msgstr "Không tìm thấy bộ nhận diện"
+
+msgid "Invalid tag"
+msgstr "Thẻ (tag) không hợp lệ"
+
+msgid "Invalid length"
+msgstr "Chiều dài không hợp lệ"
+
+msgid "Invalid key info"
+msgstr "Thông tin khoá không hợp lệ"
+
+msgid "Unexpected tag"
+msgstr "Thẻ (tag) bất thường"
+
+msgid "Not DER encoded"
+msgstr "Không phải mã hoá DER"
+
+msgid "No CMS object"
+msgstr "Không có đối tượng CMS"
+
+msgid "Invalid CMS object"
+msgstr "Đối tượng CMS không hợp lệ"
+
+msgid "Unknown CMS object"
+msgstr "Đối tượng CMS không rõ"
+
+msgid "Unsupported CMS object"
+msgstr "Đối tượng CMS không được hỗ trợ"
+
+msgid "Unsupported encoding"
+msgstr "Bảng mã không được hỗ trợ"
+
+msgid "Unsupported CMS version"
+msgstr "Phiên bản CMS không được hỗ trợ"
+
+msgid "Unknown algorithm"
+msgstr "Thuật toán không rõ"
+
+msgid "Invalid crypto engine"
+msgstr "Cơ chế mật mã không hợp lệ"
+
+msgid "Public key not trusted"
+msgstr "Khoá công không tin cậy"
+
+msgid "Decryption failed"
+msgstr "Lỗi giải mật mã"
+
+msgid "Key expired"
+msgstr "Khoá hết hạn"
+
+msgid "Signature expired"
+msgstr "Chữ ký hết hạn"
+
+msgid "Encoding problem"
+msgstr "Lỗi mã hoá"
+
+msgid "Invalid state"
+msgstr "Tình trạng không hợp lệ"
+
+msgid "Duplicated value"
+msgstr "Giá trị trùng"
+
+msgid "Missing action"
+msgstr "Thiếu hành động"
+
+msgid "ASN.1 module not found"
+msgstr "Không tìm thấy mô-đun ASN.1"
+
+msgid "Invalid OID string"
+msgstr "Chuỗi OID không hợp lệ"
+
+msgid "Invalid time"
+msgstr "Thời gian không hợp lệ"
+
+msgid "Invalid CRL object"
+msgstr "Đối tượng CRL không hợp lệ"
+
+msgid "Unsupported CRL version"
+msgstr "Phiên bản CRL không được hỗ trợ"
+
+msgid "Invalid certificate object"
+msgstr "Đối tượng chứng nhận không hợp lệ"
+
+msgid "Unknown name"
+msgstr "Tên không rõ"
+
+msgid "A locale function failed"
+msgstr "Một hàm miền địa phương bị lỗi"
+
+msgid "Not locked"
+msgstr "Không phải bị khoá"
+
+msgid "Protocol violation"
+msgstr "Vi phạm giao thức"
+
+msgid "Invalid MAC"
+msgstr "MAC không hợp lệ"
+
+msgid "Invalid request"
+msgstr "Yêu cầu không hợp lệ"
+
+msgid "Unknown extension"
+msgstr "Phần mở rộng không rõ"
+
+msgid "Unknown critical extension"
+msgstr "Phần mở rộng nghiêm trọng không rõ"
+
+msgid "Locked"
+msgstr "Bị khoá"
+
+msgid "Unknown option"
+msgstr "Tùy chọn không rõ"
+
+msgid "Unknown command"
+msgstr "Lệnh không rõ"
+
+msgid "Not operational"
+msgstr "Không hoạt động được"
+
+msgid "No passphrase given"
+msgstr "Chưa đưa ra cụm từ mật khẩu"
+
+msgid "No PIN given"
+msgstr "Chưa đưa ra số cá nhân PIN"
+
+#, fuzzy
+msgid "Not enabled"
+msgstr "Không phải bị khoá"
+
+#, fuzzy
+msgid "No crypto engine"
+msgstr "Cơ chế mật mã không hợp lệ"
+
+#, fuzzy
+msgid "Missing key"
+msgstr "Thiếu giá trị"
+
+#, fuzzy
+msgid "Too many objects"
+msgstr "Không có đối tượng CMS"
+
+msgid "Limit reached"
+msgstr ""
+
+#, fuzzy
+msgid "Not initialized"
+msgstr "Chưa sơ khởi thẻ"
+
+#, fuzzy
+msgid "Missing issuer certificate"
+msgstr "Chứng nhận còn thiếu"
+
+msgid "No keyserver available"
+msgstr ""
+
+#, fuzzy
+msgid "Invalid elliptic curve"
+msgstr "Thời gian không hợp lệ"
+
+#, fuzzy
+msgid "Unknown elliptic curve"
+msgstr "Nguồn không rõ"
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated key"
+msgstr "Giá trị trùng"
+
+#, fuzzy
+#| msgid "Ambiguous name"
+msgid "Ambiguous result"
+msgstr "Tên mờ hồ"
+
+#, fuzzy
+msgid "No crypto context"
+msgstr "Cơ chế mật mã không hợp lệ"
+
+#, fuzzy
+msgid "Wrong crypto context"
+msgstr "Cơ chế mật mã không hợp lệ"
+
+#, fuzzy
+#| msgid "Invalid crypto engine"
+msgid "Bad crypto context"
+msgstr "Cơ chế mật mã không hợp lệ"
+
+msgid "Conflict in the crypto context"
+msgstr ""
+
+#, fuzzy
+#| msgid "No public key"
+msgid "Broken public key"
+msgstr "Không có khoá công"
+
+#, fuzzy
+#| msgid "No secret key"
+msgid "Broken secret key"
+msgstr "Không có khoá bí mật"
+
+#, fuzzy
+#| msgid "Invalid digest algorithm"
+msgid "Invalid MAC algorithm"
+msgstr "Thuật toán bộ tóm tắt (digest) không hợp lệ"
+
+#, fuzzy
+msgid "Operation fully cancelled"
+msgstr "Thao tác bị hủy bỏ"
+
+msgid "Operation not yet finished"
+msgstr "Thao tác chưa kết thúc"
+
+msgid "Buffer too short"
+msgstr "Vùng đệm quá ngắn"
+
+msgid "Invalid length specifier in S-expression"
+msgstr "Chỉ thị chiều dài không hợp lệ trong biểu thức S"
+
+msgid "String too long in S-expression"
+msgstr "Chuỗi quá dài trong biểu thức S"
+
+msgid "Unmatched parentheses in S-expression"
+msgstr "Có dấu ngoặc chưa khớp trong biểu thức S"
+
+msgid "S-expression not canonical"
+msgstr "Biểu thức S không phải chuẩn tắc"
+
+msgid "Bad character in S-expression"
+msgstr "Ký tự sai trong biểu thức S"
+
+msgid "Bad quotation in S-expression"
+msgstr "Đoạn trích dẫn sai trong biểu thức S"
+
+msgid "Zero prefix in S-expression"
+msgstr "Tiền tố số không trong biểu thức S"
+
+msgid "Nested display hints in S-expression"
+msgstr "Có mẹo trình bày lồng nhau trong biểu thức S"
+
+msgid "Unmatched display hints"
+msgstr "Có mẹo trình bày chưa khớp"
+
+msgid "Unexpected reserved punctuation in S-expression"
+msgstr "Có dấu chấm câu dành riêng bất thường trong biểu thức S"
+
+msgid "Bad hexadecimal character in S-expression"
+msgstr "Ký tự thập lục sai trong biểu thức S"
+
+msgid "Odd hexadecimal numbers in S-expression"
+msgstr "Có số thập lục lẻ trong biểu thức S"
+
+#, fuzzy
+msgid "Bad octal character in S-expression"
+msgstr "Ký tự bát phân sai trong biểu thức S"
+
+msgid "All subkeys are expired or revoked"
+msgstr ""
+
+#, fuzzy
+#| msgid "Data not encrypted"
+msgid "Database is corrupted"
+msgstr "Chưa mật mã dữ liệu"
+
+msgid "Server indicated a failure"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "No name"
+msgstr "Tên không rõ"
+
+#, fuzzy
+#| msgid "No public key"
+msgid "No key"
+msgstr "Không có khoá công"
+
+msgid "Legacy key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Buffer too short"
+msgid "Request too short"
+msgstr "Vùng đệm quá ngắn"
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "Request too long"
+msgstr "Dòng quá dài"
+
+msgid "Object is in termination state"
+msgstr ""
+
+#, fuzzy
+#| msgid "Bad certificate chain"
+msgid "No certificate chain"
+msgstr "Dây chứng nhận sai"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Certificate is too large"
+msgstr "Chứng nhận quá mới"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid record"
+msgstr "Thẻ không hợp lệ"
+
+msgid "The MAC does not verify"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unexpected tag"
+msgid "Unexpected message"
+msgstr "Thẻ (tag) bất thường"
+
+msgid "Compression or decompression failed"
+msgstr ""
+
+msgid "A counter would wrap"
+msgstr ""
+
+msgid "Fatal alert message received"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid cipher algorithm"
+msgid "No cipher algorithm"
+msgstr "Thuật toán mật mã không hợp lệ"
+
+#, fuzzy
+msgid "Missing client certificate"
+msgstr "Chứng nhận còn thiếu"
+
+#, fuzzy
+#| msgid "Certificate revoked"
+msgid "Close notification received"
+msgstr "Chứng nhận bị thu hồi"
+
+#, fuzzy
+#| msgid "Key expired"
+msgid "Ticket expired"
+msgstr "Khoá hết hạn"
+
+#, fuzzy
+#| msgid "Bad public key"
+msgid "Bad ticket"
+msgstr "Khoá công sai"
+
+#, fuzzy
+#| msgid "Unknown packet"
+msgid "Unknown identity"
+msgstr "Gói tin không rõ"
+
+#, fuzzy
+#| msgid "Bad certificate chain"
+msgid "Bad certificate message in handshake"
+msgstr "Dây chứng nhận sai"
+
+msgid "Bad certificate request message in handshake"
+msgstr ""
+
+msgid "Bad certificate verify message in handshake"
+msgstr ""
+
+msgid "Bad change cipher message in handshake"
+msgstr ""
+
+msgid "Bad client hello message in handshake"
+msgstr ""
+
+msgid "Bad server hello message in handshake"
+msgstr ""
+
+msgid "Bad server hello done message in handshake"
+msgstr ""
+
+msgid "Bad finished message in handshake"
+msgstr ""
+
+msgid "Bad server key exchange message in handshake"
+msgstr ""
+
+msgid "Bad client key exchange message in handshake"
+msgstr ""
+
+msgid "Bogus string"
+msgstr ""
+
+msgid "Forbidden"
+msgstr ""
+
+#, fuzzy
+#| msgid "Key expired"
+msgid "Key disabled"
+msgstr "Khoá hết hạn"
+
+msgid "Not possible with a card based key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid object"
+msgid "Invalid lock object"
+msgstr "Đối tượng không hợp lệ"
+
+msgid "True"
+msgstr ""
+
+msgid "False"
+msgstr ""
+
+msgid "General IPC error"
+msgstr "Lỗi IPC chung"
+
+msgid "IPC accept call failed"
+msgstr "Lời gọi chấp nhận IPC bị lỗi"
+
+msgid "IPC connect call failed"
+msgstr "Lời gọi kết nối IPC bị lỗi"
+
+msgid "Invalid IPC response"
+msgstr "Đáp ứng IPC không hợp lệ"
+
+msgid "Invalid value passed to IPC"
+msgstr "Giá trị không hợp lệ được gửi cho IPC"
+
+msgid "Incomplete line passed to IPC"
+msgstr "Dòng không hoàn toàn được gửi cho IPC"
+
+msgid "Line passed to IPC too long"
+msgstr "Dòng quá dài được gửi cho IPC"
+
+msgid "Nested IPC commands"
+msgstr "Các câu lệnh IPC lồng nhau"
+
+msgid "No data callback in IPC"
+msgstr "Không có lời gọi ngược lại dữ liệu trong IPC"
+
+msgid "No inquire callback in IPC"
+msgstr "Không có lời gọi ngược lại yêu cầu trong IPC"
+
+msgid "Not an IPC server"
+msgstr "Không phải trình phục vụ IPC"
+
+msgid "Not an IPC client"
+msgstr "Không phải ứng dụng khách IPC"
+
+msgid "Problem starting IPC server"
+msgstr "Gặp khó khăn trong việc khởi chạy trình phục vụ IPC"
+
+msgid "IPC read error"
+msgstr "Lỗi đọc IPC"
+
+msgid "IPC write error"
+msgstr "Lỗi ghi IPC"
+
+msgid "Too much data for IPC layer"
+msgstr "Quá nhiều dữ liệu cho lớp IPC"
+
+msgid "Unexpected IPC command"
+msgstr "Câu lệnh IPC bất thường"
+
+msgid "Unknown IPC command"
+msgstr "Câu lệnh IPC không rõ"
+
+msgid "IPC syntax error"
+msgstr "Lỗi cú pháp IPC"
+
+msgid "IPC call has been cancelled"
+msgstr "Lời gọi IPC bị thôi"
+
+msgid "No input source for IPC"
+msgstr "Không có nguồn nhập vào cho IPC"
+
+msgid "No output source for IPC"
+msgstr "Không có nguồn kết xuất cho IPC"
+
+msgid "IPC parameter error"
+msgstr "Lỗi tham số IPC"
+
+msgid "Unknown IPC inquire"
+msgstr "Yêu cầu IPC không rõ"
+
+#, fuzzy
+msgid "Crypto engine too old"
+msgstr "Cơ chế mật mã không hợp lệ"
+
+msgid "Screen or window too small"
+msgstr ""
+
+msgid "Screen or window too large"
+msgstr ""
+
+msgid "Required environment variable not set"
+msgstr ""
+
+msgid "User ID already exists"
+msgstr ""
+
+msgid "Name already exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated name"
+msgstr "Giá trị trùng"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Object is too young"
+msgstr "Chứng nhận quá mới"
+
+#, fuzzy
+#| msgid "Provided object is too short"
+msgid "Object is too old"
+msgstr "Đã cung cấp một đối tượng quá ngắn"
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Unknown flag"
+msgstr "Tên không rõ"
+
+#, fuzzy
+#| msgid "Invalid operation code"
+msgid "Invalid execution order"
+msgstr "Mã thao tác không hợp lệ"
+
+msgid "Already fetched"
+msgstr ""
+
+msgid "Try again later"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Wrong name"
+msgstr "Tên không rõ"
+
+msgid "System bug detected"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown system error"
+msgid "Unknown DNS error"
+msgstr "Gặp lỗi hệ thống không rõ"
+
+#, fuzzy
+#| msgid "Invalid OID string"
+msgid "Invalid DNS section"
+msgstr "Chuỗi OID không hợp lệ"
+
+#, fuzzy
+#| msgid "Invalid S-expression"
+msgid "Invalid textual address form"
+msgstr "Biểu thức S không hợp lệ"
+
+#, fuzzy
+msgid "Missing DNS query packet"
+msgstr "Chứng nhận còn thiếu"
+
+msgid "Missing DNS answer packet"
+msgstr ""
+
+msgid "Connection closed in DNS"
+msgstr ""
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "Verification failed in DNS"
+msgstr "Lỗi giải mật mã"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "DNS Timeout"
+msgstr "Quá giờ"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "General LDAP error"
+msgstr "Lỗi IPC chung"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP attribute error"
+msgstr "Lỗi chung"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP name error"
+msgstr "Lỗi chung"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP security error"
+msgstr "Lỗi Assuan chung"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP service error"
+msgstr "Lỗi chung"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP update error"
+msgstr "Lỗi Assuan chung"
+
+msgid "Experimental LDAP error code"
+msgstr ""
+
+#, fuzzy
+#| msgid "IPC write error"
+msgid "Private LDAP error code"
+msgstr "Lỗi ghi IPC"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other general LDAP error"
+msgstr "Lỗi IPC chung"
+
+#, fuzzy
+#| msgid "IPC connect call failed"
+msgid "LDAP connecting failed (X)"
+msgstr "Lời gọi kết nối IPC bị lỗi"
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral limit exceeded"
+msgstr "Lỗi chung"
+
+msgid "LDAP client loop"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "No LDAP results returned"
+msgstr "Cần thiết lập lại thẻ"
+
+#, fuzzy
+#| msgid "Element not found"
+msgid "LDAP control not found"
+msgstr "Không tìm thấy phần tử"
+
+#, fuzzy
+#| msgid "Not supported"
+msgid "Not supported by LDAP"
+msgstr "Không được hỗ trợ"
+
+#, fuzzy
+#| msgid "Unexpected error"
+msgid "LDAP connect error"
+msgstr "Gặp lỗi bất thường"
+
+msgid "Out of memory in LDAP"
+msgstr ""
+
+msgid "Bad parameter to an LDAP routine"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported operation"
+msgid "User cancelled LDAP operation"
+msgstr "Thao tác không được hỗ trợ"
+
+#, fuzzy
+#| msgid "Bad certificate"
+msgid "Bad LDAP search filter"
+msgstr "Chứng nhận sai"
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "Unknown LDAP authentication method"
+msgstr "Phần mở rộng không rõ"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "Timeout in LDAP"
+msgstr "Quá giờ"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP decoding error"
+msgstr "Lỗi dirmngr"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP encoding error"
+msgstr "Lỗi dirmngr"
+
+#, fuzzy
+#| msgid "IPC read error"
+msgid "LDAP local error"
+msgstr "Lỗi đọc IPC"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot contact LDAP server"
+msgstr "Không phải trình phục vụ IPC"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP success"
+msgstr "Thành công"
+
+#, fuzzy
+#| msgid "Configuration error"
+msgid "LDAP operations error"
+msgstr "Lỗi cấu hình"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP protocol error"
+msgstr "Vi phạm giao thức"
+
+msgid "Time limit exceeded in LDAP"
+msgstr ""
+
+msgid "Size limit exceeded in LDAP"
+msgstr ""
+
+msgid "LDAP compare false"
+msgstr ""
+
+msgid "LDAP compare true"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "LDAP authentication method not supported"
+msgstr "Phần mở rộng không rõ"
+
+msgid "Strong(er) LDAP authentication required"
+msgstr ""
+
+msgid "Partial LDAP results+referral received"
+msgstr ""
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral"
+msgstr "Lỗi chung"
+
+msgid "Administrative LDAP limit exceeded"
+msgstr ""
+
+msgid "Critical LDAP extension is unavailable"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Confidentiality required by LDAP"
+msgstr "Cần thiết lập lại thẻ"
+
+msgid "LDAP SASL bind in progress"
+msgstr ""
+
+msgid "No such LDAP attribute"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid attribute"
+msgid "Undefined LDAP attribute type"
+msgstr "Thuộc tính không hợp lệ"
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate matching in LDAP"
+msgstr "Sự bảo vệ không được hỗ trợ"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Constraint violation in LDAP"
+msgstr "Vi phạm giao thức"
+
+msgid "LDAP type or value exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid syntax in LDAP"
+msgstr "Tình trạng không hợp lệ"
+
+#, fuzzy
+#| msgid "No CMS object"
+msgid "No such LDAP object"
+msgstr "Không có đối tượng CMS"
+
+#, fuzzy
+#| msgid "Hardware problem"
+msgid "LDAP alias problem"
+msgstr "Lỗi phần cứng"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid DN syntax in LDAP"
+msgstr "Tình trạng không hợp lệ"
+
+msgid "LDAP entry is a leaf"
+msgstr ""
+
+#, fuzzy
+#| msgid "Encoding problem"
+msgid "LDAP alias dereferencing problem"
+msgstr "Lỗi mã hoá"
+
+msgid "LDAP proxy authorization failure (X)"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate LDAP authentication"
+msgstr "Sự bảo vệ không được hỗ trợ"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid LDAP credentials"
+msgstr "Thẻ không hợp lệ"
+
+msgid "Insufficient access for LDAP"
+msgstr ""
+
+msgid "LDAP server is busy"
+msgstr ""
+
+msgid "LDAP server is unavailable"
+msgstr ""
+
+msgid "LDAP server is unwilling to perform"
+msgstr ""
+
+msgid "Loop detected by LDAP"
+msgstr ""
+
+#, fuzzy
+#| msgid "Missing action"
+msgid "LDAP naming violation"
+msgstr "Thiếu hành động"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP object class violation"
+msgstr "Vi phạm giao thức"
+
+#, fuzzy
+#| msgid "Operation not yet finished"
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "Thao tác chưa kết thúc"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation not allowed on RDN"
+msgstr "Thao tác bị hủy bỏ"
+
+msgid "Already exists (LDAP)"
+msgstr ""
+
+msgid "Cannot modify LDAP object class"
+msgstr ""
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "LDAP results too large"
+msgstr "Dòng quá dài"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation affects multiple DSAs"
+msgstr "Thao tác bị hủy bỏ"
+
+msgid "Virtual LDAP list view error"
+msgstr ""
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other LDAP error"
+msgstr "Lỗi IPC chung"
+
+#, fuzzy
+#| msgid "Resources exhausted"
+msgid "Resources exhausted in LCUP"
+msgstr "Cạn tài nguyên"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Security violation in LCUP"
+msgstr "Vi phạm giao thức"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid data in LCUP"
+msgstr "Tình trạng không hợp lệ"
+
+#, fuzzy
+#| msgid "Unsupported certificate"
+msgid "Unsupported scheme in LCUP"
+msgstr "Chứng nhận không được hỗ trợ"
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Reload required in LCUP"
+msgstr "Cần thiết lập lại thẻ"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP cancelled"
+msgstr "Thành công"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "No LDAP operation to cancel"
+msgstr "Không hoạt động được"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "Too late to cancel LDAP"
+msgstr "Không hoạt động được"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot cancel LDAP"
+msgstr "Không phải trình phục vụ IPC"
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "LDAP assertion failed"
+msgstr "Lỗi giải mật mã"
+
+msgid "Proxied authorization denied by LDAP"
+msgstr ""
+
+msgid "User defined error code 1"
+msgstr "Mã lỗi tự xác định 1"
+
+msgid "User defined error code 2"
+msgstr "Mã lỗi tự xác định 2"
+
+msgid "User defined error code 3"
+msgstr "Mã lỗi tự xác định 3"
+
+msgid "User defined error code 4"
+msgstr "Mã lỗi tự xác định 4"
+
+msgid "User defined error code 5"
+msgstr "Mã lỗi tự xác định 5"
+
+msgid "User defined error code 6"
+msgstr "Mã lỗi tự xác định 6"
+
+msgid "User defined error code 7"
+msgstr "Mã lỗi tự xác định 7"
+
+msgid "User defined error code 8"
+msgstr "Mã lỗi tự xác định 8"
+
+msgid "User defined error code 9"
+msgstr "Mã lỗi tự xác định 9"
+
+msgid "User defined error code 10"
+msgstr "Mã lỗi tự xác định 10"
+
+msgid "User defined error code 11"
+msgstr "Mã lỗi tự xác định 11"
+
+msgid "User defined error code 12"
+msgstr "Mã lỗi tự xác định 12"
+
+msgid "User defined error code 13"
+msgstr "Mã lỗi tự xác định 13"
+
+msgid "User defined error code 14"
+msgstr "Mã lỗi tự xác định 14"
+
+msgid "User defined error code 15"
+msgstr "Mã lỗi tự xác định 15"
+
+msgid "User defined error code 16"
+msgstr "Mã lỗi tự xác định 16"
+
+msgid "System error w/o errno"
+msgstr "Lỗi hệ thống không có số thứ tự lỗi"
+
+msgid "Unknown system error"
+msgstr "Gặp lỗi hệ thống không rõ"
+
+msgid "End of file"
+msgstr "Kết thúc tập tin"
+
+msgid "Unknown error code"
+msgstr "Mã lỗi không rõ"
+
+#, c-format
+msgid "Usage: %s GPG-ERROR [...]\n"
+msgstr "Sử dụng: %s GPG-ERROR [...]\n"
+
+#, c-format
+msgid "%s: warning: could not recognize %s\n"
+msgstr "%s: cảnh báo : không thể nhận ra %s\n"
+
+#, fuzzy
+#~| msgid "Resources exhausted"
+#~ msgid "LCUP Resources exhausted"
+#~ msgstr "Cạn tài nguyên"
+
+#, fuzzy
+#~| msgid "Invalid data"
+#~ msgid "LCUP Invalid data"
+#~ msgstr "Dữ liệu không hợp lệ"
+
+#, fuzzy
+#~| msgid "General error"
+#~ msgid "LDAP Other general error"
+#~ msgstr "Lỗi chung"
+
+#, fuzzy
+#~| msgid "dirmngr error"
+#~ msgid "Encoding error"
+#~ msgstr "Lỗi dirmngr"
diff --git a/po/zh_CN.po b/po/zh_CN.po
new file mode 100644
index 0000000..0ddea6c
--- /dev/null
+++ b/po/zh_CN.po
@@ -0,0 +1,1511 @@
+# Simplified Chinese translation to libgpg-error.
+# Copyright (C) 2009 Free Software Foundation, Inc.
+# This file is distributed under the same license as the libgpg-error package.
+# Aron Xu <[email protected]>, 2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: libgpg-error 1.7\n"
+"Report-Msgid-Bugs-To: [email protected]\n"
+"PO-Revision-Date: 2013-02-23 20:11+0100\n"
+"Last-Translator: Aron Xu <[email protected]>\n"
+"Language-Team: Chinese (simplified) <translation-team-zh-cn@lists."
+"sourceforge.net>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+msgid "Unspecified source"
+msgstr "未指定源"
+
+msgid "gcrypt"
+msgstr "gcrypt"
+
+msgid "GnuPG"
+msgstr "GnuPG"
+
+msgid "GpgSM"
+msgstr "GpgSM"
+
+msgid "GPG Agent"
+msgstr "GPG 代理"
+
+msgid "Pinentry"
+msgstr ""
+
+msgid "SCD"
+msgstr "SCD"
+
+msgid "GPGME"
+msgstr "GPGME"
+
+msgid "Keybox"
+msgstr ""
+
+msgid "KSBA"
+msgstr "KSBA"
+
+msgid "Dirmngr"
+msgstr ""
+
+msgid "GSTI"
+msgstr "GSTI"
+
+msgid "GPA"
+msgstr "GPA"
+
+msgid "Kleopatra"
+msgstr ""
+
+msgid "G13"
+msgstr ""
+
+msgid "Assuan"
+msgstr "Assuan"
+
+msgid "TLS"
+msgstr ""
+
+msgid "Any source"
+msgstr "任何来源"
+
+msgid "User defined source 1"
+msgstr "用户定义的来源1"
+
+msgid "User defined source 2"
+msgstr "用户定义的来源2"
+
+msgid "User defined source 3"
+msgstr "用户定义的来源3"
+
+msgid "User defined source 4"
+msgstr "用户定义的来源4"
+
+msgid "Unknown source"
+msgstr "来源不明"
+
+msgid "Success"
+msgstr "成功"
+
+msgid "General error"
+msgstr "一般错误"
+
+msgid "Unknown packet"
+msgstr "未知的包"
+
+msgid "Unknown version in packet"
+msgstr "包中未知的版本"
+
+msgid "Invalid public key algorithm"
+msgstr "无效的公钥算法"
+
+msgid "Invalid digest algorithm"
+msgstr "无效的摘要算法"
+
+msgid "Bad public key"
+msgstr "损坏的公钥"
+
+msgid "Bad secret key"
+msgstr "损坏的密钥"
+
+msgid "Bad signature"
+msgstr "损坏的签名"
+
+msgid "No public key"
+msgstr "没有公钥"
+
+msgid "Checksum error"
+msgstr "校验错误"
+
+msgid "Bad passphrase"
+msgstr "损坏的密码"
+
+msgid "Invalid cipher algorithm"
+msgstr "无效的密码算法"
+
+msgid "Cannot open keyring"
+msgstr ""
+
+msgid "Invalid packet"
+msgstr "无效的数据包"
+
+msgid "Invalid armor"
+msgstr ""
+
+msgid "No user ID"
+msgstr "没有用户ID"
+
+msgid "No secret key"
+msgstr "没有秘匙"
+
+msgid "Wrong secret key used"
+msgstr "使用了错误的密钥"
+
+msgid "Bad session key"
+msgstr "损坏的会话密钥"
+
+msgid "Unknown compression algorithm"
+msgstr "未知的压缩算法"
+
+msgid "Number is not prime"
+msgstr "不是素数"
+
+msgid "Invalid encoding method"
+msgstr "无效的编码方法"
+
+msgid "Invalid encryption scheme"
+msgstr "无效的加密方案"
+
+msgid "Invalid signature scheme"
+msgstr "无效的签名方案"
+
+msgid "Invalid attribute"
+msgstr "无效的属性"
+
+msgid "No value"
+msgstr "没有值"
+
+msgid "Not found"
+msgstr "未找到"
+
+msgid "Value not found"
+msgstr "没有发现值"
+
+msgid "Syntax error"
+msgstr "语法错误"
+
+msgid "Bad MPI value"
+msgstr "损坏的MPI 值"
+
+msgid "Invalid passphrase"
+msgstr "无效的密码"
+
+msgid "Invalid signature class"
+msgstr ""
+
+msgid "Resources exhausted"
+msgstr "内存耗尽"
+
+msgid "Invalid keyring"
+msgstr "无效的密钥环"
+
+msgid "Trust DB error"
+msgstr "信任数据库错误"
+
+msgid "Bad certificate"
+msgstr "损坏的证书"
+
+msgid "Invalid user ID"
+msgstr "无效的用户ID"
+
+msgid "Unexpected error"
+msgstr "意外错误"
+
+msgid "Time conflict"
+msgstr "时间冲突"
+
+msgid "Keyserver error"
+msgstr "密钥服务器错误"
+
+msgid "Wrong public key algorithm"
+msgstr "错误的公开密钥算法"
+
+msgid "Tribute to D. A."
+msgstr ""
+
+msgid "Weak encryption key"
+msgstr "弱加密密钥"
+
+msgid "Invalid key length"
+msgstr "无效的密钥长度"
+
+msgid "Invalid argument"
+msgstr "无效的参数"
+
+msgid "Syntax error in URI"
+msgstr "以下URI 中语法错误"
+
+msgid "Invalid URI"
+msgstr "无效的URI"
+
+msgid "Network error"
+msgstr "网络错误"
+
+msgid "Unknown host"
+msgstr "未知的主机"
+
+msgid "Selftest failed"
+msgstr "自测失败"
+
+msgid "Data not encrypted"
+msgstr "数据未加密"
+
+msgid "Data not processed"
+msgstr "数据未处理"
+
+msgid "Unusable public key"
+msgstr "不可用公钥"
+
+msgid "Unusable secret key"
+msgstr "不可用密钥"
+
+msgid "Invalid value"
+msgstr "无效值"
+
+msgid "Bad certificate chain"
+msgstr "损坏的证书链"
+
+msgid "Missing certificate"
+msgstr "缺失证书"
+
+msgid "No data"
+msgstr "无数据"
+
+msgid "Bug"
+msgstr "错误"
+
+msgid "Not supported"
+msgstr "不支持"
+
+msgid "Invalid operation code"
+msgstr "无效的操作码"
+
+msgid "Timeout"
+msgstr "超时"
+
+msgid "Internal error"
+msgstr "内部错误"
+
+msgid "EOF (gcrypt)"
+msgstr "EOF (gcrypt)"
+
+msgid "Invalid object"
+msgstr "无效的对象"
+
+msgid "Provided object is too short"
+msgstr "提供对象太短"
+
+msgid "Provided object is too large"
+msgstr "提供对象太大"
+
+msgid "Missing item in object"
+msgstr "对象中缺少项目"
+
+msgid "Not implemented"
+msgstr "未实现"
+
+msgid "Conflicting use"
+msgstr ""
+
+msgid "Invalid cipher mode"
+msgstr "无效的加密模式"
+
+msgid "Invalid flag"
+msgstr ""
+
+msgid "Invalid handle"
+msgstr ""
+
+msgid "Result truncated"
+msgstr "结果已截断"
+
+msgid "Incomplete line"
+msgstr "不完整行"
+
+msgid "Invalid response"
+msgstr "无效的响应"
+
+msgid "No agent running"
+msgstr "未运行代理"
+
+#, fuzzy
+#| msgid "agent error"
+msgid "Agent error"
+msgstr "代理错误"
+
+msgid "Invalid data"
+msgstr "无效的数据"
+
+msgid "Unspecific Assuan server fault"
+msgstr ""
+
+msgid "General Assuan error"
+msgstr "一般Assuan 错误"
+
+msgid "Invalid session key"
+msgstr "无效的会话密钥"
+
+msgid "Invalid S-expression"
+msgstr ""
+
+msgid "Unsupported algorithm"
+msgstr "不支持的算法"
+
+msgid "No pinentry"
+msgstr ""
+
+msgid "pinentry error"
+msgstr ""
+
+msgid "Bad PIN"
+msgstr "损坏的PIN"
+
+msgid "Invalid name"
+msgstr "无效的名称"
+
+msgid "Bad data"
+msgstr "不良数据"
+
+msgid "Invalid parameter"
+msgstr "无效的参数"
+
+msgid "Wrong card"
+msgstr "错卡"
+
+msgid "No dirmngr"
+msgstr ""
+
+msgid "dirmngr error"
+msgstr ""
+
+msgid "Certificate revoked"
+msgstr "证书已吊销"
+
+msgid "No CRL known"
+msgstr ""
+
+msgid "CRL too old"
+msgstr ""
+
+msgid "Line too long"
+msgstr "线太长"
+
+msgid "Not trusted"
+msgstr "不信任"
+
+msgid "Operation cancelled"
+msgstr "操作已取消"
+
+msgid "Bad CA certificate"
+msgstr "损坏的CA 证书"
+
+msgid "Certificate expired"
+msgstr "证书已过期"
+
+msgid "Certificate too young"
+msgstr "证书太新"
+
+msgid "Unsupported certificate"
+msgstr "不支持的凭证"
+
+msgid "Unknown S-expression"
+msgstr ""
+
+msgid "Unsupported protection"
+msgstr "不受支持的保护"
+
+msgid "Corrupted protection"
+msgstr "损坏的保护"
+
+msgid "Ambiguous name"
+msgstr ""
+
+msgid "Card error"
+msgstr "卡错误"
+
+msgid "Card reset required"
+msgstr "要求重置卡"
+
+msgid "Card removed"
+msgstr "卡已删除"
+
+msgid "Invalid card"
+msgstr "无效的卡"
+
+msgid "Card not present"
+msgstr ""
+
+msgid "No PKCS15 application"
+msgstr "没有PKCS15 应用程序"
+
+msgid "Not confirmed"
+msgstr "未确认"
+
+msgid "Configuration error"
+msgstr "配置错误"
+
+msgid "No policy match"
+msgstr "没有匹配的规则"
+
+msgid "Invalid index"
+msgstr "无效的索引"
+
+msgid "Invalid ID"
+msgstr "无效的 ID"
+
+msgid "No SmartCard daemon"
+msgstr "没有智能卡守护进程"
+
+msgid "SmartCard daemon error"
+msgstr "智能卡守护程序错误"
+
+msgid "Unsupported protocol"
+msgstr "不支持的协议"
+
+msgid "Bad PIN method"
+msgstr ""
+
+msgid "Card not initialized"
+msgstr "卡未初始化"
+
+msgid "Unsupported operation"
+msgstr "不支持的操作"
+
+msgid "Wrong key usage"
+msgstr "错误的密钥用法"
+
+msgid "Nothing found"
+msgstr "未发现"
+
+msgid "Wrong blob type"
+msgstr ""
+
+msgid "Missing value"
+msgstr "缺失值"
+
+msgid "Hardware problem"
+msgstr "硬件问题"
+
+msgid "PIN blocked"
+msgstr "PIN 已屏蔽"
+
+msgid "Conditions of use not satisfied"
+msgstr "使用条件不满足"
+
+msgid "PINs are not synced"
+msgstr "PINs 不同步"
+
+msgid "Invalid CRL"
+msgstr "无效的 CRL"
+
+msgid "BER error"
+msgstr "BER 错误"
+
+msgid "Invalid BER"
+msgstr "无效的BER"
+
+msgid "Element not found"
+msgstr "未找到元素"
+
+msgid "Identifier not found"
+msgstr "未找到标识符"
+
+msgid "Invalid tag"
+msgstr "无效的标签"
+
+msgid "Invalid length"
+msgstr "无效的长度"
+
+msgid "Invalid key info"
+msgstr "无效的密钥信息"
+
+msgid "Unexpected tag"
+msgstr ""
+
+msgid "Not DER encoded"
+msgstr ""
+
+msgid "No CMS object"
+msgstr "没有CMS 对象"
+
+msgid "Invalid CMS object"
+msgstr "无效的CMS 对象"
+
+msgid "Unknown CMS object"
+msgstr "未知的CMS 对象"
+
+msgid "Unsupported CMS object"
+msgstr "不支持的CMS 对象"
+
+msgid "Unsupported encoding"
+msgstr "不支持的编码"
+
+msgid "Unsupported CMS version"
+msgstr "不支持的CMS 版本"
+
+msgid "Unknown algorithm"
+msgstr "未知的算法"
+
+msgid "Invalid crypto engine"
+msgstr "无效的加密引擎"
+
+msgid "Public key not trusted"
+msgstr "公钥不被信任"
+
+msgid "Decryption failed"
+msgstr "解密失败"
+
+msgid "Key expired"
+msgstr "密钥已过期"
+
+msgid "Signature expired"
+msgstr "签名过期"
+
+msgid "Encoding problem"
+msgstr "编码问题"
+
+msgid "Invalid state"
+msgstr "无效的州"
+
+msgid "Duplicated value"
+msgstr "重复值"
+
+msgid "Missing action"
+msgstr ""
+
+msgid "ASN.1 module not found"
+msgstr "ASN.1 模块未找到"
+
+msgid "Invalid OID string"
+msgstr "无效的OID 字符串"
+
+msgid "Invalid time"
+msgstr "无效的时间"
+
+msgid "Invalid CRL object"
+msgstr "无效的CRL 对象"
+
+msgid "Unsupported CRL version"
+msgstr "不支持的CRL 版本"
+
+msgid "Invalid certificate object"
+msgstr "无效的证书对象"
+
+msgid "Unknown name"
+msgstr "未知名称"
+
+msgid "A locale function failed"
+msgstr "区域设置功能失败"
+
+msgid "Not locked"
+msgstr "未锁定"
+
+msgid "Protocol violation"
+msgstr "违反协议"
+
+msgid "Invalid MAC"
+msgstr "无效的MAC"
+
+msgid "Invalid request"
+msgstr "无效的请求"
+
+msgid "Unknown extension"
+msgstr "未知的扩展名"
+
+msgid "Unknown critical extension"
+msgstr ""
+
+msgid "Locked"
+msgstr "已锁定"
+
+msgid "Unknown option"
+msgstr "未知的选项"
+
+msgid "Unknown command"
+msgstr "未知命令"
+
+msgid "Not operational"
+msgstr ""
+
+msgid "No passphrase given"
+msgstr "没有给出密码"
+
+msgid "No PIN given"
+msgstr "没有给出PIN"
+
+#, fuzzy
+msgid "Not enabled"
+msgstr "未锁定"
+
+#, fuzzy
+msgid "No crypto engine"
+msgstr "无效的加密引擎"
+
+#, fuzzy
+msgid "Missing key"
+msgstr "缺失值"
+
+#, fuzzy
+msgid "Too many objects"
+msgstr "没有CMS 对象"
+
+msgid "Limit reached"
+msgstr ""
+
+#, fuzzy
+msgid "Not initialized"
+msgstr "卡未初始化"
+
+#, fuzzy
+msgid "Missing issuer certificate"
+msgstr "缺失证书"
+
+msgid "No keyserver available"
+msgstr ""
+
+#, fuzzy
+msgid "Invalid elliptic curve"
+msgstr "无效的时间"
+
+#, fuzzy
+msgid "Unknown elliptic curve"
+msgstr "来源不明"
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated key"
+msgstr "重复值"
+
+msgid "Ambiguous result"
+msgstr ""
+
+#, fuzzy
+msgid "No crypto context"
+msgstr "无效的加密引擎"
+
+#, fuzzy
+msgid "Wrong crypto context"
+msgstr "无效的加密引擎"
+
+#, fuzzy
+#| msgid "Invalid crypto engine"
+msgid "Bad crypto context"
+msgstr "无效的加密引擎"
+
+msgid "Conflict in the crypto context"
+msgstr ""
+
+#, fuzzy
+#| msgid "No public key"
+msgid "Broken public key"
+msgstr "没有公钥"
+
+#, fuzzy
+#| msgid "No secret key"
+msgid "Broken secret key"
+msgstr "没有秘匙"
+
+#, fuzzy
+#| msgid "Invalid digest algorithm"
+msgid "Invalid MAC algorithm"
+msgstr "无效的摘要算法"
+
+#, fuzzy
+msgid "Operation fully cancelled"
+msgstr "操作已取消"
+
+msgid "Operation not yet finished"
+msgstr "操作尚未完成"
+
+msgid "Buffer too short"
+msgstr "缓冲区太短"
+
+msgid "Invalid length specifier in S-expression"
+msgstr ""
+
+msgid "String too long in S-expression"
+msgstr ""
+
+msgid "Unmatched parentheses in S-expression"
+msgstr ""
+
+msgid "S-expression not canonical"
+msgstr ""
+
+msgid "Bad character in S-expression"
+msgstr ""
+
+msgid "Bad quotation in S-expression"
+msgstr ""
+
+msgid "Zero prefix in S-expression"
+msgstr ""
+
+msgid "Nested display hints in S-expression"
+msgstr ""
+
+msgid "Unmatched display hints"
+msgstr ""
+
+msgid "Unexpected reserved punctuation in S-expression"
+msgstr ""
+
+msgid "Bad hexadecimal character in S-expression"
+msgstr ""
+
+msgid "Odd hexadecimal numbers in S-expression"
+msgstr ""
+
+msgid "Bad octal character in S-expression"
+msgstr ""
+
+msgid "All subkeys are expired or revoked"
+msgstr ""
+
+#, fuzzy
+#| msgid "Data not encrypted"
+msgid "Database is corrupted"
+msgstr "数据未加密"
+
+msgid "Server indicated a failure"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "No name"
+msgstr "未知名称"
+
+#, fuzzy
+#| msgid "No public key"
+msgid "No key"
+msgstr "没有公钥"
+
+msgid "Legacy key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Buffer too short"
+msgid "Request too short"
+msgstr "缓冲区太短"
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "Request too long"
+msgstr "线太长"
+
+msgid "Object is in termination state"
+msgstr ""
+
+#, fuzzy
+#| msgid "Bad certificate chain"
+msgid "No certificate chain"
+msgstr "损坏的证书链"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Certificate is too large"
+msgstr "证书太新"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid record"
+msgstr "无效的卡"
+
+msgid "The MAC does not verify"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unexpected error"
+msgid "Unexpected message"
+msgstr "意外错误"
+
+msgid "Compression or decompression failed"
+msgstr ""
+
+msgid "A counter would wrap"
+msgstr ""
+
+msgid "Fatal alert message received"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid cipher algorithm"
+msgid "No cipher algorithm"
+msgstr "无效的密码算法"
+
+#, fuzzy
+msgid "Missing client certificate"
+msgstr "缺失证书"
+
+#, fuzzy
+#| msgid "Certificate revoked"
+msgid "Close notification received"
+msgstr "证书已吊销"
+
+#, fuzzy
+#| msgid "Key expired"
+msgid "Ticket expired"
+msgstr "密钥已过期"
+
+#, fuzzy
+#| msgid "Bad public key"
+msgid "Bad ticket"
+msgstr "损坏的公钥"
+
+#, fuzzy
+#| msgid "Unknown packet"
+msgid "Unknown identity"
+msgstr "未知的包"
+
+#, fuzzy
+#| msgid "Bad certificate chain"
+msgid "Bad certificate message in handshake"
+msgstr "损坏的证书链"
+
+msgid "Bad certificate request message in handshake"
+msgstr ""
+
+msgid "Bad certificate verify message in handshake"
+msgstr ""
+
+msgid "Bad change cipher message in handshake"
+msgstr ""
+
+msgid "Bad client hello message in handshake"
+msgstr ""
+
+msgid "Bad server hello message in handshake"
+msgstr ""
+
+msgid "Bad server hello done message in handshake"
+msgstr ""
+
+msgid "Bad finished message in handshake"
+msgstr ""
+
+msgid "Bad server key exchange message in handshake"
+msgstr ""
+
+msgid "Bad client key exchange message in handshake"
+msgstr ""
+
+msgid "Bogus string"
+msgstr ""
+
+msgid "Forbidden"
+msgstr ""
+
+#, fuzzy
+#| msgid "Key expired"
+msgid "Key disabled"
+msgstr "密钥已过期"
+
+msgid "Not possible with a card based key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid object"
+msgid "Invalid lock object"
+msgstr "无效的对象"
+
+msgid "True"
+msgstr ""
+
+msgid "False"
+msgstr ""
+
+msgid "General IPC error"
+msgstr "一般IPC 错误"
+
+msgid "IPC accept call failed"
+msgstr ""
+
+msgid "IPC connect call failed"
+msgstr ""
+
+msgid "Invalid IPC response"
+msgstr ""
+
+msgid "Invalid value passed to IPC"
+msgstr ""
+
+msgid "Incomplete line passed to IPC"
+msgstr ""
+
+msgid "Line passed to IPC too long"
+msgstr ""
+
+msgid "Nested IPC commands"
+msgstr ""
+
+msgid "No data callback in IPC"
+msgstr ""
+
+msgid "No inquire callback in IPC"
+msgstr ""
+
+msgid "Not an IPC server"
+msgstr "不是IPC 服务器"
+
+msgid "Not an IPC client"
+msgstr "不是IPC 客户端"
+
+msgid "Problem starting IPC server"
+msgstr ""
+
+msgid "IPC read error"
+msgstr "IPC 读取错误"
+
+msgid "IPC write error"
+msgstr "IPC写入 错误"
+
+msgid "Too much data for IPC layer"
+msgstr ""
+
+msgid "Unexpected IPC command"
+msgstr ""
+
+msgid "Unknown IPC command"
+msgstr "未知IPC 命令"
+
+msgid "IPC syntax error"
+msgstr "IPC 语法错误"
+
+msgid "IPC call has been cancelled"
+msgstr ""
+
+msgid "No input source for IPC"
+msgstr ""
+
+msgid "No output source for IPC"
+msgstr ""
+
+msgid "IPC parameter error"
+msgstr "IPC 参数错误"
+
+msgid "Unknown IPC inquire"
+msgstr ""
+
+#, fuzzy
+msgid "Crypto engine too old"
+msgstr "无效的加密引擎"
+
+msgid "Screen or window too small"
+msgstr ""
+
+msgid "Screen or window too large"
+msgstr ""
+
+msgid "Required environment variable not set"
+msgstr ""
+
+msgid "User ID already exists"
+msgstr ""
+
+msgid "Name already exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated name"
+msgstr "重复值"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Object is too young"
+msgstr "证书太新"
+
+#, fuzzy
+#| msgid "Provided object is too short"
+msgid "Object is too old"
+msgstr "提供对象太短"
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Unknown flag"
+msgstr "未知名称"
+
+#, fuzzy
+#| msgid "Invalid operation code"
+msgid "Invalid execution order"
+msgstr "无效的操作码"
+
+msgid "Already fetched"
+msgstr ""
+
+msgid "Try again later"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Wrong name"
+msgstr "未知名称"
+
+msgid "System bug detected"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown system error"
+msgid "Unknown DNS error"
+msgstr "未知的系统错误"
+
+#, fuzzy
+#| msgid "Invalid OID string"
+msgid "Invalid DNS section"
+msgstr "无效的OID 字符串"
+
+msgid "Invalid textual address form"
+msgstr ""
+
+#, fuzzy
+msgid "Missing DNS query packet"
+msgstr "缺失证书"
+
+msgid "Missing DNS answer packet"
+msgstr ""
+
+msgid "Connection closed in DNS"
+msgstr ""
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "Verification failed in DNS"
+msgstr "解密失败"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "DNS Timeout"
+msgstr "超时"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "General LDAP error"
+msgstr "一般IPC 错误"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP attribute error"
+msgstr "一般错误"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP name error"
+msgstr "一般错误"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP security error"
+msgstr "一般Assuan 错误"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP service error"
+msgstr "一般错误"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP update error"
+msgstr "一般Assuan 错误"
+
+msgid "Experimental LDAP error code"
+msgstr ""
+
+#, fuzzy
+#| msgid "IPC write error"
+msgid "Private LDAP error code"
+msgstr "IPC写入 错误"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other general LDAP error"
+msgstr "一般IPC 错误"
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "LDAP connecting failed (X)"
+msgstr "解密失败"
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral limit exceeded"
+msgstr "一般错误"
+
+msgid "LDAP client loop"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "No LDAP results returned"
+msgstr "要求重置卡"
+
+#, fuzzy
+#| msgid "Element not found"
+msgid "LDAP control not found"
+msgstr "未找到元素"
+
+#, fuzzy
+#| msgid "Not supported"
+msgid "Not supported by LDAP"
+msgstr "不支持"
+
+#, fuzzy
+#| msgid "Unexpected error"
+msgid "LDAP connect error"
+msgstr "意外错误"
+
+msgid "Out of memory in LDAP"
+msgstr ""
+
+msgid "Bad parameter to an LDAP routine"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported operation"
+msgid "User cancelled LDAP operation"
+msgstr "不支持的操作"
+
+#, fuzzy
+#| msgid "Bad certificate"
+msgid "Bad LDAP search filter"
+msgstr "损坏的证书"
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "Unknown LDAP authentication method"
+msgstr "未知的扩展名"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "Timeout in LDAP"
+msgstr "超时"
+
+#, fuzzy
+#| msgid "agent error"
+msgid "LDAP decoding error"
+msgstr "代理错误"
+
+#, fuzzy
+#| msgid "agent error"
+msgid "LDAP encoding error"
+msgstr "代理错误"
+
+#, fuzzy
+#| msgid "IPC read error"
+msgid "LDAP local error"
+msgstr "IPC 读取错误"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot contact LDAP server"
+msgstr "不是IPC 服务器"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP success"
+msgstr "成功"
+
+#, fuzzy
+#| msgid "Configuration error"
+msgid "LDAP operations error"
+msgstr "配置错误"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP protocol error"
+msgstr "违反协议"
+
+msgid "Time limit exceeded in LDAP"
+msgstr ""
+
+msgid "Size limit exceeded in LDAP"
+msgstr ""
+
+msgid "LDAP compare false"
+msgstr ""
+
+msgid "LDAP compare true"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "LDAP authentication method not supported"
+msgstr "未知的扩展名"
+
+msgid "Strong(er) LDAP authentication required"
+msgstr ""
+
+msgid "Partial LDAP results+referral received"
+msgstr ""
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral"
+msgstr "一般错误"
+
+msgid "Administrative LDAP limit exceeded"
+msgstr ""
+
+msgid "Critical LDAP extension is unavailable"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Confidentiality required by LDAP"
+msgstr "要求重置卡"
+
+msgid "LDAP SASL bind in progress"
+msgstr ""
+
+msgid "No such LDAP attribute"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid attribute"
+msgid "Undefined LDAP attribute type"
+msgstr "无效的属性"
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate matching in LDAP"
+msgstr "不受支持的保护"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Constraint violation in LDAP"
+msgstr "违反协议"
+
+msgid "LDAP type or value exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid syntax in LDAP"
+msgstr "无效的州"
+
+#, fuzzy
+#| msgid "No CMS object"
+msgid "No such LDAP object"
+msgstr "没有CMS 对象"
+
+#, fuzzy
+#| msgid "Hardware problem"
+msgid "LDAP alias problem"
+msgstr "硬件问题"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid DN syntax in LDAP"
+msgstr "无效的州"
+
+msgid "LDAP entry is a leaf"
+msgstr ""
+
+#, fuzzy
+#| msgid "Encoding problem"
+msgid "LDAP alias dereferencing problem"
+msgstr "编码问题"
+
+msgid "LDAP proxy authorization failure (X)"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate LDAP authentication"
+msgstr "不受支持的保护"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid LDAP credentials"
+msgstr "无效的卡"
+
+msgid "Insufficient access for LDAP"
+msgstr ""
+
+msgid "LDAP server is busy"
+msgstr ""
+
+msgid "LDAP server is unavailable"
+msgstr ""
+
+msgid "LDAP server is unwilling to perform"
+msgstr ""
+
+msgid "Loop detected by LDAP"
+msgstr ""
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP naming violation"
+msgstr "违反协议"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP object class violation"
+msgstr "违反协议"
+
+#, fuzzy
+#| msgid "Operation not yet finished"
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "操作尚未完成"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation not allowed on RDN"
+msgstr "操作已取消"
+
+msgid "Already exists (LDAP)"
+msgstr ""
+
+msgid "Cannot modify LDAP object class"
+msgstr ""
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "LDAP results too large"
+msgstr "线太长"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation affects multiple DSAs"
+msgstr "操作已取消"
+
+msgid "Virtual LDAP list view error"
+msgstr ""
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other LDAP error"
+msgstr "一般IPC 错误"
+
+#, fuzzy
+#| msgid "Resources exhausted"
+msgid "Resources exhausted in LCUP"
+msgstr "内存耗尽"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Security violation in LCUP"
+msgstr "违反协议"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid data in LCUP"
+msgstr "无效的州"
+
+#, fuzzy
+#| msgid "Unsupported certificate"
+msgid "Unsupported scheme in LCUP"
+msgstr "不支持的凭证"
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Reload required in LCUP"
+msgstr "要求重置卡"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP cancelled"
+msgstr "成功"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "No LDAP operation to cancel"
+msgstr "操作已取消"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "Too late to cancel LDAP"
+msgstr "操作已取消"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot cancel LDAP"
+msgstr "不是IPC 服务器"
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "LDAP assertion failed"
+msgstr "解密失败"
+
+msgid "Proxied authorization denied by LDAP"
+msgstr ""
+
+msgid "User defined error code 1"
+msgstr "用户定义的错误代码1"
+
+msgid "User defined error code 2"
+msgstr "用户定义的错误代码2"
+
+msgid "User defined error code 3"
+msgstr "用户定义的错误代码3"
+
+msgid "User defined error code 4"
+msgstr "用户定义的错误代码4"
+
+msgid "User defined error code 5"
+msgstr "用户定义的错误代码5"
+
+msgid "User defined error code 6"
+msgstr "用户定义的错误代码6"
+
+msgid "User defined error code 7"
+msgstr "用户定义的错误代码7"
+
+msgid "User defined error code 8"
+msgstr "用户定义的错误代码8"
+
+msgid "User defined error code 9"
+msgstr "用户定义的错误码9"
+
+msgid "User defined error code 10"
+msgstr "用户定义的错误代码10"
+
+msgid "User defined error code 11"
+msgstr "用户定义的错误代码11"
+
+msgid "User defined error code 12"
+msgstr "用户定义的错误代码12"
+
+msgid "User defined error code 13"
+msgstr "用户定义的错误代码13"
+
+msgid "User defined error code 14"
+msgstr "用户定义的错误代码14"
+
+msgid "User defined error code 15"
+msgstr "用户定义的错误代码15"
+
+msgid "User defined error code 16"
+msgstr "用户定义的错误代码16"
+
+msgid "System error w/o errno"
+msgstr ""
+
+msgid "Unknown system error"
+msgstr "未知的系统错误"
+
+msgid "End of file"
+msgstr "文件结尾"
+
+msgid "Unknown error code"
+msgstr "未知的错误代码"
+
+#, c-format
+msgid "Usage: %s GPG-ERROR [...]\n"
+msgstr ""
+
+#, c-format
+msgid "%s: warning: could not recognize %s\n"
+msgstr "%s:警告:无法识别 %s\n"
+
+#, fuzzy
+#~| msgid "Resources exhausted"
+#~ msgid "LCUP Resources exhausted"
+#~ msgstr "内存耗尽"
+
+#, fuzzy
+#~| msgid "Invalid data"
+#~ msgid "LCUP Invalid data"
+#~ msgstr "无效的数据"
+
+#, fuzzy
+#~| msgid "General error"
+#~ msgid "LDAP Other general error"
+#~ msgstr "一般错误"
+
+#, fuzzy
+#~| msgid "Encoding problem"
+#~ msgid "Encoding error"
+#~ msgstr "编码问题"
diff --git a/po/zh_TW.po b/po/zh_TW.po
new file mode 100644
index 0000000..040f5ba
--- /dev/null
+++ b/po/zh_TW.po
@@ -0,0 +1,1473 @@
+# zh_TW.po - Chinese traditional translations for libgpg-error
+# Copyright (C) 2014 Jedi Lin
+# This file is distributed under the same license as the libngpg-error package.
+# Jedi Lin <[email protected]>, 2014
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: libgpg-error 1.17\n"
+"Report-Msgid-Bugs-To: [email protected]\n"
+"PO-Revision-Date: 2014-11-17 21:25+0800\n"
+"Last-Translator: Jedi Lin <[email protected]>\n"
+"Language-Team: Chinese (traditional) <[email protected]>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.5.7\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+"X-Poedit-SourceCharset: UTF-8\n"
+"X-Poedit-Basepath: libgpg-error-1.17\n"
+
+msgid "Unspecified source"
+msgstr "未指定的來源"
+
+msgid "gcrypt"
+msgstr "gcrypt"
+
+msgid "GnuPG"
+msgstr "GnuPG"
+
+msgid "GpgSM"
+msgstr "GpgSM"
+
+msgid "GPG Agent"
+msgstr "GPG 代理"
+
+msgid "Pinentry"
+msgstr "個人識別碼項目"
+
+msgid "SCD"
+msgstr "SCD"
+
+msgid "GPGME"
+msgstr "GPGME"
+
+msgid "Keybox"
+msgstr "Keybox"
+
+msgid "KSBA"
+msgstr "KSBA"
+
+msgid "Dirmngr"
+msgstr "Dirmngr"
+
+msgid "GSTI"
+msgstr "GSTI"
+
+msgid "GPA"
+msgstr "GPA"
+
+msgid "Kleopatra"
+msgstr "Kleopatra"
+
+msgid "G13"
+msgstr "G13"
+
+msgid "Assuan"
+msgstr "Assuan"
+
+msgid "TLS"
+msgstr "TLS"
+
+msgid "Any source"
+msgstr "任何來源"
+
+msgid "User defined source 1"
+msgstr "使用者定義來源 1"
+
+msgid "User defined source 2"
+msgstr "使用者定義來源 2"
+
+msgid "User defined source 3"
+msgstr "使用者定義來源 3"
+
+msgid "User defined source 4"
+msgstr "使用者定義來源 4"
+
+msgid "Unknown source"
+msgstr "未知的來源"
+
+msgid "Success"
+msgstr "成功"
+
+msgid "General error"
+msgstr "一般錯誤"
+
+msgid "Unknown packet"
+msgstr "未知的封包"
+
+msgid "Unknown version in packet"
+msgstr "封包中的未知版本"
+
+msgid "Invalid public key algorithm"
+msgstr "無效的公鑰演算法"
+
+msgid "Invalid digest algorithm"
+msgstr "無效的摘要演算法"
+
+msgid "Bad public key"
+msgstr "不良的公鑰"
+
+msgid "Bad secret key"
+msgstr "不良的私鑰"
+
+msgid "Bad signature"
+msgstr "不良的簽章"
+
+msgid "No public key"
+msgstr "沒有公鑰"
+
+msgid "Checksum error"
+msgstr "檢核碼錯誤"
+
+msgid "Bad passphrase"
+msgstr "不良的密語"
+
+msgid "Invalid cipher algorithm"
+msgstr "無效的編密演算法"
+
+msgid "Cannot open keyring"
+msgstr "金鑰鏈開啟"
+
+msgid "Invalid packet"
+msgstr "無效的封包"
+
+msgid "Invalid armor"
+msgstr "無效的封裝"
+
+msgid "No user ID"
+msgstr "沒有使用者 ID"
+
+msgid "No secret key"
+msgstr "沒有私鑰"
+
+msgid "Wrong secret key used"
+msgstr "使用錯誤的私鑰"
+
+msgid "Bad session key"
+msgstr "不良的階段金鑰"
+
+msgid "Unknown compression algorithm"
+msgstr "未知的壓縮演算法"
+
+msgid "Number is not prime"
+msgstr "數值並非質數"
+
+msgid "Invalid encoding method"
+msgstr "無效的編碼方法"
+
+msgid "Invalid encryption scheme"
+msgstr "無效的加密框架"
+
+msgid "Invalid signature scheme"
+msgstr "無效的簽署框架"
+
+msgid "Invalid attribute"
+msgstr "無效的屬性"
+
+msgid "No value"
+msgstr "沒有值"
+
+msgid "Not found"
+msgstr "找不到"
+
+msgid "Value not found"
+msgstr "找不到值"
+
+msgid "Syntax error"
+msgstr "語法錯誤"
+
+msgid "Bad MPI value"
+msgstr "不良的 MPI 值"
+
+msgid "Invalid passphrase"
+msgstr "無效的密語"
+
+msgid "Invalid signature class"
+msgstr "無效的簽章類別"
+
+msgid "Resources exhausted"
+msgstr "資源已耗盡"
+
+msgid "Invalid keyring"
+msgstr "無效的鑰匙圈"
+
+msgid "Trust DB error"
+msgstr "信任資料庫錯誤"
+
+msgid "Bad certificate"
+msgstr "不良的憑證"
+
+msgid "Invalid user ID"
+msgstr "無效的使用者 ID"
+
+msgid "Unexpected error"
+msgstr "未預期的錯誤"
+
+msgid "Time conflict"
+msgstr "時間衝突"
+
+msgid "Keyserver error"
+msgstr "金鑰伺服器錯誤"
+
+msgid "Wrong public key algorithm"
+msgstr "錯誤的公鑰演算法"
+
+msgid "Tribute to D. A."
+msgstr "向 D. A. 致意"
+
+msgid "Weak encryption key"
+msgstr "弱加密金鑰"
+
+msgid "Invalid key length"
+msgstr "無效的金鑰長度"
+
+msgid "Invalid argument"
+msgstr "無效的引數"
+
+msgid "Syntax error in URI"
+msgstr "網址中的語法錯誤"
+
+msgid "Invalid URI"
+msgstr "無效的網址"
+
+msgid "Network error"
+msgstr "網路錯誤"
+
+msgid "Unknown host"
+msgstr "未知的主機"
+
+msgid "Selftest failed"
+msgstr "自我測試失敗"
+
+msgid "Data not encrypted"
+msgstr "資料未經加密"
+
+msgid "Data not processed"
+msgstr "資料未處理"
+
+msgid "Unusable public key"
+msgstr "無法使用的公鑰"
+
+msgid "Unusable secret key"
+msgstr "無法使用的私鑰"
+
+msgid "Invalid value"
+msgstr "無效的值"
+
+msgid "Bad certificate chain"
+msgstr "不良的憑證鏈"
+
+msgid "Missing certificate"
+msgstr "遺失憑證"
+
+msgid "No data"
+msgstr "沒有資料"
+
+msgid "Bug"
+msgstr "瑕疵"
+
+msgid "Not supported"
+msgstr "未支援"
+
+msgid "Invalid operation code"
+msgstr "無效的操作碼"
+
+msgid "Timeout"
+msgstr "逾時"
+
+msgid "Internal error"
+msgstr "內部錯誤"
+
+msgid "EOF (gcrypt)"
+msgstr "EOF (gcrypt)"
+
+msgid "Invalid object"
+msgstr "無效的物件"
+
+msgid "Provided object is too short"
+msgstr "提供的物件太短"
+
+msgid "Provided object is too large"
+msgstr "提供的物件太大"
+
+msgid "Missing item in object"
+msgstr "物件中遺失項目"
+
+msgid "Not implemented"
+msgstr "未實作"
+
+msgid "Conflicting use"
+msgstr "彼此衝突的用法"
+
+msgid "Invalid cipher mode"
+msgstr "無效的密碼法模式"
+
+msgid "Invalid flag"
+msgstr "無效的旗標"
+
+msgid "Invalid handle"
+msgstr "無效的代號"
+
+msgid "Result truncated"
+msgstr "結果已截剩部分"
+
+msgid "Incomplete line"
+msgstr "不完整列"
+
+msgid "Invalid response"
+msgstr "無效的回應"
+
+msgid "No agent running"
+msgstr "沒有執行中的代理程式"
+
+msgid "Agent error"
+msgstr "代理程式錯誤"
+
+msgid "Invalid data"
+msgstr "無效的資料"
+
+msgid "Unspecific Assuan server fault"
+msgstr "未指定的 Assuan 伺服器出錯"
+
+msgid "General Assuan error"
+msgstr "一般性的 Assuan 錯誤"
+
+msgid "Invalid session key"
+msgstr "無效的階段金鑰"
+
+msgid "Invalid S-expression"
+msgstr "無效的 S-表示式"
+
+msgid "Unsupported algorithm"
+msgstr "未支援的演算法"
+
+msgid "No pinentry"
+msgstr "沒有個人識別碼項目"
+
+msgid "pinentry error"
+msgstr "個人識別碼錯誤"
+
+msgid "Bad PIN"
+msgstr "不良的個人識別碼"
+
+msgid "Invalid name"
+msgstr "無效的名稱"
+
+msgid "Bad data"
+msgstr "無效的資料"
+
+msgid "Invalid parameter"
+msgstr "無效的參數"
+
+msgid "Wrong card"
+msgstr "錯誤的卡片"
+
+msgid "No dirmngr"
+msgstr "沒有 dirmngr"
+
+msgid "dirmngr error"
+msgstr "dirmngr 錯誤"
+
+msgid "Certificate revoked"
+msgstr "憑證已撤銷"
+
+msgid "No CRL known"
+msgstr "沒有已知的 CRL"
+
+msgid "CRL too old"
+msgstr "CRL 太老舊"
+
+msgid "Line too long"
+msgstr "列太長"
+
+msgid "Not trusted"
+msgstr "未信任"
+
+msgid "Operation cancelled"
+msgstr "操作已取消"
+
+msgid "Bad CA certificate"
+msgstr "不良的 CA 憑證"
+
+msgid "Certificate expired"
+msgstr "憑證已逾期"
+
+msgid "Certificate too young"
+msgstr "憑證太年輕"
+
+msgid "Unsupported certificate"
+msgstr "未支援的憑證"
+
+msgid "Unknown S-expression"
+msgstr "未知的 S-表示式"
+
+msgid "Unsupported protection"
+msgstr "未支援的保護"
+
+msgid "Corrupted protection"
+msgstr "損毀的保護"
+
+msgid "Ambiguous name"
+msgstr "模糊曖昧的名稱"
+
+msgid "Card error"
+msgstr "卡片錯誤"
+
+msgid "Card reset required"
+msgstr "卡片需要重設"
+
+msgid "Card removed"
+msgstr "卡片已移除"
+
+msgid "Invalid card"
+msgstr "無效的卡片"
+
+msgid "Card not present"
+msgstr "卡片不存在"
+
+msgid "No PKCS15 application"
+msgstr "沒有 PKCS15 應用程式"
+
+msgid "Not confirmed"
+msgstr "未確認"
+
+msgid "Configuration error"
+msgstr "組態錯誤"
+
+msgid "No policy match"
+msgstr "沒有相符的政策"
+
+msgid "Invalid index"
+msgstr "無效的索引"
+
+msgid "Invalid ID"
+msgstr "無效的 ID"
+
+msgid "No SmartCard daemon"
+msgstr "沒有智慧卡服務"
+
+msgid "SmartCard daemon error"
+msgstr "智慧卡服務錯誤"
+
+msgid "Unsupported protocol"
+msgstr "未支援的協定"
+
+msgid "Bad PIN method"
+msgstr "不良的個人識別碼方法"
+
+msgid "Card not initialized"
+msgstr "卡片無法初始化"
+
+msgid "Unsupported operation"
+msgstr "未支援的操作"
+
+msgid "Wrong key usage"
+msgstr "錯誤的金鑰用法"
+
+msgid "Nothing found"
+msgstr "找不到任何東西"
+
+msgid "Wrong blob type"
+msgstr "錯誤的二進位大型物件類型"
+
+msgid "Missing value"
+msgstr "遺失值"
+
+msgid "Hardware problem"
+msgstr "硬體問題"
+
+msgid "PIN blocked"
+msgstr "個人識別碼已擋掉"
+
+msgid "Conditions of use not satisfied"
+msgstr "使用條件未滿足"
+
+msgid "PINs are not synced"
+msgstr "個人識別碼未同步"
+
+msgid "Invalid CRL"
+msgstr "無效的 CRL"
+
+msgid "BER error"
+msgstr "BER 錯誤"
+
+msgid "Invalid BER"
+msgstr "無效的 BER"
+
+msgid "Element not found"
+msgstr "找不到元素"
+
+msgid "Identifier not found"
+msgstr "找不到識別符"
+
+msgid "Invalid tag"
+msgstr "無效的標籤"
+
+msgid "Invalid length"
+msgstr "無效的長度"
+
+msgid "Invalid key info"
+msgstr "無效的金鑰資訊"
+
+msgid "Unexpected tag"
+msgstr "未預期的標籤"
+
+msgid "Not DER encoded"
+msgstr "未經 DER 編碼"
+
+msgid "No CMS object"
+msgstr "不是 CMS 物件"
+
+msgid "Invalid CMS object"
+msgstr "無效的 CMS 物件"
+
+msgid "Unknown CMS object"
+msgstr "未知的 CMS 物件"
+
+msgid "Unsupported CMS object"
+msgstr "未支援的 CMS 物件"
+
+msgid "Unsupported encoding"
+msgstr "未支援的編碼"
+
+msgid "Unsupported CMS version"
+msgstr "未支援的 CMS 版本"
+
+msgid "Unknown algorithm"
+msgstr "未知的演算法"
+
+msgid "Invalid crypto engine"
+msgstr "無效的密碼法引擎"
+
+msgid "Public key not trusted"
+msgstr "公鑰未信任"
+
+msgid "Decryption failed"
+msgstr "解密失敗"
+
+msgid "Key expired"
+msgstr "金鑰已逾期"
+
+msgid "Signature expired"
+msgstr "簽章已逾期"
+
+msgid "Encoding problem"
+msgstr "編碼問題"
+
+msgid "Invalid state"
+msgstr "無效的狀態"
+
+msgid "Duplicated value"
+msgstr "重複的值"
+
+msgid "Missing action"
+msgstr "遺失行動"
+
+msgid "ASN.1 module not found"
+msgstr "找不到 ASN.1 模組"
+
+msgid "Invalid OID string"
+msgstr "無效的 OID 字串"
+
+msgid "Invalid time"
+msgstr "無效的時間"
+
+msgid "Invalid CRL object"
+msgstr "無效的 CRL 物件"
+
+msgid "Unsupported CRL version"
+msgstr "未支援的 CRL 版本"
+
+msgid "Invalid certificate object"
+msgstr "無效的憑證物件"
+
+msgid "Unknown name"
+msgstr "無效的名稱"
+
+msgid "A locale function failed"
+msgstr "本地化函數功能失敗"
+
+msgid "Not locked"
+msgstr "未鎖定"
+
+msgid "Protocol violation"
+msgstr "未依協定進行"
+
+msgid "Invalid MAC"
+msgstr "無效的 MAC"
+
+msgid "Invalid request"
+msgstr "無效的請求"
+
+msgid "Unknown extension"
+msgstr "未知的擴充"
+
+msgid "Unknown critical extension"
+msgstr "未知的關鍵擴充"
+
+msgid "Locked"
+msgstr "已鎖定"
+
+msgid "Unknown option"
+msgstr "未知的選項"
+
+msgid "Unknown command"
+msgstr "未知的指令"
+
+msgid "Not operational"
+msgstr "無法操作"
+
+msgid "No passphrase given"
+msgstr "沒有給定密語"
+
+msgid "No PIN given"
+msgstr "沒有給定個人識別碼"
+
+msgid "Not enabled"
+msgstr "未啟用"
+
+msgid "No crypto engine"
+msgstr "沒有密碼法引擎"
+
+msgid "Missing key"
+msgstr "遺失金鑰"
+
+msgid "Too many objects"
+msgstr "太多物件"
+
+msgid "Limit reached"
+msgstr "已達極限"
+
+msgid "Not initialized"
+msgstr "尚未初始化"
+
+msgid "Missing issuer certificate"
+msgstr "遺失發行者憑證"
+
+msgid "No keyserver available"
+msgstr "沒有可用的金鑰伺服器"
+
+msgid "Invalid elliptic curve"
+msgstr "無效的橢圓曲線"
+
+msgid "Unknown elliptic curve"
+msgstr "未知的橢圓曲線"
+
+msgid "Duplicated key"
+msgstr "重複的金鑰"
+
+msgid "Ambiguous result"
+msgstr "模糊曖昧的結果"
+
+msgid "No crypto context"
+msgstr "沒有密碼法脈絡"
+
+msgid "Wrong crypto context"
+msgstr "錯誤的密碼法脈絡"
+
+msgid "Bad crypto context"
+msgstr "不良的密碼法脈絡"
+
+msgid "Conflict in the crypto context"
+msgstr "密碼法脈絡衝突"
+
+msgid "Broken public key"
+msgstr "損毀的公鑰"
+
+msgid "Broken secret key"
+msgstr "損毀的私鑰"
+
+msgid "Invalid MAC algorithm"
+msgstr "無效的 MAC 演算法"
+
+msgid "Operation fully cancelled"
+msgstr "操作已完全取消"
+
+msgid "Operation not yet finished"
+msgstr "操作尚未完成"
+
+msgid "Buffer too short"
+msgstr "緩衝區太短"
+
+msgid "Invalid length specifier in S-expression"
+msgstr "S-表示式中的無效長度指定符"
+
+msgid "String too long in S-expression"
+msgstr "S-表示式中的字串太長"
+
+msgid "Unmatched parentheses in S-expression"
+msgstr "S-表示式中的括號未成對"
+
+msgid "S-expression not canonical"
+msgstr "S-表示式並非標準型"
+
+msgid "Bad character in S-expression"
+msgstr "S-表示式中有不良的字符"
+
+msgid "Bad quotation in S-expression"
+msgstr "S-表示式中有不良的引號"
+
+msgid "Zero prefix in S-expression"
+msgstr "S-表示式中零前綴"
+
+msgid "Nested display hints in S-expression"
+msgstr "S-表示式中巢狀使用顯示提示符號"
+
+msgid "Unmatched display hints"
+msgstr "未成對的顯示提示符號"
+
+msgid "Unexpected reserved punctuation in S-expression"
+msgstr "S-表示式中有未預期的保留符號"
+
+msgid "Bad hexadecimal character in S-expression"
+msgstr "S-表示式中有不良的十六進制字符"
+
+msgid "Odd hexadecimal numbers in S-expression"
+msgstr "S-表示式中有奇怪的十六進制數字"
+
+msgid "Bad octal character in S-expression"
+msgstr "S-表示式中有不良的八進制字符"
+
+msgid "All subkeys are expired or revoked"
+msgstr ""
+
+#, fuzzy
+#| msgid "Data not encrypted"
+msgid "Database is corrupted"
+msgstr "資料未經加密"
+
+msgid "Server indicated a failure"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "No name"
+msgstr "無效的名稱"
+
+#, fuzzy
+#| msgid "No public key"
+msgid "No key"
+msgstr "沒有公鑰"
+
+msgid "Legacy key"
+msgstr ""
+
+#, fuzzy
+#| msgid "Buffer too short"
+msgid "Request too short"
+msgstr "緩衝區太短"
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "Request too long"
+msgstr "列太長"
+
+msgid "Object is in termination state"
+msgstr ""
+
+msgid "No certificate chain"
+msgstr "沒有憑證鏈"
+
+msgid "Certificate is too large"
+msgstr "憑證太大"
+
+msgid "Invalid record"
+msgstr "無效的紀錄"
+
+msgid "The MAC does not verify"
+msgstr "MAC 未驗證"
+
+msgid "Unexpected message"
+msgstr "未預期的訊息"
+
+msgid "Compression or decompression failed"
+msgstr "壓縮或解壓縮失敗"
+
+msgid "A counter would wrap"
+msgstr "計數程式會疊加"
+
+msgid "Fatal alert message received"
+msgstr "已收到嚴重警告訊息"
+
+msgid "No cipher algorithm"
+msgstr "沒有密碼演算法"
+
+msgid "Missing client certificate"
+msgstr "遺失用戶端憑證"
+
+msgid "Close notification received"
+msgstr "已收到關閉通知"
+
+msgid "Ticket expired"
+msgstr "進入權已逾期"
+
+msgid "Bad ticket"
+msgstr "不良的進入權"
+
+msgid "Unknown identity"
+msgstr "未知的身分"
+
+msgid "Bad certificate message in handshake"
+msgstr "交握中的不良憑證訊息"
+
+msgid "Bad certificate request message in handshake"
+msgstr "交握中的不良憑證請求訊息"
+
+msgid "Bad certificate verify message in handshake"
+msgstr "交握中的不良憑證驗證訊息"
+
+msgid "Bad change cipher message in handshake"
+msgstr "交握中的不良變更密碼法訊息"
+
+msgid "Bad client hello message in handshake"
+msgstr "交握中的不良用戶端問候訊息"
+
+msgid "Bad server hello message in handshake"
+msgstr "交握中的不良伺服器問候訊息"
+
+msgid "Bad server hello done message in handshake"
+msgstr "交握中的不良伺服器問候完成訊息"
+
+msgid "Bad finished message in handshake"
+msgstr "交握中的不良已完成訊息"
+
+msgid "Bad server key exchange message in handshake"
+msgstr "交握中的不良伺服器金鑰交換訊息"
+
+msgid "Bad client key exchange message in handshake"
+msgstr "交握中的不良用戶端金鑰交換訊息"
+
+msgid "Bogus string"
+msgstr "假造的字串"
+
+msgid "Forbidden"
+msgstr ""
+
+msgid "Key disabled"
+msgstr "金鑰已停用"
+
+msgid "Not possible with a card based key"
+msgstr "不可能以卡片式金鑰進行"
+
+msgid "Invalid lock object"
+msgstr "無效的鎖定物件"
+
+msgid "True"
+msgstr ""
+
+msgid "False"
+msgstr ""
+
+msgid "General IPC error"
+msgstr "一般性的 IPC 錯誤"
+
+msgid "IPC accept call failed"
+msgstr "IPC 接受叫用失敗"
+
+msgid "IPC connect call failed"
+msgstr "IPC 連線叫用失敗"
+
+msgid "Invalid IPC response"
+msgstr "無效的 IPC 回應"
+
+msgid "Invalid value passed to IPC"
+msgstr "遞送至 IPC 的值無效"
+
+msgid "Incomplete line passed to IPC"
+msgstr "遞送至 IPC 的列不完整"
+
+msgid "Line passed to IPC too long"
+msgstr "遞送至 IPC 的列太長"
+
+msgid "Nested IPC commands"
+msgstr "巢狀 IPC 指令"
+
+msgid "No data callback in IPC"
+msgstr "IPC 中沒有資料回呼"
+
+msgid "No inquire callback in IPC"
+msgstr "IPC 中沒有查詢回呼"
+
+msgid "Not an IPC server"
+msgstr "不是 IPC 伺服器"
+
+msgid "Not an IPC client"
+msgstr "不是 IPC 用戶端"
+
+msgid "Problem starting IPC server"
+msgstr "啟動 IPC 伺服器時發生問題"
+
+msgid "IPC read error"
+msgstr "IPC 讀取錯誤"
+
+msgid "IPC write error"
+msgstr "IPC 寫入錯誤"
+
+msgid "Too much data for IPC layer"
+msgstr "IPC 層有太多資料"
+
+msgid "Unexpected IPC command"
+msgstr "未預期的 IPC 指令"
+
+msgid "Unknown IPC command"
+msgstr "未知的 IPC 指令"
+
+msgid "IPC syntax error"
+msgstr "IPC 語法錯誤"
+
+msgid "IPC call has been cancelled"
+msgstr "IPC 叫用已取消"
+
+msgid "No input source for IPC"
+msgstr "沒有 IPC 的輸入來源"
+
+msgid "No output source for IPC"
+msgstr "沒有 IPC 的輸出來源"
+
+msgid "IPC parameter error"
+msgstr "IPC 參數錯誤"
+
+msgid "Unknown IPC inquire"
+msgstr "未知的 IPC 查詢"
+
+#, fuzzy
+#| msgid "No crypto engine"
+msgid "Crypto engine too old"
+msgstr "沒有密碼法引擎"
+
+msgid "Screen or window too small"
+msgstr ""
+
+msgid "Screen or window too large"
+msgstr ""
+
+msgid "Required environment variable not set"
+msgstr ""
+
+msgid "User ID already exists"
+msgstr ""
+
+msgid "Name already exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Duplicated value"
+msgid "Duplicated name"
+msgstr "重複的值"
+
+#, fuzzy
+#| msgid "Certificate too young"
+msgid "Object is too young"
+msgstr "憑證太年輕"
+
+#, fuzzy
+#| msgid "Provided object is too short"
+msgid "Object is too old"
+msgstr "提供的物件太短"
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Unknown flag"
+msgstr "無效的名稱"
+
+#, fuzzy
+#| msgid "Invalid operation code"
+msgid "Invalid execution order"
+msgstr "無效的操作碼"
+
+msgid "Already fetched"
+msgstr ""
+
+msgid "Try again later"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown name"
+msgid "Wrong name"
+msgstr "無效的名稱"
+
+msgid "System bug detected"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown system error"
+msgid "Unknown DNS error"
+msgstr "未知的系統錯誤"
+
+#, fuzzy
+#| msgid "Invalid OID string"
+msgid "Invalid DNS section"
+msgstr "無效的 OID 字串"
+
+#, fuzzy
+#| msgid "Invalid S-expression"
+msgid "Invalid textual address form"
+msgstr "無效的 S-表示式"
+
+#, fuzzy
+#| msgid "Missing issuer certificate"
+msgid "Missing DNS query packet"
+msgstr "遺失發行者憑證"
+
+msgid "Missing DNS answer packet"
+msgstr ""
+
+msgid "Connection closed in DNS"
+msgstr ""
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "Verification failed in DNS"
+msgstr "解密失敗"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "DNS Timeout"
+msgstr "逾時"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "General LDAP error"
+msgstr "一般性的 IPC 錯誤"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP attribute error"
+msgstr "一般錯誤"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP name error"
+msgstr "一般錯誤"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP security error"
+msgstr "一般性的 Assuan 錯誤"
+
+#, fuzzy
+#| msgid "General error"
+msgid "General LDAP service error"
+msgstr "一般錯誤"
+
+#, fuzzy
+#| msgid "General Assuan error"
+msgid "General LDAP update error"
+msgstr "一般性的 Assuan 錯誤"
+
+msgid "Experimental LDAP error code"
+msgstr ""
+
+#, fuzzy
+#| msgid "IPC write error"
+msgid "Private LDAP error code"
+msgstr "IPC 寫入錯誤"
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other general LDAP error"
+msgstr "一般性的 IPC 錯誤"
+
+#, fuzzy
+#| msgid "IPC connect call failed"
+msgid "LDAP connecting failed (X)"
+msgstr "IPC 連線叫用失敗"
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral limit exceeded"
+msgstr "一般錯誤"
+
+msgid "LDAP client loop"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "No LDAP results returned"
+msgstr "卡片需要重設"
+
+#, fuzzy
+#| msgid "Element not found"
+msgid "LDAP control not found"
+msgstr "找不到元素"
+
+#, fuzzy
+#| msgid "Not supported"
+msgid "Not supported by LDAP"
+msgstr "未支援"
+
+#, fuzzy
+#| msgid "Unexpected error"
+msgid "LDAP connect error"
+msgstr "未預期的錯誤"
+
+msgid "Out of memory in LDAP"
+msgstr ""
+
+msgid "Bad parameter to an LDAP routine"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported operation"
+msgid "User cancelled LDAP operation"
+msgstr "未支援的操作"
+
+#, fuzzy
+#| msgid "Bad certificate"
+msgid "Bad LDAP search filter"
+msgstr "不良的憑證"
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "Unknown LDAP authentication method"
+msgstr "未知的擴充"
+
+#, fuzzy
+#| msgid "Timeout"
+msgid "Timeout in LDAP"
+msgstr "逾時"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP decoding error"
+msgstr "dirmngr 錯誤"
+
+#, fuzzy
+#| msgid "dirmngr error"
+msgid "LDAP encoding error"
+msgstr "dirmngr 錯誤"
+
+#, fuzzy
+#| msgid "IPC read error"
+msgid "LDAP local error"
+msgstr "IPC 讀取錯誤"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot contact LDAP server"
+msgstr "不是 IPC 伺服器"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP success"
+msgstr "成功"
+
+#, fuzzy
+#| msgid "Configuration error"
+msgid "LDAP operations error"
+msgstr "組態錯誤"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP protocol error"
+msgstr "未依協定進行"
+
+msgid "Time limit exceeded in LDAP"
+msgstr ""
+
+msgid "Size limit exceeded in LDAP"
+msgstr ""
+
+msgid "LDAP compare false"
+msgstr ""
+
+msgid "LDAP compare true"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unknown extension"
+msgid "LDAP authentication method not supported"
+msgstr "未知的擴充"
+
+msgid "Strong(er) LDAP authentication required"
+msgstr ""
+
+#, fuzzy
+#| msgid "Fatal alert message received"
+msgid "Partial LDAP results+referral received"
+msgstr "已收到嚴重警告訊息"
+
+#, fuzzy
+#| msgid "General error"
+msgid "LDAP referral"
+msgstr "一般錯誤"
+
+msgid "Administrative LDAP limit exceeded"
+msgstr ""
+
+msgid "Critical LDAP extension is unavailable"
+msgstr ""
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Confidentiality required by LDAP"
+msgstr "卡片需要重設"
+
+msgid "LDAP SASL bind in progress"
+msgstr ""
+
+msgid "No such LDAP attribute"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid attribute"
+msgid "Undefined LDAP attribute type"
+msgstr "無效的屬性"
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate matching in LDAP"
+msgstr "未支援的保護"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Constraint violation in LDAP"
+msgstr "未依協定進行"
+
+msgid "LDAP type or value exists"
+msgstr ""
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid syntax in LDAP"
+msgstr "無效的狀態"
+
+#, fuzzy
+#| msgid "No CMS object"
+msgid "No such LDAP object"
+msgstr "不是 CMS 物件"
+
+#, fuzzy
+#| msgid "Hardware problem"
+msgid "LDAP alias problem"
+msgstr "硬體問題"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid DN syntax in LDAP"
+msgstr "無效的狀態"
+
+msgid "LDAP entry is a leaf"
+msgstr ""
+
+#, fuzzy
+#| msgid "Encoding problem"
+msgid "LDAP alias dereferencing problem"
+msgstr "編碼問題"
+
+msgid "LDAP proxy authorization failure (X)"
+msgstr ""
+
+#, fuzzy
+#| msgid "Unsupported protection"
+msgid "Inappropriate LDAP authentication"
+msgstr "未支援的保護"
+
+#, fuzzy
+#| msgid "Invalid card"
+msgid "Invalid LDAP credentials"
+msgstr "無效的卡片"
+
+msgid "Insufficient access for LDAP"
+msgstr ""
+
+msgid "LDAP server is busy"
+msgstr ""
+
+#, fuzzy
+#| msgid "No keyserver available"
+msgid "LDAP server is unavailable"
+msgstr "沒有可用的金鑰伺服器"
+
+msgid "LDAP server is unwilling to perform"
+msgstr ""
+
+msgid "Loop detected by LDAP"
+msgstr ""
+
+#, fuzzy
+#| msgid "Missing action"
+msgid "LDAP naming violation"
+msgstr "遺失行動"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "LDAP object class violation"
+msgstr "未依協定進行"
+
+#, fuzzy
+#| msgid "Operation not yet finished"
+msgid "LDAP operation not allowed on non-leaf"
+msgstr "操作尚未完成"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation not allowed on RDN"
+msgstr "操作已取消"
+
+msgid "Already exists (LDAP)"
+msgstr ""
+
+msgid "Cannot modify LDAP object class"
+msgstr ""
+
+#, fuzzy
+#| msgid "Line too long"
+msgid "LDAP results too large"
+msgstr "列太長"
+
+#, fuzzy
+#| msgid "Operation cancelled"
+msgid "LDAP operation affects multiple DSAs"
+msgstr "操作已取消"
+
+msgid "Virtual LDAP list view error"
+msgstr ""
+
+#, fuzzy
+#| msgid "General IPC error"
+msgid "Other LDAP error"
+msgstr "一般性的 IPC 錯誤"
+
+#, fuzzy
+#| msgid "Resources exhausted"
+msgid "Resources exhausted in LCUP"
+msgstr "資源已耗盡"
+
+#, fuzzy
+#| msgid "Protocol violation"
+msgid "Security violation in LCUP"
+msgstr "未依協定進行"
+
+#, fuzzy
+#| msgid "Invalid state"
+msgid "Invalid data in LCUP"
+msgstr "無效的狀態"
+
+#, fuzzy
+#| msgid "Unsupported certificate"
+msgid "Unsupported scheme in LCUP"
+msgstr "未支援的憑證"
+
+#, fuzzy
+#| msgid "Card reset required"
+msgid "Reload required in LCUP"
+msgstr "卡片需要重設"
+
+#, fuzzy
+#| msgid "Success"
+msgid "LDAP cancelled"
+msgstr "成功"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "No LDAP operation to cancel"
+msgstr "無法操作"
+
+#, fuzzy
+#| msgid "Not operational"
+msgid "Too late to cancel LDAP"
+msgstr "無法操作"
+
+#, fuzzy
+#| msgid "Not an IPC server"
+msgid "Cannot cancel LDAP"
+msgstr "不是 IPC 伺服器"
+
+#, fuzzy
+#| msgid "Decryption failed"
+msgid "LDAP assertion failed"
+msgstr "解密失敗"
+
+msgid "Proxied authorization denied by LDAP"
+msgstr ""
+
+msgid "User defined error code 1"
+msgstr "使用者定義錯誤代碼 1"
+
+msgid "User defined error code 2"
+msgstr "使用者定義錯誤代碼 2"
+
+msgid "User defined error code 3"
+msgstr "使用者定義錯誤代碼 3"
+
+msgid "User defined error code 4"
+msgstr "使用者定義錯誤代碼 4"
+
+msgid "User defined error code 5"
+msgstr "使用者定義錯誤代碼 5"
+
+msgid "User defined error code 6"
+msgstr "使用者定義錯誤代碼 6"
+
+msgid "User defined error code 7"
+msgstr "使用者定義錯誤代碼 7"
+
+msgid "User defined error code 8"
+msgstr "使用者定義錯誤代碼 8"
+
+msgid "User defined error code 9"
+msgstr "使用者定義錯誤代碼 9"
+
+msgid "User defined error code 10"
+msgstr "使用者定義錯誤代碼 10"
+
+msgid "User defined error code 11"
+msgstr "使用者定義錯誤代碼 11"
+
+msgid "User defined error code 12"
+msgstr "使用者定義錯誤代碼 12"
+
+msgid "User defined error code 13"
+msgstr "使用者定義錯誤代碼 13"
+
+msgid "User defined error code 14"
+msgstr "使用者定義錯誤代碼 14"
+
+msgid "User defined error code 15"
+msgstr "使用者定義錯誤代碼 15"
+
+msgid "User defined error code 16"
+msgstr "使用者定義錯誤代碼 16"
+
+msgid "System error w/o errno"
+msgstr "系統錯誤但是沒有 errno"
+
+msgid "Unknown system error"
+msgstr "未知的系統錯誤"
+
+msgid "End of file"
+msgstr "檔案結尾"
+
+msgid "Unknown error code"
+msgstr "未知的錯誤代碼"
+
+#, c-format
+msgid "Usage: %s GPG-ERROR [...]\n"
+msgstr "用法: %s GPG-ERROR [...]\n"
+
+#, c-format
+msgid "%s: warning: could not recognize %s\n"
+msgstr "%s: 警告: 無法辨識 %s\n"
+
+#, fuzzy
+#~| msgid "Resources exhausted"
+#~ msgid "LCUP Resources exhausted"
+#~ msgstr "資源已耗盡"
+
+#, fuzzy
+#~| msgid "Invalid data"
+#~ msgid "LCUP Invalid data"
+#~ msgstr "無效的資料"
+
+#, fuzzy
+#~| msgid "General error"
+#~ msgid "LDAP Other general error"
+#~ msgstr "一般錯誤"
+
+#, fuzzy
+#~| msgid "dirmngr error"
+#~ msgid "Encoding error"
+#~ msgstr "dirmngr 錯誤"
diff --git a/potomo b/potomo
new file mode 100755
index 0000000..2061728
--- /dev/null
+++ b/potomo
@@ -0,0 +1,64 @@
+#!/bin/sh
+# potomo - Convert a .po file to an utf-8 encoded .mo file.
+# Copyright 2008 g10 Code GmbH
+# Copyright 2010 Free Software Foundation, Inc.
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This file 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.
+
+# This script is used to create the mo files for applications using
+# the simple gettext implementation provided by libgpg-error. That
+# gettext can only cope with utf-8 encoded mo files; thus we make this
+# sure while creating the mo. A conversion is not done if the source
+# file does not exist or if it is not newer than the mo file.
+
+if [ "$1" = "--get-linguas" -a $# -eq 2 ]; then
+ if [ ! -f "$2/LINGUAS" ]; then
+ echo "potomo: directory '$2' has no LINGUAS file" >&2
+ exit 1
+ fi
+ echo $(sed -e "/^#/d" -e "s/#.*//" "$2"/LINGUAS)
+ exit 0
+fi
+
+if [ $# -ne 2 ]; then
+ echo "usage: potomo INFILE.PO OUTFILE.MO" >&2
+ echo " potomo --get-linguas DIR" >&2
+ exit 1
+fi
+infile="$1"
+outfile="$2"
+
+if [ ! -f "$infile" ]; then
+ echo "potomo: '$infile' not found - ignored" 2>&1
+ exit 0
+fi
+
+if [ "$outfile" -nt "$infile" ]; then
+ echo "potomo: '$outfile' is newer than source - keeping" 2>&1
+ exit 0
+fi
+
+# Note that we could use the newer msgconv. However this tool was not
+# widely available back in 2008.
+
+fromset=`sed -n '/^"Content-Type:/ s/.*charset=\([a-zA-Z0-9_-]*\).*/\1/p' \
+ "$infile"`
+
+case "$fromset" in
+ utf8|utf-8|UTF8|UTF-8)
+ echo "potomo: '$infile' keeping $fromset" >&2
+ msgfmt --output-file="$outfile" "$infile"
+ ;;
+ *)
+ echo "potomo: '$infile' converting from $fromset to utf-8" >&2
+ iconv --silent --from-code=$fromset --to-code=utf-8 < "$infile" |\
+ sed "/^\"Content-Type:/ s/charset=[a-zA-Z0-9_-]*/charset=utf-8/"|\
+ msgfmt --output-file="$outfile" -
+ ;;
+esac
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..e4ebb6a
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,317 @@
+# Makefile.am for libgpg-error.
+# Copyright (C) 2003, 2004, 2014 g10 Code GmbH
+#
+# This file is part of libgpg-error.
+#
+# libgpg-error is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of the
+# License, or (at your option) any later version.
+#
+# libgpg-error is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, see <https://www.gnu.org/licenses/>.
+
+# We distribute the generated sources err-sources.h and err-codes.h,
+# because they are needed to build the po directory, and they don't
+# depend on the configuration anyway.
+
+
+if HAVE_W32CE_SYSTEM
+gpg_extra_headers = gpg-extra/errno.h
+extra_cppflags = -idirafter gpg-extra
+else
+gpg_extra_headers =
+extra_cppflags =
+endif
+
+localedir = $(datadir)/locale
+
+bin_PROGRAMS = gpg-error
+
+if HAVE_W32_SYSTEM
+noinst_PROGRAMS = gen-w32-lock-obj
+else
+noinst_PROGRAMS = gen-posix-lock-obj
+endif
+
+# Distributed lock object definitions for cross compilation.
+lock_obj_pub = \
+ syscfg/lock-obj-pub.aarch64-unknown-linux-gnu.h \
+ syscfg/lock-obj-pub.aarch64-apple-darwin.h \
+ syscfg/lock-obj-pub.alpha-unknown-linux-gnu.h \
+ syscfg/lock-obj-pub.arm-unknown-linux-androideabi.h \
+ syscfg/lock-obj-pub.arm-unknown-linux-gnueabi.h \
+ syscfg/lock-obj-pub.arm-apple-darwin.h \
+ syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h \
+ syscfg/lock-obj-pub.i386-apple-darwin.h \
+ syscfg/lock-obj-pub.i686-pc-gnu.h \
+ syscfg/lock-obj-pub.i686-pc-kfreebsd-gnu.h \
+ syscfg/lock-obj-pub.i686-pc-linux-gnu.h \
+ syscfg/lock-obj-pub.m68k-unknown-linux-gnu.h \
+ syscfg/lock-obj-pub.mips-unknown-linux-gnu.h \
+ syscfg/lock-obj-pub.mips64el-unknown-linux-gnuabi64.h \
+ syscfg/lock-obj-pub.mipsel-unknown-linux-gnu.h \
+ syscfg/lock-obj-pub.nios2-unknown-linux-gnu.h \
+ syscfg/lock-obj-pub.or1k-unknown-linux-gnu.h \
+ syscfg/lock-obj-pub.powerpc-unknown-linux-gnu.h \
+ syscfg/lock-obj-pub.powerpc64-unknown-linux-gnu.h \
+ syscfg/lock-obj-pub.powerpc64le-unknown-linux-gnu.h \
+ syscfg/lock-obj-pub.powerpc-unknown-linux-gnuspe.h \
+ syscfg/lock-obj-pub.s390x-ibm-linux-gnu.h \
+ syscfg/lock-obj-pub.sh3-unknown-linux-gnu.h \
+ syscfg/lock-obj-pub.sh4-unknown-linux-gnu.h \
+ syscfg/lock-obj-pub.sparc-unknown-linux-gnu.h \
+ syscfg/lock-obj-pub.sparc64-unknown-linux-gnu.h \
+ syscfg/lock-obj-pub.x86_64-apple-darwin.h \
+ syscfg/lock-obj-pub.x86_64-pc-kfreebsd-gnu.h \
+ syscfg/lock-obj-pub.x86_64-pc-linux-gnu.h \
+ syscfg/lock-obj-pub.x86_64-pc-linux-gnux32.h \
+ syscfg/lock-obj-pub.x86_64-pc-linux-musl.h \
+ syscfg/lock-obj-pub.tilegx-unknown-linux-gnu.h \
+ syscfg/lock-obj-pub.ia64-unknown-linux-gnu.h \
+ syscfg/lock-obj-pub.mingw32.h
+
+
+lib_LTLIBRARIES = libgpg-error.la
+nodist_include_HEADERS = gpg-error.h gpgrt.h
+bin_SCRIPTS = gpg-error-config
+m4datadir = $(datadir)/aclocal
+m4data_DATA = gpg-error.m4
+
+EXTRA_DIST = mkstrtable.awk err-sources.h.in err-codes.h.in \
+ mkerrnos.awk errnos.in README \
+ mkerrcodes.awk mkerrcodes1.awk mkerrcodes2.awk mkerrcodes.c \
+ mkheader.c gpg-error.h.in mkw32errmap.c w32-add.h w32ce-add.h \
+ err-sources.h err-codes.h gpg-error-config.in gpg-error.m4 \
+ gpg-error.vers gpg-error.def.in \
+ versioninfo.rc.in gpg-error.w32-manifest.in \
+ $(lock_obj_pub)
+
+BUILT_SOURCES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \
+ err-sources-sym.h err-codes-sym.h errnos-sym.h gpg-error.h gpgrt.h \
+ gpg-error.def mkw32errmap.map.c
+
+tmp_files = _mkerrcodes.h _gpg-error.def.h mkw32errmap.tab.h mkw32errmap.map.c
+
+CLEANFILES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \
+ gpg-error.h gpgrt.h \
+ mkerrcodes mkerrcodes.h gpg-error.def mkw32errmap.tab.h \
+ mkw32errmap.map.c err-sources-sym.h err-codes-sym.h errnos-sym.h \
+ gpg-extra/errno.h mkheader $(tmp_files) lock-obj-pub.native.h
+
+
+#
+# {{{ Begin Windows part
+#
+if HAVE_W32_SYSTEM
+arch_sources = w32-gettext.c w32-lock.c w32-lock-obj.h w32-thread.c \
+ w32-iconv.c w32-estream.c
+RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ -DLOCALEDIR=\"$(localedir)\" $(AM_CPPFLAGS) $(CPPFLAGS)
+LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE)
+
+SUFFIXES = .rc .lo
+
+.rc.lo:
+ $(LTRCCOMPILE) -i "$<" -o "$@"
+
+gpg_error_res = versioninfo.lo
+no_undefined = -no-undefined
+export_symbols = -export-symbols gpg-error.def
+# i686-w64-mingw32.gcc version 4.9.1 takes the long long helper
+# functions from libgcc_s_sjlj-1.dll and not from a static libgcc. As
+# a plain C program we do not use exception handler and thus there is
+# no need to use this DLL. Thus we force gcc to link that statically.
+extra_ltoptions = -XCClinker -static-libgcc
+
+versioninfo.lo : gpg-error.w32-manifest
+
+install-def-file: gpg-error.def
+ -$(INSTALL) -d $(DESTDIR)$(libdir)
+ $(INSTALL) gpg-error.def $(DESTDIR)$(libdir)/gpg-error.def
+
+uninstall-def-file:
+ -rm $(DESTDIR)$(libdir)/gpg-error.def
+
+libgpg_error_la_DEPENDENCIES = $(gpg_error_res) gpg-error.def
+intllibs =
+
+#
+# }}} End Windows part
+#
+else
+#
+# {{{ Begin Unix part
+#
+arch_sources = posix-lock.c posix-lock-obj.h posix-thread.c
+gpg_error_res =
+no_undefined =
+export_symbols =
+extra_ltoptions =
+
+install-def-file:
+uninstall-def-file:
+
+intllibs = @LTLIBINTL@
+
+endif
+#
+# }}} End Unix part
+#
+
+if HAVE_LD_VERSION_SCRIPT
+ libgpg_error_vers_opt = -Wl,--version-script=$(srcdir)/gpg-error.vers
+else
+ libgpg_error_vers_opt =
+endif
+
+libgpg_error_la_LDFLAGS = \
+ $(no_undefined) $(export_symbols) $(libgpg_error_vers_opt) \
+ $(extra_ltoptions) -version-info \
+ @LIBGPG_ERROR_LT_CURRENT@:@LIBGPG_ERROR_LT_REVISION@:@LIBGPG_ERROR_LT_AGE@
+
+libgpg_error_la_SOURCES = gettext.h $(arch_sources) \
+ gpgrt-int.h init.c init.h version.c lock.h thread.h \
+ estream.c estream-printf.c estream-printf.h \
+ strsource.c strerror.c code-to-errno.c code-from-errno.c \
+ visibility.c visibility.h b64dec.c
+nodist_libgpg_error_la_SOURCES = gpg-error.h
+
+# libgpg_error_la_DEPENDENCIES = \
+# $(srcdir)/gpg-error.vers
+
+# Note that RCCOMPILE needs the same defines as ..._la_CPPFLAGS but
+# without the extra_cppflags because they may include am -idirafter
+# which is not supported by the RC compiler.
+libgpg_error_la_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" $(extra_cppflags)
+libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) $(LIBTHREAD)
+
+gpg_error_SOURCES = strsource-sym.c strerror-sym.c gpg-error.c
+gpg_error_CPPFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" \
+ -DLOCALEDIR=\"$(localedir)\" $(extra_cppflags)
+gpg_error_LDADD = ./libgpg-error.la $(LTLIBINTL)
+
+# We build err-sources.h and err-codes.h in the source directory.
+# This is needed because gettext does only look into the source
+# directory to find the files listed in po/POTFILE.in. To make these
+# rules work we also need to depend on Makefile.am and not on the
+# generated files Makefile.in or Makefile.
+$(srcdir)/err-sources.h: Makefile.am mkstrtable.awk err-sources.h.in
+ $(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=3 \
+ $(srcdir)/err-sources.h.in >$@
+
+err-sources-sym.h: Makefile mkstrtable.awk err-sources.h.in
+ $(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=2 -v nogettext=1 \
+ $(srcdir)/err-sources.h.in >$@
+
+$(srcdir)/err-codes.h: Makefile.am mkstrtable.awk err-codes.h.in
+ $(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=3 \
+ $(srcdir)/err-codes.h.in >$@
+
+err-codes-sym.h: Makefile mkstrtable.awk err-codes.h.in
+ $(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=2 -v nogettext=1 \
+ $(srcdir)/err-codes.h.in >$@
+
+code-to-errno.h: Makefile mkerrnos.awk errnos.in
+ $(AWK) -f $(srcdir)/mkerrnos.awk $(srcdir)/errnos.in >$@
+
+# It is correct to use $(CPP). We want the host's idea of the error codes.
+mkerrcodes.h: Makefile mkerrcodes.awk $(gpg_extra_headers)
+ $(AWK) -f $(srcdir)/mkerrcodes1.awk $(srcdir)/errnos.in >_$@
+ $(CPP) $(CPPFLAGS) $(extra_cppflags) -P _$@ | grep GPG_ERR_ | \
+ $(AWK) -f $(srcdir)/mkerrcodes.awk >$@
+ -rm _$@
+
+if HAVE_W32CE_SYSTEM
+# It is correct to use $(CPP). We want the host's idea of the error codes.
+mkw32errmap.tab.h: Makefile mkw32errmap.c
+ $(CPP) -DRESOLVE_MACROS $(srcdir)/mkw32errmap.c | \
+ grep '{&mkw32errmap_marker' >$@
+mkw32errmap.map.c: mkw32errmap
+ ./mkw32errmap --map > $@
+gpg-extra/errno.h: mkw32errmap
+ -$(MKDIR_P) gpg-extra
+ ./mkw32errmap > $@
+else
+mkw32errmap.map.c:
+ echo "/*dummy*/" > $@
+endif
+
+# We use CC proper for preprocessing thus we have to convince it that
+# the data is really to be preprocessed.
+gpg-error.def: Makefile gpg-error.def.in
+ cat $(srcdir)/gpg-error.def.in >[email protected]
+ $(CPP) $(DEFAULT_INCLUDES) $(INCLUDES) $(extra_cppflags) [email protected] | \
+ grep -v '^#' >$@
+
+# It is correct to use $(CC_FOR_BUILD) here. We want to run the
+# program at build time.
+mkerrcodes: mkerrcodes.c mkerrcodes.h Makefile
+ $(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkerrcodes.c
+
+if HAVE_W32CE_SYSTEM
+# It is correct to use $(CC_FOR_BUILD) here. We want to run the
+# program at build time.
+mkw32errmap: mkw32errmap.c mkw32errmap.tab.h Makefile
+ $(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkw32errmap.c
+endif
+
+code-from-errno.h: mkerrcodes Makefile
+ ./mkerrcodes | $(AWK) -f $(srcdir)/mkerrcodes2.awk >$@
+
+errnos-sym.h: Makefile mkstrtable.awk errnos.in
+ $(AWK) -f $(srcdir)/mkstrtable.awk -v textidx=2 -v nogettext=1 \
+ -v prefix=GPG_ERR_ -v namespace=errnos_ \
+ $(srcdir)/errnos.in >$@
+
+
+mkheader: mkheader.c Makefile
+ $(CC_FOR_BUILD) -g -O0 -I. -I$(srcdir) -o $@ $(srcdir)/mkheader.c
+
+parts_of_gpg_error_h = \
+ gpg-error.h.in \
+ err-sources.h.in \
+ err-codes.h.in \
+ errnos.in \
+ w32-add.h \
+ w32ce-add.h \
+ $(lock_obj_pub)
+
+# If we are cross-compiling or building on Windows we better make sure
+# that no stale native lock include file will be found by mkheader.
+if FORCE_USE_SYSCFG
+pre_mkheader_cmds = if test -f lock-obj-pub.native.h; \
+ then rm lock-obj-pub.native.h; fi
+else
+pre_mkheader_cmds = :
+parts_of_gpg_error_h += ./lock-obj-pub.native.h
+
+./lock-obj-pub.native.h: Makefile gen-posix-lock-obj$(EXEEXT) posix-lock-obj.h
+ ./gen-posix-lock-obj >$@
+endif
+
+# We also depend on versioninfo.rc because that is build by
+# config.status and thus has up-to-date version numbers.
+gpg-error.h: Makefile mkheader $(parts_of_gpg_error_h) \
+ versioninfo.rc ../config.h
+ $(pre_mkheader_cmds)
+ ./mkheader $(host_os) $(host_triplet) $(srcdir)/gpg-error.h.in \
+ ../config.h $(PACKAGE_VERSION) $(VERSION_NUMBER) >$@
+
+gpgrt.h: gpg-error.h
+ cp gpg-error.h gpgrt.h
+
+install-data-local:
+if HAVE_W32CE_SYSTEM
+ -$(MKDIR_P) "$(DESTDIR)$(includedir)/gpg-extra"
+ $(INSTALL_DATA) gpg-extra/errno.h \
+ "$(DESTDIR)$(includedir)/gpg-extra/errno.h"
+else
+ :
+endif
diff --git a/src/README b/src/README
new file mode 100644
index 0000000..c415983
--- /dev/null
+++ b/src/README
@@ -0,0 +1,47 @@
+Notes on the source code
+========================
+
+The mechanism to generate the system error codes is delicate and
+fragile, but it's the best I could come up with that supports
+cross-compilation and dynamic self-configuration. Here is how it
+works:
+
+1. Generate list of supported system error codes.
+
+mkerrcodes1.awk generates a list of supported system error codes from
+errnos.in. Each entry in the list is protected with #ifdef/#endif,
+and contains a GPG_ERR_* marker. The list is stored in "_mkerrcodes.h".
+
+2. The HOST cpp is run on _mkerrcodes.h. This evaluates the known
+system error macros to something (may be a number, maybe a constant
+expression as on the GNU/Hurd), suppressing the unknown ones. The
+output is piped into step 3.
+
+3. The cpp output is filtered with grep for only those lines which
+contain a GPG_ERR_* marker. The output is piped into step 4.
+
+4. The filtered output is processed by mkerrcodes.awk, which produces
+a table of constant expressions plus GPG_ERR_* code string symbols in
+a format suitable for the C program mkerrcodes.c. At this point we
+are crossing our fingers that the constant expressions produced by the
+system do not contain GPG_ERR_* markers. The output is stored in
+mkerrcodes.h.
+
+5. The file mkerrcodes.h is included by mkerrcodes.c, which is
+compiled to a binary executable on the BUILD system. At this point we
+are crossing our fingers that the constant expressions produced by the
+system do not depend on the build platform anymore. The output is
+post-processed by mkerrcodes2.awk and stored in "code-from-errno.h",
+which is subsequently used in the library.
+
+-- Marcus
+
+ Copyright 2006 g10 Code GmbH
+
+ This file is free software; as a special exception the author gives
+ unlimited permission to copy and/or distribute it, with or without
+ modifications, as long as this notice is preserved.
+
+ This file 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.
diff --git a/src/b64dec.c b/src/b64dec.c
new file mode 100644
index 0000000..a8a8351
--- /dev/null
+++ b/src/b64dec.c
@@ -0,0 +1,280 @@
+/* b64dec.c - Simple Base64 decoder.
+ * Copyright (C) 2008, 2011 Free Software Foundation, Inc.
+ * Copyright (C) 2008, 2011, 2016 g10 Code GmbH
+ *
+ * This file is part of GnuPG.
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include <config.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+#include "gpgrt-int.h"
+
+struct _gpgrt_b64state
+{
+ int idx;
+ int quad_count;
+ char *title;
+ unsigned char radbuf[4];
+ int stop_seen:1;
+ int invalid_encoding:1;
+ gpg_error_t lasterr;
+};
+
+/* The reverse base-64 list used for base-64 decoding. */
+static unsigned char const asctobin[128] =
+ {
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0xff, 0xff, 0x3e, 0xff, 0xff, 0xff, 0x3f,
+ 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
+ 0x3c, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
+ 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
+ 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
+ 0x17, 0x18, 0x19, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0xff, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
+ 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
+ 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
+ 0x31, 0x32, 0x33, 0xff, 0xff, 0xff, 0xff, 0xff
+ };
+
+enum decoder_states
+ {
+ s_init, s_idle, s_lfseen, s_beginseen, s_waitheader, s_waitblank, s_begin,
+ s_b64_0, s_b64_1, s_b64_2, s_b64_3,
+ s_waitendtitle, s_waitend
+ };
+
+
+
+/* Allocate and initialize the context for the base64 decoder. If
+ TITLE is NULL a plain base64 decoding is done. If it is the empty
+ string the decoder will skip everything until a "-----BEGIN " line
+ has been seen, decoding ends at a "----END " line. */
+gpgrt_b64state_t
+_gpgrt_b64dec_start (const char *title)
+{
+ gpgrt_b64state_t state;
+ char *t = NULL;
+
+ if (title)
+ {
+ t = strdup (title);
+ if (!t)
+ return NULL;
+ }
+
+ state = calloc (1, sizeof (struct _gpgrt_b64state));
+ if (!state)
+ {
+ free (t);
+ return NULL;
+ }
+
+ if (t)
+ {
+ state->title = t;
+ state->idx = s_init;
+ }
+ else
+ state->idx = s_b64_0;
+
+ return state;
+}
+
+
+/* Do in-place decoding of base-64 data of LENGTH in BUFFER. Stores the
+ new length of the buffer at R_NBYTES. */
+gpg_error_t
+_gpgrt_b64dec_proc (gpgrt_b64state_t state, void *buffer, size_t length,
+ size_t *r_nbytes)
+{
+ enum decoder_states ds = state->idx;
+ unsigned char val = state->radbuf[0];
+ int pos = state->quad_count;
+ char *d, *s;
+
+ if (state->lasterr)
+ return state->lasterr;
+
+ if (state->stop_seen)
+ {
+ *r_nbytes = 0;
+ state->lasterr = gpg_error (GPG_ERR_EOF);
+ free (state->title);
+ state->title = NULL;
+ return state->lasterr;
+ }
+
+ for (s=d=buffer; length && !state->stop_seen; length--, s++)
+ {
+ again:
+ switch (ds)
+ {
+ case s_idle:
+ if (*s == '\n')
+ {
+ ds = s_lfseen;
+ pos = 0;
+ }
+ break;
+ case s_init:
+ ds = s_lfseen;
+ /* Fall through */
+ case s_lfseen:
+ if (*s != "-----BEGIN "[pos])
+ {
+ ds = s_idle;
+ goto again;
+ }
+ else if (pos == 10)
+ {
+ pos = 0;
+ ds = s_beginseen;
+ }
+ else
+ pos++;
+ break;
+ case s_beginseen:
+ if (*s != "PGP "[pos])
+ ds = s_begin; /* Not a PGP armor. */
+ else if (pos == 3)
+ ds = s_waitheader;
+ else
+ pos++;
+ break;
+ case s_waitheader:
+ if (*s == '\n')
+ ds = s_waitblank;
+ break;
+ case s_waitblank:
+ if (*s == '\n')
+ ds = s_b64_0; /* blank line found. */
+ else if (*s == ' ' || *s == '\r' || *s == '\t')
+ ; /* Ignore spaces. */
+ else
+ {
+ /* Armor header line. Note that we don't care that our
+ * FSM accepts a header prefixed with spaces. */
+ ds = s_waitheader; /* Wait for next header. */
+ }
+ break;
+ case s_begin:
+ if (*s == '\n')
+ ds = s_b64_0;
+ break;
+ case s_b64_0:
+ case s_b64_1:
+ case s_b64_2:
+ case s_b64_3:
+ {
+ int c;
+
+ if (*s == '-' && state->title)
+ {
+ /* Not a valid Base64 character: assume end
+ header. */
+ ds = s_waitend;
+ }
+ else if (*s == '=')
+ {
+ /* Pad character: stop */
+ if (ds == s_b64_1)
+ *d++ = val;
+ ds = state->title? s_waitendtitle : s_waitend;
+ }
+ else if (*s == '\n' || *s == ' ' || *s == '\r' || *s == '\t')
+ ; /* Skip white spaces. */
+ else if ( (*s & 0x80)
+ || (c = asctobin[*(unsigned char *)s]) == 255)
+ {
+ /* Skip invalid encodings. */
+ state->invalid_encoding = 1;
+ }
+ else if (ds == s_b64_0)
+ {
+ val = c << 2;
+ ds = s_b64_1;
+ }
+ else if (ds == s_b64_1)
+ {
+ val |= (c>>4)&3;
+ *d++ = val;
+ val = (c<<4)&0xf0;
+ ds = s_b64_2;
+ }
+ else if (ds == s_b64_2)
+ {
+ val |= (c>>2)&15;
+ *d++ = val;
+ val = (c<<6)&0xc0;
+ ds = s_b64_3;
+ }
+ else
+ {
+ val |= c&0x3f;
+ *d++ = val;
+ ds = s_b64_0;
+ }
+ }
+ break;
+ case s_waitendtitle:
+ if (*s == '-')
+ ds = s_waitend;
+ break;
+ case s_waitend:
+ if ( *s == '\n')
+ state->stop_seen = 1;
+ break;
+ default:
+ assert (!"invalid state");
+ }
+ }
+
+
+ state->idx = ds;
+ state->radbuf[0] = val;
+ state->quad_count = pos;
+ *r_nbytes = (d -(char*) buffer);
+ return 0;
+}
+
+
+/* Return an error code in case an encoding error has been found
+ during decoding. */
+gpg_error_t
+_gpgrt_b64dec_finish (gpgrt_b64state_t state)
+{
+ gpg_error_t err;
+
+ if (state->lasterr)
+ err = state->lasterr;
+ else
+ {
+ free (state->title);
+ err = state->invalid_encoding? gpg_error(GPG_ERR_BAD_DATA): 0;
+ }
+ free (state);
+
+ return err;
+}
diff --git a/src/code-from-errno.c b/src/code-from-errno.c
new file mode 100644
index 0000000..6064270
--- /dev/null
+++ b/src/code-from-errno.c
@@ -0,0 +1,69 @@
+/* code-from-errno.c - Mapping errnos to error codes.
+ Copyright (C) 2003 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with libgpg-error; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <errno.h>
+
+#include <gpg-error.h>
+
+#include "code-from-errno.h"
+
+/* Retrieve the error code for the system error ERR. This returns
+ GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report
+ this). */
+gpg_err_code_t
+_gpg_err_code_from_errno (int err)
+{
+ int idx;
+
+ if (!err)
+ return GPG_ERR_NO_ERROR;
+
+ idx = errno_to_idx (err);
+
+ if (idx < 0)
+ return GPG_ERR_UNKNOWN_ERRNO;
+
+ return GPG_ERR_SYSTEM_ERROR | err_code_from_index[idx];
+}
+
+
+/* Retrieve the error code directly from the ERRNO variable. This
+ returns GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped
+ (report this) and GPG_ERR_MISSING_ERRNO if ERRNO has the value 0. */
+gpg_err_code_t
+_gpg_err_code_from_syserror (void)
+{
+ int err = errno;
+ int idx;
+
+ if (!err)
+ return GPG_ERR_MISSING_ERRNO;
+
+ idx = errno_to_idx (err);
+
+ if (idx < 0)
+ return GPG_ERR_UNKNOWN_ERRNO;
+
+ return GPG_ERR_SYSTEM_ERROR | err_code_from_index[idx];
+}
diff --git a/src/code-to-errno.c b/src/code-to-errno.c
new file mode 100644
index 0000000..6ba6d87
--- /dev/null
+++ b/src/code-to-errno.c
@@ -0,0 +1,42 @@
+/* code-to-errno.c - Mapping error codes to errnos.
+ Copyright (C) 2003 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with libgpg-error; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gpg-error.h>
+
+#include "code-to-errno.h"
+
+/* Retrieve the system error for the error code CODE. This returns 0
+ if CODE is not a system error code. */
+int
+_gpg_err_code_to_errno (gpg_err_code_t code)
+{
+ if (!(code & GPG_ERR_SYSTEM_ERROR))
+ return 0;
+ code &= ~GPG_ERR_SYSTEM_ERROR;
+
+ if (code < sizeof (err_code_to_errno) / sizeof (err_code_to_errno[0]))
+ return err_code_to_errno[code];
+ else
+ return 0;
+}
diff --git a/src/err-codes.h.in b/src/err-codes.h.in
new file mode 100644
index 0000000..2667d71
--- /dev/null
+++ b/src/err-codes.h.in
@@ -0,0 +1,481 @@
+# err-codes.h.in - List of error codes and their description input file.
+/* err-codes.h - List of error codes and their description.
+ Copyright (C) 2003, 2004 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with libgpg-error; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+# Everything up to the first line that starts with a number in the
+# first column is copied into the output verbatim. Then, empty lines
+# are ignored. Other lines must have an error code number, followed
+# by one or more <tab> characters, followed by the error code symbol,
+# followed by one or more <tab> characters, followed by the error
+# message. Trailing whitespace is removed. The error codes should be
+# sorted. The last line should not have a number, but only a <tab>,
+# followed by a dummy field, followed by a <tab>, followed by a
+# description for error codes that are not in the list.
+
+0 GPG_ERR_NO_ERROR Success
+1 GPG_ERR_GENERAL General error
+2 GPG_ERR_UNKNOWN_PACKET Unknown packet
+3 GPG_ERR_UNKNOWN_VERSION Unknown version in packet
+4 GPG_ERR_PUBKEY_ALGO Invalid public key algorithm
+5 GPG_ERR_DIGEST_ALGO Invalid digest algorithm
+6 GPG_ERR_BAD_PUBKEY Bad public key
+7 GPG_ERR_BAD_SECKEY Bad secret key
+8 GPG_ERR_BAD_SIGNATURE Bad signature
+9 GPG_ERR_NO_PUBKEY No public key
+10 GPG_ERR_CHECKSUM Checksum error
+11 GPG_ERR_BAD_PASSPHRASE Bad passphrase
+12 GPG_ERR_CIPHER_ALGO Invalid cipher algorithm
+13 GPG_ERR_KEYRING_OPEN Cannot open keyring
+14 GPG_ERR_INV_PACKET Invalid packet
+15 GPG_ERR_INV_ARMOR Invalid armor
+16 GPG_ERR_NO_USER_ID No user ID
+17 GPG_ERR_NO_SECKEY No secret key
+18 GPG_ERR_WRONG_SECKEY Wrong secret key used
+19 GPG_ERR_BAD_KEY Bad session key
+20 GPG_ERR_COMPR_ALGO Unknown compression algorithm
+21 GPG_ERR_NO_PRIME Number is not prime
+22 GPG_ERR_NO_ENCODING_METHOD Invalid encoding method
+23 GPG_ERR_NO_ENCRYPTION_SCHEME Invalid encryption scheme
+24 GPG_ERR_NO_SIGNATURE_SCHEME Invalid signature scheme
+25 GPG_ERR_INV_ATTR Invalid attribute
+26 GPG_ERR_NO_VALUE No value
+27 GPG_ERR_NOT_FOUND Not found
+28 GPG_ERR_VALUE_NOT_FOUND Value not found
+29 GPG_ERR_SYNTAX Syntax error
+30 GPG_ERR_BAD_MPI Bad MPI value
+31 GPG_ERR_INV_PASSPHRASE Invalid passphrase
+32 GPG_ERR_SIG_CLASS Invalid signature class
+33 GPG_ERR_RESOURCE_LIMIT Resources exhausted
+34 GPG_ERR_INV_KEYRING Invalid keyring
+35 GPG_ERR_TRUSTDB Trust DB error
+36 GPG_ERR_BAD_CERT Bad certificate
+37 GPG_ERR_INV_USER_ID Invalid user ID
+38 GPG_ERR_UNEXPECTED Unexpected error
+39 GPG_ERR_TIME_CONFLICT Time conflict
+40 GPG_ERR_KEYSERVER Keyserver error
+41 GPG_ERR_WRONG_PUBKEY_ALGO Wrong public key algorithm
+42 GPG_ERR_TRIBUTE_TO_D_A Tribute to D. A.
+43 GPG_ERR_WEAK_KEY Weak encryption key
+44 GPG_ERR_INV_KEYLEN Invalid key length
+45 GPG_ERR_INV_ARG Invalid argument
+46 GPG_ERR_BAD_URI Syntax error in URI
+47 GPG_ERR_INV_URI Invalid URI
+48 GPG_ERR_NETWORK Network error
+49 GPG_ERR_UNKNOWN_HOST Unknown host
+50 GPG_ERR_SELFTEST_FAILED Selftest failed
+51 GPG_ERR_NOT_ENCRYPTED Data not encrypted
+52 GPG_ERR_NOT_PROCESSED Data not processed
+53 GPG_ERR_UNUSABLE_PUBKEY Unusable public key
+54 GPG_ERR_UNUSABLE_SECKEY Unusable secret key
+55 GPG_ERR_INV_VALUE Invalid value
+56 GPG_ERR_BAD_CERT_CHAIN Bad certificate chain
+57 GPG_ERR_MISSING_CERT Missing certificate
+58 GPG_ERR_NO_DATA No data
+59 GPG_ERR_BUG Bug
+60 GPG_ERR_NOT_SUPPORTED Not supported
+61 GPG_ERR_INV_OP Invalid operation code
+62 GPG_ERR_TIMEOUT Timeout
+63 GPG_ERR_INTERNAL Internal error
+64 GPG_ERR_EOF_GCRYPT EOF (gcrypt)
+65 GPG_ERR_INV_OBJ Invalid object
+66 GPG_ERR_TOO_SHORT Provided object is too short
+67 GPG_ERR_TOO_LARGE Provided object is too large
+68 GPG_ERR_NO_OBJ Missing item in object
+69 GPG_ERR_NOT_IMPLEMENTED Not implemented
+70 GPG_ERR_CONFLICT Conflicting use
+71 GPG_ERR_INV_CIPHER_MODE Invalid cipher mode
+72 GPG_ERR_INV_FLAG Invalid flag
+73 GPG_ERR_INV_HANDLE Invalid handle
+74 GPG_ERR_TRUNCATED Result truncated
+75 GPG_ERR_INCOMPLETE_LINE Incomplete line
+76 GPG_ERR_INV_RESPONSE Invalid response
+77 GPG_ERR_NO_AGENT No agent running
+78 GPG_ERR_AGENT Agent error
+79 GPG_ERR_INV_DATA Invalid data
+80 GPG_ERR_ASSUAN_SERVER_FAULT Unspecific Assuan server fault
+81 GPG_ERR_ASSUAN General Assuan error
+82 GPG_ERR_INV_SESSION_KEY Invalid session key
+83 GPG_ERR_INV_SEXP Invalid S-expression
+84 GPG_ERR_UNSUPPORTED_ALGORITHM Unsupported algorithm
+85 GPG_ERR_NO_PIN_ENTRY No pinentry
+86 GPG_ERR_PIN_ENTRY pinentry error
+87 GPG_ERR_BAD_PIN Bad PIN
+88 GPG_ERR_INV_NAME Invalid name
+89 GPG_ERR_BAD_DATA Bad data
+90 GPG_ERR_INV_PARAMETER Invalid parameter
+91 GPG_ERR_WRONG_CARD Wrong card
+92 GPG_ERR_NO_DIRMNGR No dirmngr
+93 GPG_ERR_DIRMNGR dirmngr error
+94 GPG_ERR_CERT_REVOKED Certificate revoked
+95 GPG_ERR_NO_CRL_KNOWN No CRL known
+96 GPG_ERR_CRL_TOO_OLD CRL too old
+97 GPG_ERR_LINE_TOO_LONG Line too long
+98 GPG_ERR_NOT_TRUSTED Not trusted
+99 GPG_ERR_CANCELED Operation cancelled
+100 GPG_ERR_BAD_CA_CERT Bad CA certificate
+101 GPG_ERR_CERT_EXPIRED Certificate expired
+102 GPG_ERR_CERT_TOO_YOUNG Certificate too young
+103 GPG_ERR_UNSUPPORTED_CERT Unsupported certificate
+104 GPG_ERR_UNKNOWN_SEXP Unknown S-expression
+105 GPG_ERR_UNSUPPORTED_PROTECTION Unsupported protection
+106 GPG_ERR_CORRUPTED_PROTECTION Corrupted protection
+107 GPG_ERR_AMBIGUOUS_NAME Ambiguous name
+108 GPG_ERR_CARD Card error
+109 GPG_ERR_CARD_RESET Card reset required
+110 GPG_ERR_CARD_REMOVED Card removed
+111 GPG_ERR_INV_CARD Invalid card
+112 GPG_ERR_CARD_NOT_PRESENT Card not present
+113 GPG_ERR_NO_PKCS15_APP No PKCS15 application
+114 GPG_ERR_NOT_CONFIRMED Not confirmed
+115 GPG_ERR_CONFIGURATION Configuration error
+116 GPG_ERR_NO_POLICY_MATCH No policy match
+117 GPG_ERR_INV_INDEX Invalid index
+118 GPG_ERR_INV_ID Invalid ID
+119 GPG_ERR_NO_SCDAEMON No SmartCard daemon
+120 GPG_ERR_SCDAEMON SmartCard daemon error
+121 GPG_ERR_UNSUPPORTED_PROTOCOL Unsupported protocol
+122 GPG_ERR_BAD_PIN_METHOD Bad PIN method
+123 GPG_ERR_CARD_NOT_INITIALIZED Card not initialized
+124 GPG_ERR_UNSUPPORTED_OPERATION Unsupported operation
+125 GPG_ERR_WRONG_KEY_USAGE Wrong key usage
+126 GPG_ERR_NOTHING_FOUND Nothing found
+127 GPG_ERR_WRONG_BLOB_TYPE Wrong blob type
+128 GPG_ERR_MISSING_VALUE Missing value
+129 GPG_ERR_HARDWARE Hardware problem
+130 GPG_ERR_PIN_BLOCKED PIN blocked
+131 GPG_ERR_USE_CONDITIONS Conditions of use not satisfied
+132 GPG_ERR_PIN_NOT_SYNCED PINs are not synced
+133 GPG_ERR_INV_CRL Invalid CRL
+134 GPG_ERR_BAD_BER BER error
+135 GPG_ERR_INV_BER Invalid BER
+136 GPG_ERR_ELEMENT_NOT_FOUND Element not found
+137 GPG_ERR_IDENTIFIER_NOT_FOUND Identifier not found
+138 GPG_ERR_INV_TAG Invalid tag
+139 GPG_ERR_INV_LENGTH Invalid length
+140 GPG_ERR_INV_KEYINFO Invalid key info
+141 GPG_ERR_UNEXPECTED_TAG Unexpected tag
+142 GPG_ERR_NOT_DER_ENCODED Not DER encoded
+143 GPG_ERR_NO_CMS_OBJ No CMS object
+144 GPG_ERR_INV_CMS_OBJ Invalid CMS object
+145 GPG_ERR_UNKNOWN_CMS_OBJ Unknown CMS object
+146 GPG_ERR_UNSUPPORTED_CMS_OBJ Unsupported CMS object
+147 GPG_ERR_UNSUPPORTED_ENCODING Unsupported encoding
+148 GPG_ERR_UNSUPPORTED_CMS_VERSION Unsupported CMS version
+149 GPG_ERR_UNKNOWN_ALGORITHM Unknown algorithm
+150 GPG_ERR_INV_ENGINE Invalid crypto engine
+151 GPG_ERR_PUBKEY_NOT_TRUSTED Public key not trusted
+152 GPG_ERR_DECRYPT_FAILED Decryption failed
+153 GPG_ERR_KEY_EXPIRED Key expired
+154 GPG_ERR_SIG_EXPIRED Signature expired
+155 GPG_ERR_ENCODING_PROBLEM Encoding problem
+156 GPG_ERR_INV_STATE Invalid state
+157 GPG_ERR_DUP_VALUE Duplicated value
+158 GPG_ERR_MISSING_ACTION Missing action
+159 GPG_ERR_MODULE_NOT_FOUND ASN.1 module not found
+160 GPG_ERR_INV_OID_STRING Invalid OID string
+161 GPG_ERR_INV_TIME Invalid time
+162 GPG_ERR_INV_CRL_OBJ Invalid CRL object
+163 GPG_ERR_UNSUPPORTED_CRL_VERSION Unsupported CRL version
+164 GPG_ERR_INV_CERT_OBJ Invalid certificate object
+165 GPG_ERR_UNKNOWN_NAME Unknown name
+166 GPG_ERR_LOCALE_PROBLEM A locale function failed
+167 GPG_ERR_NOT_LOCKED Not locked
+168 GPG_ERR_PROTOCOL_VIOLATION Protocol violation
+169 GPG_ERR_INV_MAC Invalid MAC
+170 GPG_ERR_INV_REQUEST Invalid request
+171 GPG_ERR_UNKNOWN_EXTN Unknown extension
+172 GPG_ERR_UNKNOWN_CRIT_EXTN Unknown critical extension
+173 GPG_ERR_LOCKED Locked
+174 GPG_ERR_UNKNOWN_OPTION Unknown option
+175 GPG_ERR_UNKNOWN_COMMAND Unknown command
+176 GPG_ERR_NOT_OPERATIONAL Not operational
+177 GPG_ERR_NO_PASSPHRASE No passphrase given
+178 GPG_ERR_NO_PIN No PIN given
+179 GPG_ERR_NOT_ENABLED Not enabled
+180 GPG_ERR_NO_ENGINE No crypto engine
+181 GPG_ERR_MISSING_KEY Missing key
+182 GPG_ERR_TOO_MANY Too many objects
+183 GPG_ERR_LIMIT_REACHED Limit reached
+184 GPG_ERR_NOT_INITIALIZED Not initialized
+185 GPG_ERR_MISSING_ISSUER_CERT Missing issuer certificate
+186 GPG_ERR_NO_KEYSERVER No keyserver available
+187 GPG_ERR_INV_CURVE Invalid elliptic curve
+188 GPG_ERR_UNKNOWN_CURVE Unknown elliptic curve
+189 GPG_ERR_DUP_KEY Duplicated key
+190 GPG_ERR_AMBIGUOUS Ambiguous result
+191 GPG_ERR_NO_CRYPT_CTX No crypto context
+192 GPG_ERR_WRONG_CRYPT_CTX Wrong crypto context
+193 GPG_ERR_BAD_CRYPT_CTX Bad crypto context
+194 GPG_ERR_CRYPT_CTX_CONFLICT Conflict in the crypto context
+195 GPG_ERR_BROKEN_PUBKEY Broken public key
+196 GPG_ERR_BROKEN_SECKEY Broken secret key
+197 GPG_ERR_MAC_ALGO Invalid MAC algorithm
+198 GPG_ERR_FULLY_CANCELED Operation fully cancelled
+199 GPG_ERR_UNFINISHED Operation not yet finished
+200 GPG_ERR_BUFFER_TOO_SHORT Buffer too short
+
+# Error codes pertaining to S-expressions.
+
+201 GPG_ERR_SEXP_INV_LEN_SPEC Invalid length specifier in S-expression
+202 GPG_ERR_SEXP_STRING_TOO_LONG String too long in S-expression
+203 GPG_ERR_SEXP_UNMATCHED_PAREN Unmatched parentheses in S-expression
+204 GPG_ERR_SEXP_NOT_CANONICAL S-expression not canonical
+205 GPG_ERR_SEXP_BAD_CHARACTER Bad character in S-expression
+206 GPG_ERR_SEXP_BAD_QUOTATION Bad quotation in S-expression
+207 GPG_ERR_SEXP_ZERO_PREFIX Zero prefix in S-expression
+208 GPG_ERR_SEXP_NESTED_DH Nested display hints in S-expression
+209 GPG_ERR_SEXP_UNMATCHED_DH Unmatched display hints
+210 GPG_ERR_SEXP_UNEXPECTED_PUNC Unexpected reserved punctuation in S-expression
+211 GPG_ERR_SEXP_BAD_HEX_CHAR Bad hexadecimal character in S-expression
+212 GPG_ERR_SEXP_ODD_HEX_NUMBERS Odd hexadecimal numbers in S-expression
+213 GPG_ERR_SEXP_BAD_OCT_CHAR Bad octal character in S-expression
+
+# 214 to 216 are free to be used.
+217 GPG_ERR_SUBKEYS_EXP_OR_REV All subkeys are expired or revoked
+218 GPG_ERR_DB_CORRUPTED Database is corrupted
+219 GPG_ERR_SERVER_FAILED Server indicated a failure
+220 GPG_ERR_NO_NAME No name
+221 GPG_ERR_NO_KEY No key
+222 GPG_ERR_LEGACY_KEY Legacy key
+223 GPG_ERR_REQUEST_TOO_SHORT Request too short
+224 GPG_ERR_REQUEST_TOO_LONG Request too long
+225 GPG_ERR_OBJ_TERM_STATE Object is in termination state
+226 GPG_ERR_NO_CERT_CHAIN No certificate chain
+227 GPG_ERR_CERT_TOO_LARGE Certificate is too large
+228 GPG_ERR_INV_RECORD Invalid record
+229 GPG_ERR_BAD_MAC The MAC does not verify
+230 GPG_ERR_UNEXPECTED_MSG Unexpected message
+231 GPG_ERR_COMPR_FAILED Compression or decompression failed
+232 GPG_ERR_WOULD_WRAP A counter would wrap
+233 GPG_ERR_FATAL_ALERT Fatal alert message received
+234 GPG_ERR_NO_CIPHER No cipher algorithm
+235 GPG_ERR_MISSING_CLIENT_CERT Missing client certificate
+236 GPG_ERR_CLOSE_NOTIFY Close notification received
+237 GPG_ERR_TICKET_EXPIRED Ticket expired
+238 GPG_ERR_BAD_TICKET Bad ticket
+239 GPG_ERR_UNKNOWN_IDENTITY Unknown identity
+240 GPG_ERR_BAD_HS_CERT Bad certificate message in handshake
+241 GPG_ERR_BAD_HS_CERT_REQ Bad certificate request message in handshake
+242 GPG_ERR_BAD_HS_CERT_VER Bad certificate verify message in handshake
+243 GPG_ERR_BAD_HS_CHANGE_CIPHER Bad change cipher message in handshake
+244 GPG_ERR_BAD_HS_CLIENT_HELLO Bad client hello message in handshake
+245 GPG_ERR_BAD_HS_SERVER_HELLO Bad server hello message in handshake
+246 GPG_ERR_BAD_HS_SERVER_HELLO_DONE Bad server hello done message in handshake
+247 GPG_ERR_BAD_HS_FINISHED Bad finished message in handshake
+248 GPG_ERR_BAD_HS_SERVER_KEX Bad server key exchange message in handshake
+249 GPG_ERR_BAD_HS_CLIENT_KEX Bad client key exchange message in handshake
+250 GPG_ERR_BOGUS_STRING Bogus string
+251 GPG_ERR_FORBIDDEN Forbidden
+252 GPG_ERR_KEY_DISABLED Key disabled
+253 GPG_ERR_KEY_ON_CARD Not possible with a card based key
+254 GPG_ERR_INV_LOCK_OBJ Invalid lock object
+
+255 GPG_ERR_TRUE True
+256 GPG_ERR_FALSE False
+
+# Error codes pertaining to the Assuan IPC interface
+257 GPG_ERR_ASS_GENERAL General IPC error
+258 GPG_ERR_ASS_ACCEPT_FAILED IPC accept call failed
+259 GPG_ERR_ASS_CONNECT_FAILED IPC connect call failed
+260 GPG_ERR_ASS_INV_RESPONSE Invalid IPC response
+261 GPG_ERR_ASS_INV_VALUE Invalid value passed to IPC
+262 GPG_ERR_ASS_INCOMPLETE_LINE Incomplete line passed to IPC
+263 GPG_ERR_ASS_LINE_TOO_LONG Line passed to IPC too long
+264 GPG_ERR_ASS_NESTED_COMMANDS Nested IPC commands
+265 GPG_ERR_ASS_NO_DATA_CB No data callback in IPC
+266 GPG_ERR_ASS_NO_INQUIRE_CB No inquire callback in IPC
+267 GPG_ERR_ASS_NOT_A_SERVER Not an IPC server
+268 GPG_ERR_ASS_NOT_A_CLIENT Not an IPC client
+269 GPG_ERR_ASS_SERVER_START Problem starting IPC server
+270 GPG_ERR_ASS_READ_ERROR IPC read error
+271 GPG_ERR_ASS_WRITE_ERROR IPC write error
+# reserved
+273 GPG_ERR_ASS_TOO_MUCH_DATA Too much data for IPC layer
+274 GPG_ERR_ASS_UNEXPECTED_CMD Unexpected IPC command
+275 GPG_ERR_ASS_UNKNOWN_CMD Unknown IPC command
+276 GPG_ERR_ASS_SYNTAX IPC syntax error
+277 GPG_ERR_ASS_CANCELED IPC call has been cancelled
+278 GPG_ERR_ASS_NO_INPUT No input source for IPC
+279 GPG_ERR_ASS_NO_OUTPUT No output source for IPC
+280 GPG_ERR_ASS_PARAMETER IPC parameter error
+281 GPG_ERR_ASS_UNKNOWN_INQUIRE Unknown IPC inquire
+
+# 282 to 299 are reserved for future assuan codes.
+
+300 GPG_ERR_ENGINE_TOO_OLD Crypto engine too old
+301 GPG_ERR_WINDOW_TOO_SMALL Screen or window too small
+302 GPG_ERR_WINDOW_TOO_LARGE Screen or window too large
+303 GPG_ERR_MISSING_ENVVAR Required environment variable not set
+304 GPG_ERR_USER_ID_EXISTS User ID already exists
+305 GPG_ERR_NAME_EXISTS Name already exists
+306 GPG_ERR_DUP_NAME Duplicated name
+307 GPG_ERR_TOO_YOUNG Object is too young
+308 GPG_ERR_TOO_OLD Object is too old
+309 GPG_ERR_UNKNOWN_FLAG Unknown flag
+310 GPG_ERR_INV_ORDER Invalid execution order
+311 GPG_ERR_ALREADY_FETCHED Already fetched
+312 GPG_ERR_TRY_LATER Try again later
+313 GPG_ERR_WRONG_NAME Wrong name
+# This range is free for use.
+
+666 GPG_ERR_SYSTEM_BUG System bug detected
+
+#
+# Mapping of some error codes from libdns and other DNS specific error codes
+#
+711 GPG_ERR_DNS_UNKNOWN Unknown DNS error
+712 GPG_ERR_DNS_SECTION Invalid DNS section
+713 GPG_ERR_DNS_ADDRESS Invalid textual address form
+714 GPG_ERR_DNS_NO_QUERY Missing DNS query packet
+715 GPG_ERR_DNS_NO_ANSWER Missing DNS answer packet
+716 GPG_ERR_DNS_CLOSED Connection closed in DNS
+717 GPG_ERR_DNS_VERIFY Verification failed in DNS
+718 GPG_ERR_DNS_TIMEOUT DNS Timeout
+
+#
+# Mapping of LDAP error codes
+#
+# The numbers reflect the OpenLDAP code with an offset of 768.
+# Some error names are shortened
+#
+721 GPG_ERR_LDAP_GENERAL General LDAP error
+722 GPG_ERR_LDAP_ATTR_GENERAL General LDAP attribute error
+723 GPG_ERR_LDAP_NAME_GENERAL General LDAP name error
+724 GPG_ERR_LDAP_SECURITY_GENERAL General LDAP security error
+725 GPG_ERR_LDAP_SERVICE_GENERAL General LDAP service error
+726 GPG_ERR_LDAP_UPDATE_GENERAL General LDAP update error
+727 GPG_ERR_LDAP_E_GENERAL Experimental LDAP error code
+728 GPG_ERR_LDAP_X_GENERAL Private LDAP error code
+729 GPG_ERR_LDAP_OTHER_GENERAL Other general LDAP error
+# 730 to 749 not used
+750 GPG_ERR_LDAP_X_CONNECTING LDAP connecting failed (X)
+751 GPG_ERR_LDAP_REFERRAL_LIMIT LDAP referral limit exceeded
+752 GPG_ERR_LDAP_CLIENT_LOOP LDAP client loop
+# 753 is an obsolete error code
+754 GPG_ERR_LDAP_NO_RESULTS No LDAP results returned
+755 GPG_ERR_LDAP_CONTROL_NOT_FOUND LDAP control not found
+756 GPG_ERR_LDAP_NOT_SUPPORTED Not supported by LDAP
+757 GPG_ERR_LDAP_CONNECT LDAP connect error
+758 GPG_ERR_LDAP_NO_MEMORY Out of memory in LDAP
+759 GPG_ERR_LDAP_PARAM Bad parameter to an LDAP routine
+760 GPG_ERR_LDAP_USER_CANCELLED User cancelled LDAP operation
+761 GPG_ERR_LDAP_FILTER Bad LDAP search filter
+762 GPG_ERR_LDAP_AUTH_UNKNOWN Unknown LDAP authentication method
+763 GPG_ERR_LDAP_TIMEOUT Timeout in LDAP
+764 GPG_ERR_LDAP_DECODING LDAP decoding error
+765 GPG_ERR_LDAP_ENCODING LDAP encoding error
+766 GPG_ERR_LDAP_LOCAL LDAP local error
+767 GPG_ERR_LDAP_SERVER_DOWN Cannot contact LDAP server
+768 GPG_ERR_LDAP_SUCCESS LDAP success
+769 GPG_ERR_LDAP_OPERATIONS LDAP operations error
+770 GPG_ERR_LDAP_PROTOCOL LDAP protocol error
+771 GPG_ERR_LDAP_TIMELIMIT Time limit exceeded in LDAP
+772 GPG_ERR_LDAP_SIZELIMIT Size limit exceeded in LDAP
+773 GPG_ERR_LDAP_COMPARE_FALSE LDAP compare false
+774 GPG_ERR_LDAP_COMPARE_TRUE LDAP compare true
+775 GPG_ERR_LDAP_UNSUPPORTED_AUTH LDAP authentication method not supported
+776 GPG_ERR_LDAP_STRONG_AUTH_RQRD Strong(er) LDAP authentication required
+777 GPG_ERR_LDAP_PARTIAL_RESULTS Partial LDAP results+referral received
+778 GPG_ERR_LDAP_REFERRAL LDAP referral
+779 GPG_ERR_LDAP_ADMINLIMIT Administrative LDAP limit exceeded
+780 GPG_ERR_LDAP_UNAVAIL_CRIT_EXTN Critical LDAP extension is unavailable
+781 GPG_ERR_LDAP_CONFIDENT_RQRD Confidentiality required by LDAP
+782 GPG_ERR_LDAP_SASL_BIND_INPROG LDAP SASL bind in progress
+# 783 not used
+784 GPG_ERR_LDAP_NO_SUCH_ATTRIBUTE No such LDAP attribute
+785 GPG_ERR_LDAP_UNDEFINED_TYPE Undefined LDAP attribute type
+786 GPG_ERR_LDAP_BAD_MATCHING Inappropriate matching in LDAP
+787 GPG_ERR_LDAP_CONST_VIOLATION Constraint violation in LDAP
+788 GPG_ERR_LDAP_TYPE_VALUE_EXISTS LDAP type or value exists
+789 GPG_ERR_LDAP_INV_SYNTAX Invalid syntax in LDAP
+# 790 to 799 not used
+800 GPG_ERR_LDAP_NO_SUCH_OBJ No such LDAP object
+801 GPG_ERR_LDAP_ALIAS_PROBLEM LDAP alias problem
+802 GPG_ERR_LDAP_INV_DN_SYNTAX Invalid DN syntax in LDAP
+803 GPG_ERR_LDAP_IS_LEAF LDAP entry is a leaf
+804 GPG_ERR_LDAP_ALIAS_DEREF LDAP alias dereferencing problem
+# 805 to 814 not used
+815 GPG_ERR_LDAP_X_PROXY_AUTH_FAIL LDAP proxy authorization failure (X)
+816 GPG_ERR_LDAP_BAD_AUTH Inappropriate LDAP authentication
+817 GPG_ERR_LDAP_INV_CREDENTIALS Invalid LDAP credentials
+818 GPG_ERR_LDAP_INSUFFICIENT_ACC Insufficient access for LDAP
+819 GPG_ERR_LDAP_BUSY LDAP server is busy
+820 GPG_ERR_LDAP_UNAVAILABLE LDAP server is unavailable
+821 GPG_ERR_LDAP_UNWILL_TO_PERFORM LDAP server is unwilling to perform
+822 GPG_ERR_LDAP_LOOP_DETECT Loop detected by LDAP
+# 823 to 831 not used
+832 GPG_ERR_LDAP_NAMING_VIOLATION LDAP naming violation
+833 GPG_ERR_LDAP_OBJ_CLS_VIOLATION LDAP object class violation
+834 GPG_ERR_LDAP_NOT_ALLOW_NONLEAF LDAP operation not allowed on non-leaf
+835 GPG_ERR_LDAP_NOT_ALLOW_ON_RDN LDAP operation not allowed on RDN
+836 GPG_ERR_LDAP_ALREADY_EXISTS Already exists (LDAP)
+837 GPG_ERR_LDAP_NO_OBJ_CLASS_MODS Cannot modify LDAP object class
+838 GPG_ERR_LDAP_RESULTS_TOO_LARGE LDAP results too large
+839 GPG_ERR_LDAP_AFFECTS_MULT_DSAS LDAP operation affects multiple DSAs
+# 840 to 843 not used
+844 GPG_ERR_LDAP_VLV Virtual LDAP list view error
+# 845 to 847 not used
+848 GPG_ERR_LDAP_OTHER Other LDAP error
+# 849 to 880 not used
+881 GPG_ERR_LDAP_CUP_RESOURCE_LIMIT Resources exhausted in LCUP
+882 GPG_ERR_LDAP_CUP_SEC_VIOLATION Security violation in LCUP
+883 GPG_ERR_LDAP_CUP_INV_DATA Invalid data in LCUP
+884 GPG_ERR_LDAP_CUP_UNSUP_SCHEME Unsupported scheme in LCUP
+885 GPG_ERR_LDAP_CUP_RELOAD Reload required in LCUP
+886 GPG_ERR_LDAP_CANCELLED LDAP cancelled
+887 GPG_ERR_LDAP_NO_SUCH_OPERATION No LDAP operation to cancel
+888 GPG_ERR_LDAP_TOO_LATE Too late to cancel LDAP
+889 GPG_ERR_LDAP_CANNOT_CANCEL Cannot cancel LDAP
+890 GPG_ERR_LDAP_ASSERTION_FAILED LDAP assertion failed
+891 GPG_ERR_LDAP_PROX_AUTH_DENIED Proxied authorization denied by LDAP
+
+# 892 to 950 are reserved for future LDAP codes.
+
+# 951 to 1023 are free to be used.
+
+# For free use by non-GnuPG components:
+1024 GPG_ERR_USER_1 User defined error code 1
+1025 GPG_ERR_USER_2 User defined error code 2
+1026 GPG_ERR_USER_3 User defined error code 3
+1027 GPG_ERR_USER_4 User defined error code 4
+1028 GPG_ERR_USER_5 User defined error code 5
+1029 GPG_ERR_USER_6 User defined error code 6
+1030 GPG_ERR_USER_7 User defined error code 7
+1031 GPG_ERR_USER_8 User defined error code 8
+1032 GPG_ERR_USER_9 User defined error code 9
+1033 GPG_ERR_USER_10 User defined error code 10
+1034 GPG_ERR_USER_11 User defined error code 11
+1035 GPG_ERR_USER_12 User defined error code 12
+1036 GPG_ERR_USER_13 User defined error code 13
+1037 GPG_ERR_USER_14 User defined error code 14
+1038 GPG_ERR_USER_15 User defined error code 15
+1039 GPG_ERR_USER_16 User defined error code 16
+
+# 1040 to 16380 are free to be used.
+
+16381 GPG_ERR_MISSING_ERRNO System error w/o errno
+16382 GPG_ERR_UNKNOWN_ERRNO Unknown system error
+16383 GPG_ERR_EOF End of file
+
+# 16384 - 32767 are reserved for future extensions.
+
+# GPG_SYSTEM_ERROR | (141 to 32767) are to be used for system errors.
+
+ GPG_ERR_CODE_DIM Unknown error code
diff --git a/src/err-sources.h.in b/src/err-sources.h.in
new file mode 100644
index 0000000..13ca454
--- /dev/null
+++ b/src/err-sources.h.in
@@ -0,0 +1,61 @@
+# err-sources.h.in - List of error sources and their description input file.
+/* err-sources.h - List of error sources and their description.
+ Copyright (C) 2003, 2004 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with libgpg-error; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+# Everything up to the first line that starts with a number in the
+# first column is copied into the output verbatim. Then, empty lines
+# are ignored. Other lines must have an error source number, followed
+# by one or more <tab> characters, followed by the error source
+# symbol, followed by one or more <tab> characters, followed by the
+# error source name. Trailing whitespace is removed. The error
+# sources should be sorted. The last line should not have a number,
+# but only a <tab>, followed by a description for error sources that
+# are not in the list.
+
+0 GPG_ERR_SOURCE_UNKNOWN Unspecified source
+1 GPG_ERR_SOURCE_GCRYPT gcrypt
+2 GPG_ERR_SOURCE_GPG GnuPG
+3 GPG_ERR_SOURCE_GPGSM GpgSM
+4 GPG_ERR_SOURCE_GPGAGENT GPG Agent
+5 GPG_ERR_SOURCE_PINENTRY Pinentry
+6 GPG_ERR_SOURCE_SCD SCD
+7 GPG_ERR_SOURCE_GPGME GPGME
+8 GPG_ERR_SOURCE_KEYBOX Keybox
+9 GPG_ERR_SOURCE_KSBA KSBA
+10 GPG_ERR_SOURCE_DIRMNGR Dirmngr
+11 GPG_ERR_SOURCE_GSTI GSTI
+12 GPG_ERR_SOURCE_GPA GPA
+13 GPG_ERR_SOURCE_KLEO Kleopatra
+14 GPG_ERR_SOURCE_G13 G13
+15 GPG_ERR_SOURCE_ASSUAN Assuan
+
+17 GPG_ERR_SOURCE_TLS TLS
+
+# 15 to 30 are free to be used.
+
+31 GPG_ERR_SOURCE_ANY Any source
+32 GPG_ERR_SOURCE_USER_1 User defined source 1
+33 GPG_ERR_SOURCE_USER_2 User defined source 2
+34 GPG_ERR_SOURCE_USER_3 User defined source 3
+35 GPG_ERR_SOURCE_USER_4 User defined source 4
+
+# 36 to 255 are free to be used.
+
+ GPG_ERR_SOURCE_DIM Unknown source
diff --git a/src/errnos.in b/src/errnos.in
new file mode 100644
index 0000000..018fb9a
--- /dev/null
+++ b/src/errnos.in
@@ -0,0 +1,172 @@
+# errnos.in - List of system error values input file.
+/* errnos.in - List of system error values.
+ Copyright (C) 2003, 2004 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with libgpg-error; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+# Everything up to the first line that starts with a number in the
+# first column is copied into the output verbatim. Then, empty lines
+# are ignored. Other lines must have an error code number, followed
+# by one or more <tab> characters, followed by the error name.
+#
+# IMPORTANT: For now, the numbering must be consecutive. Some of the
+# scripts (notably mkerrnos.h) do not deal correctly with a numbering
+# that is out of order or has gaps.
+
+
+0 E2BIG
+1 EACCES
+2 EADDRINUSE
+3 EADDRNOTAVAIL
+4 EADV
+5 EAFNOSUPPORT
+6 EAGAIN
+7 EALREADY
+8 EAUTH
+9 EBACKGROUND
+10 EBADE
+11 EBADF
+12 EBADFD
+13 EBADMSG
+14 EBADR
+15 EBADRPC
+16 EBADRQC
+17 EBADSLT
+18 EBFONT
+19 EBUSY
+20 ECANCELED
+21 ECHILD
+22 ECHRNG
+23 ECOMM
+24 ECONNABORTED
+25 ECONNREFUSED
+26 ECONNRESET
+27 ED
+28 EDEADLK
+29 EDEADLOCK
+30 EDESTADDRREQ
+31 EDIED
+32 EDOM
+33 EDOTDOT
+34 EDQUOT
+35 EEXIST
+36 EFAULT
+37 EFBIG
+38 EFTYPE
+39 EGRATUITOUS
+40 EGREGIOUS
+41 EHOSTDOWN
+42 EHOSTUNREACH
+43 EIDRM
+44 EIEIO
+45 EILSEQ
+46 EINPROGRESS
+47 EINTR
+48 EINVAL
+49 EIO
+50 EISCONN
+51 EISDIR
+52 EISNAM
+53 EL2HLT
+54 EL2NSYNC
+55 EL3HLT
+56 EL3RST
+57 ELIBACC
+58 ELIBBAD
+59 ELIBEXEC
+60 ELIBMAX
+61 ELIBSCN
+62 ELNRNG
+63 ELOOP
+64 EMEDIUMTYPE
+65 EMFILE
+66 EMLINK
+67 EMSGSIZE
+68 EMULTIHOP
+69 ENAMETOOLONG
+70 ENAVAIL
+71 ENEEDAUTH
+72 ENETDOWN
+73 ENETRESET
+74 ENETUNREACH
+75 ENFILE
+76 ENOANO
+77 ENOBUFS
+78 ENOCSI
+79 ENODATA
+80 ENODEV
+81 ENOENT
+82 ENOEXEC
+83 ENOLCK
+84 ENOLINK
+85 ENOMEDIUM
+86 ENOMEM
+87 ENOMSG
+88 ENONET
+89 ENOPKG
+90 ENOPROTOOPT
+91 ENOSPC
+92 ENOSR
+93 ENOSTR
+94 ENOSYS
+95 ENOTBLK
+96 ENOTCONN
+97 ENOTDIR
+98 ENOTEMPTY
+99 ENOTNAM
+100 ENOTSOCK
+101 ENOTSUP
+102 ENOTTY
+103 ENOTUNIQ
+104 ENXIO
+105 EOPNOTSUPP
+106 EOVERFLOW
+107 EPERM
+108 EPFNOSUPPORT
+109 EPIPE
+110 EPROCLIM
+111 EPROCUNAVAIL
+112 EPROGMISMATCH
+113 EPROGUNAVAIL
+114 EPROTO
+115 EPROTONOSUPPORT
+116 EPROTOTYPE
+117 ERANGE
+118 EREMCHG
+119 EREMOTE
+120 EREMOTEIO
+121 ERESTART
+122 EROFS
+123 ERPCMISMATCH
+124 ESHUTDOWN
+125 ESOCKTNOSUPPORT
+126 ESPIPE
+127 ESRCH
+128 ESRMNT
+129 ESTALE
+130 ESTRPIPE
+131 ETIME
+132 ETIMEDOUT
+133 ETOOMANYREFS
+134 ETXTBSY
+135 EUCLEAN
+136 EUNATCH
+137 EUSERS
+138 EWOULDBLOCK
+139 EXDEV
+140 EXFULL
diff --git a/src/estream-printf.c b/src/estream-printf.c
new file mode 100644
index 0000000..f1cbcde
--- /dev/null
+++ b/src/estream-printf.c
@@ -0,0 +1,1875 @@
+/* estream-printf.c - Versatile mostly C-99 compliant printf formatting
+ * Copyright (C) 2007, 2008, 2009, 2010, 2012, 2014 g10 Code GmbH
+ *
+ * This file is part of Libestream.
+ *
+ * Libestream is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * Libestream is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libestream; if not, see <https://www.gnu.org/licenses/>.
+ *
+ * ALTERNATIVELY, Libestream may be distributed under the terms of the
+ * following license, in which case the provisions of this license are
+ * required INSTEAD OF the GNU General Public License. If you wish to
+ * allow use of your version of this file only under the terms of the
+ * GNU General Public License, and not to allow others to use your
+ * version of this file under the terms of the following license,
+ * indicate your decision by deleting this paragraph and the license
+ * below.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, and the entire permission notice in its entirety,
+ * including the disclaimer of warranties.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* Required autoconf tests:
+
+ AC_TYPE_LONG_LONG_INT defines HAVE_LONG_LONG_INT
+ AC_TYPE_LONG_DOUBLE defines HAVE_LONG_DOUBLE
+ AC_TYPE_INTMAX_T defines HAVE_INTMAX_T
+ AC_TYPE_UINTMAX_T defines HAVE_UINTMAX_T
+ AC_CHECK_TYPES([ptrdiff_t]) defines HAVE_PTRDIFF_T
+ AC_CHECK_SIZEOF([unsigned long]) defines SIZEOF_UNSIGNED_LONG
+ AC_CHECK_SIZEOF([void *]) defines SIZEOF_VOID_P
+ HAVE_LANGINFO_THOUSANDS_SEP
+
+ Note that the file estream.m4 provides the autoconf macro
+ ESTREAM_PRINTF_INIT which runs all required checks.
+ See estream-printf.h for ways to tune this code.
+
+ Missing stuff: wchar and wint_t
+ thousands_sep in pr_float.
+
+*/
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(_WIN32) && !defined(HAVE_W32_SYSTEM)
+# define HAVE_W32_SYSTEM 1
+# if defined(__MINGW32CE__) && !defined (HAVE_W32CE_SYSTEM)
+# define HAVE_W32CE_SYSTEM
+# endif
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdarg.h>
+#include <errno.h>
+#include <stddef.h>
+#include <assert.h>
+#if defined(HAVE_INTMAX_T) || defined(HAVE_UINTMAX_T)
+# ifdef HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#ifdef HAVE_LANGINFO_THOUSANDS_SEP
+#include <langinfo.h>
+#endif
+#ifdef HAVE_W32CE_SYSTEM
+#include <gpg-error.h> /* ERRNO replacement. */
+#endif
+#ifdef _ESTREAM_PRINTF_EXTRA_INCLUDE
+# include _ESTREAM_PRINTF_EXTRA_INCLUDE
+#endif
+#include "estream-printf.h"
+
+/* #define DEBUG 1 */
+
+
+/* Allow redefinition of asprintf used realloc function. */
+#if defined(_ESTREAM_PRINTF_REALLOC)
+#define my_printf_realloc(a,b) _ESTREAM_PRINTF_REALLOC((a),(b))
+#else
+#define my_printf_realloc(a,b) fixed_realloc((a),(b))
+#endif
+
+/* A wrapper to set ERRNO. */
+#ifdef HAVE_W32CE_SYSTEM
+# define _set_errno(a) gpg_err_set_errno ((a))
+#else
+# define _set_errno(a) do { errno = (a); } while (0)
+#endif
+
+
+/* Calculate array dimension. */
+#ifndef DIM
+#define DIM(array) (sizeof (array) / sizeof (*array))
+#endif
+
+
+/* We allow for that many args without requiring malloced memory. */
+#define DEFAULT_MAX_ARGSPECS 5
+
+/* We allow for that many values without requiring malloced memory. */
+#define DEFAULT_MAX_VALUES 8
+
+/* We allocate this many new array argspec elements each time. */
+#define ARGSPECS_BUMP_VALUE 10
+
+/* Special values for the field width and the precision. */
+#define NO_FIELD_VALUE (-1)
+#define STAR_FIELD_VALUE (-2)
+
+/* Bit valuues used for the conversion flags. */
+#define FLAG_GROUPING 1
+#define FLAG_LEFT_JUST 2
+#define FLAG_PLUS_SIGN 4
+#define FLAG_SPACE_PLUS 8
+#define FLAG_ALT_CONV 16
+#define FLAG_ZERO_PAD 32
+
+/* Constants used the length modifiers. */
+typedef enum
+ {
+ LENMOD_NONE = 0,
+ LENMOD_CHAR, /* "hh" */
+ LENMOD_SHORT, /* "h" */
+ LENMOD_LONG, /* "l" */
+ LENMOD_LONGLONG, /* "ll" */
+ LENMOD_INTMAX, /* "j" */
+ LENMOD_SIZET, /* "z" */
+ LENMOD_PTRDIFF, /* "t" */
+ LENMOD_LONGDBL /* "L" */
+ } lenmod_t;
+
+/* All the conversion specifiers. */
+typedef enum
+ {
+ CONSPEC_UNKNOWN = 0,
+ CONSPEC_DECIMAL,
+ CONSPEC_OCTAL,
+ CONSPEC_UNSIGNED,
+ CONSPEC_HEX,
+ CONSPEC_HEX_UP,
+ CONSPEC_FLOAT,
+ CONSPEC_FLOAT_UP,
+ CONSPEC_EXP,
+ CONSPEC_EXP_UP,
+ CONSPEC_F_OR_G,
+ CONSPEC_F_OR_G_UP,
+ CONSPEC_HEX_EXP,
+ CONSPEC_HEX_EXP_UP,
+ CONSPEC_CHAR,
+ CONSPEC_STRING,
+ CONSPEC_POINTER,
+ CONSPEC_STRERROR,
+ CONSPEC_BYTES_SO_FAR
+ } conspec_t;
+
+
+/* Constants describing all the suppoorted types. Note that we list
+ all the types we know about even if certain types are not available
+ on this system. */
+typedef enum
+ {
+ VALTYPE_UNSUPPORTED = 0, /* Artificial type for error detection. */
+ VALTYPE_CHAR,
+ VALTYPE_SCHAR,
+ VALTYPE_UCHAR,
+ VALTYPE_SHORT,
+ VALTYPE_USHORT,
+ VALTYPE_INT,
+ VALTYPE_UINT,
+ VALTYPE_LONG,
+ VALTYPE_ULONG,
+ VALTYPE_LONGLONG,
+ VALTYPE_ULONGLONG,
+ VALTYPE_DOUBLE,
+ VALTYPE_LONGDOUBLE,
+ VALTYPE_STRING,
+ VALTYPE_INTMAX,
+ VALTYPE_UINTMAX,
+ VALTYPE_SIZE,
+ VALTYPE_PTRDIFF,
+ VALTYPE_POINTER,
+ VALTYPE_CHAR_PTR,
+ VALTYPE_SCHAR_PTR,
+ VALTYPE_SHORT_PTR,
+ VALTYPE_INT_PTR,
+ VALTYPE_LONG_PTR,
+ VALTYPE_LONGLONG_PTR,
+ VALTYPE_INTMAX_PTR,
+ VALTYPE_SIZE_PTR,
+ VALTYPE_PTRDIFF_PTR
+ } valtype_t;
+
+
+/* A union used to store the actual values. */
+typedef union
+{
+ char a_char;
+ 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_long;
+ unsigned long int a_ulong;
+#ifdef HAVE_LONG_LONG_INT
+ long long int a_longlong;
+ unsigned long long int a_ulonglong;
+#endif
+ double a_double;
+#ifdef HAVE_LONG_DOUBLE
+ long double a_longdouble;
+#endif
+ const char *a_string;
+#ifdef HAVE_INTMAX_T
+ intmax_t a_intmax;
+#endif
+#ifdef HAVE_UINTMAX_T
+ intmax_t a_uintmax;
+#endif
+ size_t a_size;
+#ifdef HAVE_PTRDIFF_T
+ ptrdiff_t a_ptrdiff;
+#endif
+ void *a_void_ptr;
+ char *a_char_ptr;
+ signed char *a_schar_ptr;
+ short *a_short_ptr;
+ int *a_int_ptr;
+ long *a_long_ptr;
+#ifdef HAVE_LONG_LONG_INT
+ long long int *a_longlong_ptr;
+#endif
+#ifdef HAVE_INTMAX_T
+ intmax_t *a_intmax_ptr;
+#endif
+ size_t *a_size_ptr;
+#ifdef HAVE_PTRDIFF_T
+ ptrdiff_t *a_ptrdiff_ptr;
+#endif
+} value_t;
+
+/* An object used to keep track of a format option and arguments. */
+struct argspec_s
+{
+ size_t length; /* The length of these args including the percent. */
+ unsigned int flags; /* The conversion flags (bits defined by FLAG_foo). */
+ int width; /* The field width. */
+ int precision; /* The precision. */
+ lenmod_t lenmod; /* The length modifier. */
+ conspec_t conspec; /* The conversion specifier. */
+ int arg_pos; /* The position of the argument. This one may
+ be -1 to indicate that no value is expected
+ (e.g. for "%m"). */
+ int width_pos; /* The position of the argument for a field
+ width star's value. 0 for not used. */
+ int precision_pos; /* The position of the argument for the a
+ precision star's value. 0 for not used. */
+ valtype_t vt; /* The type of the corresponding argument. */
+};
+typedef struct argspec_s *argspec_t;
+
+/* An object to build up a table of values and their types. */
+struct valueitem_s
+{
+ valtype_t vt; /* The type of the value. */
+ value_t value; /* The value. */
+};
+typedef struct valueitem_s *valueitem_t;
+
+
+/* Not all systems have a C-90 compliant realloc. To cope with this
+ we use this simple wrapper. */
+#ifndef _ESTREAM_PRINTF_REALLOC
+static void *
+fixed_realloc (void *a, size_t n)
+{
+ if (!a)
+ return malloc (n);
+
+ if (!n)
+ {
+ free (a);
+ return NULL;
+ }
+
+ return realloc (a, n);
+}
+#endif /*!_ESTREAM_PRINTF_REALLOC*/
+
+
+#ifdef DEBUG
+static void
+dump_argspecs (argspec_t arg, size_t argcount)
+{
+ int idx;
+
+ for (idx=0; argcount; argcount--, arg++, idx++)
+ fprintf (stderr,
+ "%2d: len=%u flags=%u width=%d prec=%d mod=%d "
+ "con=%d vt=%d pos=%d-%d-%d\n",
+ idx,
+ (unsigned int)arg->length,
+ arg->flags,
+ arg->width,
+ arg->precision,
+ arg->lenmod,
+ arg->conspec,
+ arg->vt,
+ arg->arg_pos,
+ arg->width_pos,
+ arg->precision_pos);
+}
+#endif /*DEBUG*/
+
+
+/* Set the vt field for ARG. */
+static void
+compute_type (argspec_t arg)
+{
+ switch (arg->conspec)
+ {
+ case CONSPEC_UNKNOWN:
+ arg->vt = VALTYPE_UNSUPPORTED;
+ break;
+
+ case CONSPEC_DECIMAL:
+ switch (arg->lenmod)
+ {
+ case LENMOD_CHAR: arg->vt = VALTYPE_SCHAR; break;
+ case LENMOD_SHORT: arg->vt = VALTYPE_SHORT; break;
+ case LENMOD_LONG: arg->vt = VALTYPE_LONG; break;
+ case LENMOD_LONGLONG: arg->vt = VALTYPE_LONGLONG; break;
+ case LENMOD_INTMAX: arg->vt = VALTYPE_INTMAX; break;
+ case LENMOD_SIZET: arg->vt = VALTYPE_SIZE; break;
+ case LENMOD_PTRDIFF: arg->vt = VALTYPE_PTRDIFF; break;
+ default: arg->vt = VALTYPE_INT; break;
+ }
+ break;
+
+ case CONSPEC_OCTAL:
+ case CONSPEC_UNSIGNED:
+ case CONSPEC_HEX:
+ case CONSPEC_HEX_UP:
+ switch (arg->lenmod)
+ {
+ case LENMOD_CHAR: arg->vt = VALTYPE_UCHAR; break;
+ case LENMOD_SHORT: arg->vt = VALTYPE_USHORT; break;
+ case LENMOD_LONG: arg->vt = VALTYPE_ULONG; break;
+ case LENMOD_LONGLONG: arg->vt = VALTYPE_ULONGLONG; break;
+ case LENMOD_INTMAX: arg->vt = VALTYPE_UINTMAX; break;
+ case LENMOD_SIZET: arg->vt = VALTYPE_SIZE; break;
+ case LENMOD_PTRDIFF: arg->vt = VALTYPE_PTRDIFF; break;
+ default: arg->vt = VALTYPE_UINT; break;
+ }
+ break;
+
+ case CONSPEC_FLOAT:
+ case CONSPEC_FLOAT_UP:
+ case CONSPEC_EXP:
+ case CONSPEC_EXP_UP:
+ case CONSPEC_F_OR_G:
+ case CONSPEC_F_OR_G_UP:
+ case CONSPEC_HEX_EXP:
+ case CONSPEC_HEX_EXP_UP:
+ switch (arg->lenmod)
+ {
+ case LENMOD_LONGDBL: arg->vt = VALTYPE_LONGDOUBLE; break;
+ case LENMOD_LONG: arg->vt = VALTYPE_DOUBLE; break;
+ default: arg->vt = VALTYPE_DOUBLE; break;
+ }
+ break;
+
+ case CONSPEC_CHAR:
+ arg->vt = VALTYPE_INT;
+ break;
+
+ case CONSPEC_STRING:
+ arg->vt = VALTYPE_STRING;
+ break;
+
+ case CONSPEC_POINTER:
+ arg->vt = VALTYPE_POINTER;
+ break;
+
+ case CONSPEC_STRERROR:
+ arg->vt = VALTYPE_STRING;
+ break;
+
+ case CONSPEC_BYTES_SO_FAR:
+ switch (arg->lenmod)
+ {
+ case LENMOD_CHAR: arg->vt = VALTYPE_SCHAR_PTR; break;
+ case LENMOD_SHORT: arg->vt = VALTYPE_SHORT_PTR; break;
+ case LENMOD_LONG: arg->vt = VALTYPE_LONG_PTR; break;
+ case LENMOD_LONGLONG: arg->vt = VALTYPE_LONGLONG_PTR; break;
+ case LENMOD_INTMAX: arg->vt = VALTYPE_INTMAX_PTR; break;
+ case LENMOD_SIZET: arg->vt = VALTYPE_SIZE_PTR; break;
+ case LENMOD_PTRDIFF: arg->vt = VALTYPE_PTRDIFF_PTR; break;
+ default: arg->vt = VALTYPE_INT_PTR; break;
+ }
+ break;
+
+ }
+}
+
+
+
+/* Parse the FORMAT string and populate the specification array stored
+ at the address ARGSPECS_ADDR. The caller has provided enough space
+ to store up to MAX_ARGSPECS in that buffer. The function may
+ however ignore the provided buffer and malloc a larger one. On
+ success the address of that larger buffer will be stored at
+ ARGSPECS_ADDR. The actual number of specifications will be
+ returned at R_ARGSPECS_COUNT. */
+static int
+parse_format (const char *format,
+ argspec_t *argspecs_addr, size_t max_argspecs,
+ size_t *r_argspecs_count)
+{
+ const char *s;
+ argspec_t argspecs = *argspecs_addr;
+ argspec_t arg;
+ size_t argcount = 0;
+
+ if (!format)
+ goto leave_einval;
+
+ for (; *format; format++)
+ {
+ unsigned int flags;
+ int width, precision;
+ lenmod_t lenmod;
+ conspec_t conspec;
+ int arg_pos, width_pos, precision_pos;
+
+ if (*format != '%')
+ continue;
+ s = ++format;
+ if (!*s)
+ goto leave_einval;
+ if (*s == '%')
+ continue; /* Just a quoted percent. */
+
+ /* First check whether there is a positional argument. */
+ arg_pos = 0; /* No positional argument given. */
+ if (*s >= '1' && *s <= '9')
+ {
+ const char *save_s = s;
+
+ arg_pos = (*s++ - '0');
+ for (; *s >= '0' && *s <= '9'; s++)
+ arg_pos = 10*arg_pos + (*s - '0');
+ if (arg_pos < 0)
+ goto leave_einval; /* Overflow during conversion. */
+ if (*s == '$')
+ s++;
+ else
+ {
+ arg_pos = 0;
+ s = save_s;
+ }
+ }
+
+ /* Parse the flags. */
+ flags = 0;
+ for ( ; *s; s++)
+ {
+ switch (*s)
+ {
+ case '\'': flags |= FLAG_GROUPING; break;
+ case '-': flags |= FLAG_LEFT_JUST; break;
+ case '+': flags |= FLAG_PLUS_SIGN; break;
+ case ' ': flags |= FLAG_SPACE_PLUS; break;
+ case '#': flags |= FLAG_ALT_CONV; break;
+ case '0': flags |= FLAG_ZERO_PAD; break;
+ default:
+ goto flags_parsed;
+ }
+ }
+ flags_parsed:
+
+ /* Parse the field width. */
+ width_pos = 0;
+ if (*s == '*')
+ {
+ width = STAR_FIELD_VALUE;
+ s++;
+ /* If we have a positional argument, another one might also
+ be used to give the position of the star's value. */
+ if (arg_pos && *s >= '1' && *s <= '9')
+ {
+ width_pos = (*s++ - '0');
+ for (; *s >= '0' && *s <= '9'; s++)
+ width_pos = 10*width_pos + (*s - '0');
+ if (width_pos < 1)
+ goto leave_einval; /* Overflow during conversion. */
+ if (*s != '$')
+ goto leave_einval; /* Not followed by $. */
+ s++;
+ }
+ }
+ else if ( *s >= '0' && *s <= '9')
+ {
+ width = (*s++ - '0');
+ for (; *s >= '0' && *s <= '9'; s++)
+ {
+ if (!width && *s == '0')
+ goto leave_einval; /* Leading zeroes are not allowed.
+ Fixme: check what other
+ implementations do. */
+ width = 10*width + (*s - '0');
+ }
+ if (width < 0)
+ goto leave_einval; /* Overflow during conversion. */
+ }
+ else
+ width = NO_FIELD_VALUE;
+
+ /* Parse the precision. */
+ precision_pos = 0;
+ precision = NO_FIELD_VALUE;
+ if (*s == '.')
+ {
+ int ignore_value = (s[1] == '-');
+
+ s++;
+ if (*s == '*')
+ {
+ precision = STAR_FIELD_VALUE;
+ s++;
+ /* If we have a positional argument, another one might also
+ be used to give the position of the star's value. */
+ if (arg_pos && *s >= '1' && *s <= '9')
+ {
+ precision_pos = (*s++ - '0');
+ for (; *s >= '0' && *s <= '9'; s++)
+ precision_pos = 10*precision_pos + (*s - '0');
+ if (precision_pos < 1)
+ goto leave_einval; /* Overflow during conversion. */
+ if (*s != '$')
+ goto leave_einval; /* Not followed by $. */
+ s++;
+ }
+ }
+ else if ( *s >= '0' && *s <= '9')
+ {
+ precision = (*s++ - '0');
+ for (; *s >= '0' && *s <= '9'; s++)
+ {
+ if (!precision && *s == '0')
+ goto leave_einval; /* Leading zeroes are not allowed.
+ Fixme: check what other
+ implementations do. */
+ precision = 10*precision + (*s - '0');
+ }
+ if (precision < 0)
+ goto leave_einval; /* Overflow during conversion. */
+ }
+ else
+ precision = 0;
+ if (ignore_value)
+ precision = NO_FIELD_VALUE;
+ }
+
+ /* Parse the length modifiers. */
+ switch (*s)
+ {
+ case 'h':
+ if (s[1] == 'h')
+ {
+ lenmod = LENMOD_CHAR;
+ s++;
+ }
+ else
+ lenmod = LENMOD_SHORT;
+ s++;
+ break;
+ case 'l':
+ if (s[1] == 'l')
+ {
+ lenmod = LENMOD_LONGLONG;
+ s++;
+ }
+ else
+ lenmod = LENMOD_LONG;
+ s++;
+ break;
+ case 'j': lenmod = LENMOD_INTMAX; s++; break;
+ case 'z': lenmod = LENMOD_SIZET; s++; break;
+ case 't': lenmod = LENMOD_PTRDIFF; s++; break;
+ case 'L': lenmod = LENMOD_LONGDBL; s++; break;
+ default: lenmod = LENMOD_NONE; break;
+ }
+
+ /* Parse the conversion specifier. */
+ switch (*s)
+ {
+ case 'd':
+ case 'i': conspec = CONSPEC_DECIMAL; break;
+ case 'o': conspec = CONSPEC_OCTAL; break;
+ case 'u': conspec = CONSPEC_UNSIGNED; break;
+ case 'x': conspec = CONSPEC_HEX; break;
+ case 'X': conspec = CONSPEC_HEX_UP; break;
+ case 'f': conspec = CONSPEC_FLOAT; break;
+ case 'F': conspec = CONSPEC_FLOAT_UP; break;
+ case 'e': conspec = CONSPEC_EXP; break;
+ case 'E': conspec = CONSPEC_EXP_UP; break;
+ case 'g': conspec = CONSPEC_F_OR_G; break;
+ case 'G': conspec = CONSPEC_F_OR_G_UP; break;
+ case 'a': conspec = CONSPEC_HEX_EXP; break;
+ case 'A': conspec = CONSPEC_HEX_EXP_UP; break;
+ case 'c': conspec = CONSPEC_CHAR; break;
+ case 's': conspec = CONSPEC_STRING; break;
+ case 'p': conspec = CONSPEC_POINTER; break;
+ case 'n': conspec = CONSPEC_BYTES_SO_FAR; break;
+ case 'C': conspec = CONSPEC_CHAR; lenmod = LENMOD_LONG; break;
+ case 'S': conspec = CONSPEC_STRING; lenmod = LENMOD_LONG; break;
+ case 'm': conspec = CONSPEC_STRERROR; arg_pos = -1; break;
+ default: conspec = CONSPEC_UNKNOWN;
+ }
+
+ /* Save the args. */
+ if (argcount >= max_argspecs)
+ {
+ /* We either need to allocate a new array instead of the
+ caller provided one or realloc the array. Instead of
+ using realloc we allocate a new one and release the
+ original one then. */
+ size_t n, newmax;
+ argspec_t newarg;
+
+ newmax = max_argspecs + ARGSPECS_BUMP_VALUE;
+ if (newmax <= max_argspecs)
+ goto leave_einval; /* Too many arguments. */
+ newarg = calloc (newmax, sizeof *newarg);
+ if (!newarg)
+ goto leave;
+ for (n=0; n < argcount; n++)
+ newarg[n] = argspecs[n];
+ if (argspecs != *argspecs_addr)
+ free (argspecs);
+ argspecs = newarg;
+ max_argspecs = newmax;
+ }
+
+ arg = argspecs + argcount;
+ arg->length = s - format + 2;
+ arg->flags = flags;
+ arg->width = width;
+ arg->precision = precision;
+ arg->lenmod = lenmod;
+ arg->conspec = conspec;
+ arg->arg_pos = arg_pos;
+ arg->width_pos = width_pos;
+ arg->precision_pos = precision_pos;
+ compute_type (arg);
+ argcount++;
+ format = s;
+ }
+
+ *argspecs_addr = argspecs;
+ *r_argspecs_count = argcount;
+ return 0; /* Success. */
+
+ leave_einval:
+ _set_errno (EINVAL);
+ leave:
+ if (argspecs != *argspecs_addr)
+ free (argspecs);
+ *argspecs_addr = NULL;
+ return -1;
+}
+
+
+/* This function reads all the values as specified by VALUETABLE into
+ VALUETABLE. The values are expected in VAARGS. The function
+ returns -1 if a specified type is not supported. */
+static int
+read_values (valueitem_t valuetable, size_t valuetable_len, va_list vaargs)
+{
+ int validx;
+
+ for (validx=0; validx < valuetable_len; validx++)
+ {
+ value_t *value = &valuetable[validx].value;
+ valtype_t vt = valuetable[validx].vt;
+
+ switch (vt)
+ {
+ case VALTYPE_CHAR: value->a_char = va_arg (vaargs, int); break;
+ case VALTYPE_CHAR_PTR:
+ value->a_char_ptr = va_arg (vaargs, char *);
+ break;
+ case VALTYPE_SCHAR: value->a_schar = va_arg (vaargs, int); break;
+ case VALTYPE_SCHAR_PTR:
+ value->a_schar_ptr = va_arg (vaargs, signed char *);
+ break;
+ case VALTYPE_UCHAR: value->a_uchar = va_arg (vaargs, int); break;
+ case VALTYPE_SHORT: value->a_short = va_arg (vaargs, int); break;
+ case VALTYPE_USHORT: value->a_ushort = va_arg (vaargs, int); break;
+ case VALTYPE_SHORT_PTR:
+ value->a_short_ptr = va_arg (vaargs, short *);
+ break;
+ case VALTYPE_INT:
+ value->a_int = va_arg (vaargs, int);
+ break;
+ case VALTYPE_INT_PTR:
+ value->a_int_ptr = va_arg (vaargs, int *);
+ break;
+ case VALTYPE_UINT:
+ value->a_uint = va_arg (vaargs, unsigned int);
+ break;
+ case VALTYPE_LONG:
+ value->a_long = va_arg (vaargs, long);
+ break;
+ case VALTYPE_ULONG:
+ value->a_ulong = va_arg (vaargs, unsigned long);
+ break;
+ case VALTYPE_LONG_PTR:
+ value->a_long_ptr = va_arg (vaargs, long *);
+ break;
+#ifdef HAVE_LONG_LONG_INT
+ case VALTYPE_LONGLONG:
+ value->a_longlong = va_arg (vaargs, long long int);
+ break;
+ case VALTYPE_ULONGLONG:
+ value->a_ulonglong = va_arg (vaargs, unsigned long long int);
+ break;
+ case VALTYPE_LONGLONG_PTR:
+ value->a_longlong_ptr = va_arg (vaargs, long long *);
+ break;
+#endif
+ case VALTYPE_DOUBLE:
+ value->a_double = va_arg (vaargs, double);
+ break;
+#ifdef HAVE_LONG_DOUBLE
+ case VALTYPE_LONGDOUBLE:
+ value->a_longdouble = va_arg (vaargs, long double);
+ break;
+#endif
+ case VALTYPE_STRING:
+ value->a_string = va_arg (vaargs, const char *);
+ break;
+ case VALTYPE_POINTER:
+ value->a_void_ptr = va_arg (vaargs, void *);
+ break;
+#ifdef HAVE_INTMAX_T
+ case VALTYPE_INTMAX:
+ value->a_intmax = va_arg (vaargs, intmax_t);
+ break;
+ case VALTYPE_INTMAX_PTR:
+ value->a_intmax_ptr = va_arg (vaargs, intmax_t *);
+ break;
+#endif
+#ifdef HAVE_UINTMAX_T
+ case VALTYPE_UINTMAX:
+ value->a_uintmax = va_arg (vaargs, uintmax_t);
+ break;
+#endif
+ case VALTYPE_SIZE:
+ value->a_size = va_arg (vaargs, size_t);
+ break;
+ case VALTYPE_SIZE_PTR:
+ value->a_size_ptr = va_arg (vaargs, size_t *);
+ break;
+#ifdef HAVE_PTRDIFF_T
+ case VALTYPE_PTRDIFF:
+ value->a_ptrdiff = va_arg (vaargs, ptrdiff_t);
+ break;
+ case VALTYPE_PTRDIFF_PTR:
+ value->a_ptrdiff_ptr = va_arg (vaargs, ptrdiff_t *);
+ break;
+#endif
+ default: /* Unsupported type. */
+ return -1;
+ }
+ }
+ return 0;
+}
+
+
+
+/* Output COUNT padding characters PADCHAR and update NBYTES by the
+ number of bytes actually written. */
+static int
+pad_out (estream_printf_out_t outfnc, void *outfncarg,
+ int padchar, int count, size_t *nbytes)
+{
+ char buf[32];
+ size_t n;
+ int rc;
+
+ while (count > 0)
+ {
+ n = (count <= sizeof buf)? count : sizeof buf;
+ memset (buf, padchar, n);
+ rc = outfnc (outfncarg, buf, n);
+ if (rc)
+ return rc;
+ *nbytes += n;
+ count -= n;
+ }
+
+ return 0;
+}
+
+
+/* "d,i,o,u,x,X" formatting. OUTFNC and OUTFNCARG describes the
+ output routine, ARG gives the argument description and VALUE the
+ actual value (its type is available through arg->vt). */
+static int
+pr_integer (estream_printf_out_t outfnc, void *outfncarg,
+ argspec_t arg, value_t value, size_t *nbytes)
+{
+ int rc;
+#ifdef HAVE_LONG_LONG_INT
+ unsigned long long aulong;
+#else
+ unsigned long aulong;
+#endif
+ char numbuf[100];
+ char *p, *pend;
+ size_t n;
+ char signchar = 0;
+ int n_prec; /* Number of extra precision digits required. */
+ int n_extra; /* Extra number of prefix or sign characters. */
+
+ if (arg->conspec == CONSPEC_DECIMAL)
+ {
+#ifdef HAVE_LONG_LONG_INT
+ long long along;
+#else
+ long along;
+#endif
+
+ switch (arg->vt)
+ {
+ case VALTYPE_SHORT: along = value.a_short; break;
+ case VALTYPE_INT: along = value.a_int; break;
+ case VALTYPE_LONG: along = value.a_long; break;
+#ifdef HAVE_LONG_LONG_INT
+ case VALTYPE_LONGLONG: along = value.a_longlong; break;
+ case VALTYPE_SIZE: along = value.a_size; break;
+# ifdef HAVE_INTMAX_T
+ case VALTYPE_INTMAX: along = value.a_intmax; break;
+# endif
+# ifdef HAVE_PTRDIFF_T
+ case VALTYPE_PTRDIFF: along = value.a_ptrdiff; break;
+# endif
+#endif /*HAVE_LONG_LONG_INT*/
+ default:
+ return -1;
+ }
+ if (along < 0)
+ {
+ aulong = -along;
+ signchar = '-';
+ }
+ else
+ aulong = along;
+ }
+ else
+ {
+ switch (arg->vt)
+ {
+ case VALTYPE_USHORT: aulong = value.a_ushort; break;
+ case VALTYPE_UINT: aulong = value.a_uint; break;
+ case VALTYPE_ULONG: aulong = value.a_ulong; break;
+#ifdef HAVE_LONG_LONG_INT
+ case VALTYPE_ULONGLONG: aulong = value.a_ulonglong; break;
+ case VALTYPE_SIZE: aulong = value.a_size; break;
+# ifdef HAVE_UINTMAX_T
+ case VALTYPE_UINTMAX: aulong = value.a_uintmax; break;
+# endif
+# ifdef HAVE_PTRDIFF_T
+ case VALTYPE_PTRDIFF: aulong = value.a_ptrdiff; break;
+# endif
+#endif /*HAVE_LONG_LONG_INT*/
+ default:
+ return -1;
+ }
+ }
+
+ if (signchar == '-')
+ ;
+ else if ((arg->flags & FLAG_PLUS_SIGN))
+ signchar = '+';
+ else if ((arg->flags & FLAG_SPACE_PLUS))
+ signchar = ' ';
+
+ n_extra = !!signchar;
+
+ /* We build the string up backwards. */
+ p = pend = numbuf + DIM(numbuf);
+ if ((!aulong && !arg->precision))
+ ;
+ else if (arg->conspec == CONSPEC_DECIMAL
+ || arg->conspec == CONSPEC_UNSIGNED)
+ {
+ int grouping = -1;
+ const char * grouping_string =
+#ifdef HAVE_LANGINFO_THOUSANDS_SEP
+ nl_langinfo(THOUSANDS_SEP);
+#else
+ "'";
+#endif
+
+ do
+ {
+ if ((arg->flags & FLAG_GROUPING)
+ && (++grouping == 3) && *grouping_string)
+ {
+ *--p = *grouping_string;
+ grouping = 0;
+ }
+ *--p = '0' + (aulong % 10);
+ aulong /= 10;
+ }
+ while (aulong);
+ }
+ else if (arg->conspec == CONSPEC_OCTAL)
+ {
+ do
+ {
+ *--p = '0' + (aulong % 8);
+ aulong /= 8;
+ }
+ while (aulong);
+ if ((arg->flags & FLAG_ALT_CONV) && *p != '0')
+ *--p = '0';
+ }
+ else /* HEX or HEXUP */
+ {
+ const char *digits = ((arg->conspec == CONSPEC_HEX)
+ ? "0123456789abcdef" : "0123456789ABCDEF");
+ do
+ {
+ *--p = digits[(aulong % 16)];
+ aulong /= 16;
+ }
+ while (aulong);
+ if ((arg->flags & FLAG_ALT_CONV))
+ n_extra += 2;
+ }
+
+ n = pend - p;
+
+ if ((arg->flags & FLAG_ZERO_PAD)
+ && arg->precision == NO_FIELD_VALUE && !(arg->flags & FLAG_LEFT_JUST)
+ && n && arg->width - n_extra > n )
+ n_prec = arg->width - n_extra - n;
+ else if (arg->precision > 0 && arg->precision > n)
+ n_prec = arg->precision - n;
+ else
+ n_prec = 0;
+
+ if (!(arg->flags & FLAG_LEFT_JUST)
+ && arg->width >= 0 && arg->width - n_extra > n
+ && arg->width - n_extra - n >= n_prec )
+ {
+ rc = pad_out (outfnc, outfncarg, ' ',
+ arg->width - n_extra - n - n_prec, nbytes);
+ if (rc)
+ return rc;
+ }
+
+ if (signchar)
+ {
+ rc = outfnc (outfncarg, &signchar, 1);
+ if (rc)
+ return rc;
+ *nbytes += 1;
+ }
+
+ if ((arg->flags & FLAG_ALT_CONV)
+ && (arg->conspec == CONSPEC_HEX || arg->conspec == CONSPEC_HEX_UP))
+ {
+ rc = outfnc (outfncarg, arg->conspec == CONSPEC_HEX? "0x": "0X", 2);
+ if (rc)
+ return rc;
+ *nbytes += 2;
+ }
+
+ if (n_prec)
+ {
+ rc = pad_out (outfnc, outfncarg, '0', n_prec, nbytes);
+ if (rc)
+ return rc;
+ }
+
+ rc = outfnc (outfncarg, p, pend - p);
+ if (rc)
+ return rc;
+ *nbytes += pend - p;
+
+ if ((arg->flags & FLAG_LEFT_JUST)
+ && arg->width >= 0 && arg->width - n_extra - n_prec > n)
+ {
+ rc = pad_out (outfnc, outfncarg, ' ',
+ arg->width - n_extra - n_prec - n, nbytes);
+ if (rc)
+ return rc;
+ }
+
+ return 0;
+}
+
+
+/* "e,E,f,F,g,G,a,A" formatting. OUTFNC and OUTFNCARG describes the
+ output routine, ARG gives the argument description and VALUE the
+ actual value (its type is available through arg->vt). For
+ portability reasons sprintf is used for the actual formatting.
+ This is useful because sprint is the only standard function to
+ convert a floating number into its ascii representation. To avoid
+ using malloc we just pass the precision to sprintf and do the final
+ formatting with our own code. */
+static int
+pr_float (estream_printf_out_t outfnc, void *outfncarg,
+ argspec_t arg, value_t value, size_t *nbytes)
+{
+ int rc;
+#ifdef HAVE_LONG_DOUBLE
+ long double adblfloat = 0; /* Just to please gcc. */
+ int use_dbl = 0;
+#endif
+ double afloat;
+ char numbuf[350];
+ char formatstr[20];
+ char *p, *pend;
+ size_t n;
+ char signchar = 0;
+ int n_extra; /* Extra number of prefix or sign characters. */
+
+ switch (arg->vt)
+ {
+ case VALTYPE_DOUBLE: afloat = value.a_double; break;
+#ifdef HAVE_LONG_DOUBLE
+ case VALTYPE_LONGDOUBLE:
+ afloat = 0; /* Just to please gcc. */
+ adblfloat = value.a_longdouble;
+ use_dbl=1; break;
+#endif
+ default:
+ return -1;
+ }
+
+ /* We build the string using sprint. */
+ p = formatstr + sizeof formatstr;
+ *--p = 0;
+ switch (arg->conspec)
+ {
+ case CONSPEC_FLOAT: *--p = 'f'; break;
+ case CONSPEC_FLOAT_UP: *--p = 'F'; break;
+ case CONSPEC_EXP: *--p = 'e'; break;
+ case CONSPEC_EXP_UP: *--p = 'E'; break;
+ case CONSPEC_F_OR_G: *--p = 'g'; break;
+ case CONSPEC_F_OR_G_UP: *--p = 'G'; break;
+ case CONSPEC_HEX_EXP: *--p = 'a'; break;
+ case CONSPEC_HEX_EXP_UP: *--p = 'A'; break;
+ default:
+ return -1; /* Actually a bug. */
+ }
+#ifdef HAVE_LONG_DOUBLE
+ if (use_dbl)
+ *--p = 'L';
+#endif
+ if (arg->precision != NO_FIELD_VALUE)
+ {
+ /* Limit it to a meaningful value so that even a stupid sprintf
+ won't overflow our buffer. */
+ n = arg->precision <= 100? arg->precision : 100;
+ do
+ {
+ *--p = '0' + (n % 10);
+ n /= 10;
+ }
+ while (n);
+ *--p = '.';
+ }
+ if ((arg->flags & FLAG_ALT_CONV))
+ *--p = '#';
+ *--p = '%';
+#ifdef HAVE_LONG_DOUBLE
+ if (use_dbl)
+ sprintf (numbuf, p, adblfloat);
+ else
+#endif /*HAVE_LONG_DOUBLE*/
+ sprintf (numbuf, p, afloat);
+ p = numbuf;
+ n = strlen (numbuf);
+ pend = p + n;
+
+ if (*p =='-')
+ {
+ signchar = '-';
+ p++;
+ n--;
+ }
+ else if ((arg->flags & FLAG_PLUS_SIGN))
+ signchar = '+';
+ else if ((arg->flags & FLAG_SPACE_PLUS))
+ signchar = ' ';
+
+ n_extra = !!signchar;
+
+ if (!(arg->flags & FLAG_LEFT_JUST)
+ && arg->width >= 0 && arg->width - n_extra > n)
+ {
+ rc = pad_out (outfnc, outfncarg, ' ', arg->width - n_extra - n, nbytes);
+ if (rc)
+ return rc;
+ }
+
+ if (signchar)
+ {
+ rc = outfnc (outfncarg, &signchar, 1);
+ if (rc)
+ return rc;
+ *nbytes += 1;
+ }
+
+ rc = outfnc (outfncarg, p, pend - p);
+ if (rc)
+ return rc;
+ *nbytes += pend - p;
+
+ if ((arg->flags & FLAG_LEFT_JUST)
+ && arg->width >= 0 && arg->width - n_extra > n)
+ {
+ rc = pad_out (outfnc, outfncarg, ' ', arg->width - n_extra - n, nbytes);
+ if (rc)
+ return rc;
+ }
+
+ return 0;
+}
+
+
+/* "c" formatting. */
+static int
+pr_char (estream_printf_out_t outfnc, void *outfncarg,
+ argspec_t arg, value_t value, size_t *nbytes)
+{
+ int rc;
+ char buf[1];
+
+ if (arg->vt != VALTYPE_INT)
+ return -1;
+ buf[0] = (unsigned int)value.a_int;
+ rc = outfnc (outfncarg, buf, 1);
+ if(rc)
+ return rc;
+ *nbytes += 1;
+
+ return 0;
+}
+
+
+/* "s" formatting. */
+static int
+pr_string (estream_printf_out_t outfnc, void *outfncarg,
+ argspec_t arg, value_t value, size_t *nbytes)
+{
+ int rc;
+ size_t n;
+ const char *string, *s;
+
+ if (arg->vt != VALTYPE_STRING)
+ return -1;
+ string = value.a_string;
+ if (!string)
+ string = "(null)";
+ if (arg->precision >= 0)
+ {
+ /* Test for nul after N so that we can pass a non-nul terminated
+ string. */
+ for (n=0,s=string; n < arg->precision && *s; s++)
+ n++;
+ }
+ else
+ n = strlen (string);
+
+ if (!(arg->flags & FLAG_LEFT_JUST)
+ && arg->width >= 0 && arg->width > n )
+ {
+ rc = pad_out (outfnc, outfncarg, ' ', arg->width - n, nbytes);
+ if (rc)
+ return rc;
+ }
+
+ rc = outfnc (outfncarg, string, n);
+ if (rc)
+ return rc;
+ *nbytes += n;
+
+ if ((arg->flags & FLAG_LEFT_JUST)
+ && arg->width >= 0 && arg->width > n)
+ {
+ rc = pad_out (outfnc, outfncarg, ' ', arg->width - n, nbytes);
+ if (rc)
+ return rc;
+ }
+
+ return 0;
+}
+
+
+/* "p" formatting. */
+static int
+pr_pointer (estream_printf_out_t outfnc, void *outfncarg,
+ argspec_t arg, value_t value, size_t *nbytes)
+{
+ int rc;
+#if defined(HAVE_LONG_LONG_INT) && (SIZEOF_UNSIGNED_LONG < SIZEOF_VOID_P)
+ unsigned long long aulong;
+#else
+ unsigned long aulong;
+#endif
+ char numbuf[100];
+ char *p, *pend;
+
+ if (arg->vt != VALTYPE_POINTER)
+ return -1;
+ /* We assume that a pointer can be converted to an unsigned long.
+ That is not correct for a 64 bit Windows, but then we assume that
+ long long is supported and usable for storing a pointer. */
+#if defined(HAVE_LONG_LONG_INT) && (SIZEOF_UNSIGNED_LONG < SIZEOF_VOID_P)
+ aulong = (unsigned long long)value.a_void_ptr;
+#else
+ aulong = (unsigned long)value.a_void_ptr;
+#endif
+
+ p = pend = numbuf + DIM(numbuf);
+ do
+ {
+ *--p = "0123456789abcdefx"[(aulong % 16)];
+ aulong /= 16;
+ }
+ while (aulong);
+ while ((pend-p) < 2*sizeof (aulong))
+ *--p = '0';
+ *--p = 'x';
+ *--p = '0';
+
+ rc = outfnc (outfncarg, p, pend - p);
+ if (rc)
+ return rc;
+ *nbytes += pend - p;
+
+ return 0;
+}
+
+/* "n" pesudo format operation. */
+static int
+pr_bytes_so_far (estream_printf_out_t outfnc, void *outfncarg,
+ argspec_t arg, value_t value, size_t *nbytes)
+{
+ (void)outfnc;
+ (void)outfncarg;
+
+ switch (arg->vt)
+ {
+ case VALTYPE_SCHAR_PTR:
+ *value.a_schar_ptr = (signed char)(unsigned int)(*nbytes);
+ break;
+ case VALTYPE_SHORT_PTR:
+ *value.a_short_ptr = (short)(unsigned int)(*nbytes);
+ break;
+ case VALTYPE_LONG_PTR:
+ *value.a_long_ptr = (long)(*nbytes);
+ break;
+#ifdef HAVE_LONG_LONG_INT
+ case VALTYPE_LONGLONG_PTR:
+ *value.a_longlong_ptr = (long long)(*nbytes);
+ break;
+#endif
+#ifdef HAVE_INTMAX_T
+ case VALTYPE_INTMAX_PTR:
+ *value.a_intmax_ptr = (intmax_t)(*nbytes);
+ break;
+#endif
+ case VALTYPE_SIZE_PTR:
+ *value.a_size_ptr = (*nbytes);
+ break;
+#ifdef HAVE_PTRDIFF_T
+ case VALTYPE_PTRDIFF_PTR:
+ *value.a_ptrdiff_ptr = (ptrdiff_t)(*nbytes);
+ break;
+#endif
+ case VALTYPE_INT_PTR:
+ *value.a_int_ptr = (int)(*nbytes);
+ break;
+ default:
+ return -1; /* An unsupported type has been used. */
+ }
+
+ return 0;
+}
+
+
+
+/* Run the actual formatting. OUTFNC and OUTFNCARG are the output
+ functions. FORMAT is format string ARGSPECS is the parsed format
+ string, ARGSPECS_LEN the number of items in ARGSPECS. VALUETABLE
+ holds the values and may be directly addressed using the position
+ arguments given by ARGSPECS. MYERRNO is used for the "%m"
+ conversion. NBYTES well be updated to reflect the number of bytes
+ send to the output function. */
+static int
+do_format (estream_printf_out_t outfnc, void *outfncarg,
+ const char *format, argspec_t argspecs, size_t argspecs_len,
+ valueitem_t valuetable, int myerrno, size_t *nbytes)
+{
+ int rc = 0;
+ const char *s;
+ argspec_t arg = argspecs;
+ int argidx = 0; /* Only used for assertion. */
+ size_t n;
+ value_t value;
+
+ s = format;
+ while ( *s )
+ {
+ if (*s != '%')
+ {
+ s++;
+ continue;
+ }
+ if (s != format)
+ {
+ rc = outfnc (outfncarg, format, (n=s-format));
+ if (rc)
+ return rc;
+ *nbytes += n;
+ }
+ if (s[1] == '%')
+ {
+ /* Note that this code ignores one trailing percent escape -
+ this is however okay as the args parser must have
+ detected this already. */
+ rc = outfnc (outfncarg, s, 1);
+ if (rc)
+ return rc;
+ *nbytes += 1;
+ s += 2;
+ format = s;
+ continue;
+ }
+
+ /* Save the next start. */
+ s += arg->length;
+ format = s;
+
+ assert (argidx < argspecs_len);
+ argidx++;
+
+ /* Apply indirect field width and precision values. */
+ if (arg->width == STAR_FIELD_VALUE)
+ {
+ assert (valuetable[arg->width_pos-1].vt == VALTYPE_INT);
+ arg->width = valuetable[arg->width_pos-1].value.a_int;
+ if (arg->width < 0)
+ {
+ arg->width = -arg->width;
+ arg->flags |= FLAG_LEFT_JUST;
+ }
+ }
+ if (arg->precision == STAR_FIELD_VALUE)
+ {
+ assert (valuetable[arg->precision_pos-1].vt == VALTYPE_INT);
+ arg->precision = valuetable[arg->precision_pos-1].value.a_int;
+ if (arg->precision < 0)
+ arg->precision = NO_FIELD_VALUE;
+ }
+
+ if (arg->arg_pos == -1 && arg->conspec == CONSPEC_STRERROR)
+ value.a_string = strerror (myerrno);
+ else
+ {
+ assert (arg->vt == valuetable[arg->arg_pos-1].vt);
+ value = valuetable[arg->arg_pos-1].value;
+ }
+
+ switch (arg->conspec)
+ {
+ case CONSPEC_UNKNOWN: assert (!"bug"); break;
+
+ case CONSPEC_DECIMAL:
+ case CONSPEC_UNSIGNED:
+ case CONSPEC_OCTAL:
+ case CONSPEC_HEX:
+ case CONSPEC_HEX_UP:
+ rc = pr_integer (outfnc, outfncarg, arg, value, nbytes);
+ break;
+ case CONSPEC_FLOAT:
+ case CONSPEC_FLOAT_UP:
+ case CONSPEC_EXP:
+ case CONSPEC_EXP_UP:
+ case CONSPEC_F_OR_G:
+ case CONSPEC_F_OR_G_UP:
+ case CONSPEC_HEX_EXP:
+ case CONSPEC_HEX_EXP_UP:
+ rc = pr_float (outfnc, outfncarg, arg, value, nbytes);
+ break;
+ case CONSPEC_CHAR:
+ rc = pr_char (outfnc, outfncarg, arg, value, nbytes);
+ break;
+ case CONSPEC_STRING:
+ case CONSPEC_STRERROR:
+ rc = pr_string (outfnc, outfncarg, arg, value, nbytes);
+ break;
+ case CONSPEC_POINTER:
+ rc = pr_pointer (outfnc, outfncarg, arg, value, nbytes);
+ break;
+ case CONSPEC_BYTES_SO_FAR:
+ rc = pr_bytes_so_far (outfnc, outfncarg, arg, value, nbytes);
+ break;
+ }
+ if (rc)
+ return rc;
+ arg++;
+ }
+
+ /* Print out any trailing stuff. */
+ n = s - format;
+ rc = n? outfnc (outfncarg, format, n) : 0;
+ if (!rc)
+ *nbytes += n;
+
+ return rc;
+}
+
+
+
+
+/* The versatile printf formatting routine. It expects a callback
+ function OUTFNC and an opaque argument OUTFNCARG used for actual
+ output of the formatted stuff. FORMAT is the format specification
+ and VAARGS a variable argumemt list matching the arguments of
+ FORMAT. */
+int
+_gpgrt_estream_format (estream_printf_out_t outfnc,
+ void *outfncarg,
+ const char *format, va_list vaargs)
+{
+ /* Buffer to hold the argspecs and a pointer to it.*/
+ struct argspec_s argspecs_buffer[DEFAULT_MAX_ARGSPECS];
+ argspec_t argspecs = argspecs_buffer;
+ size_t argspecs_len; /* Number of specifications in ARGSPECS. */
+
+ /* Buffer to hold the description for the values. */
+ struct valueitem_s valuetable_buffer[DEFAULT_MAX_VALUES];
+ valueitem_t valuetable = valuetable_buffer;
+
+ int rc; /* Return code. */
+ size_t argidx; /* Used to index the argspecs array. */
+ size_t validx; /* Used to index the valuetable. */
+ int max_pos;/* Highest argument position. */
+
+ size_t nbytes = 0; /* Keep track of the number of bytes passed to
+ the output function. */
+
+ int myerrno = errno; /* Save the errno for use with "%m". */
+
+
+ /* Parse the arguments to come up with descriptive list. We can't
+ do this on the fly because we need to support positional
+ arguments. */
+ rc = parse_format (format, &argspecs, DIM(argspecs_buffer), &argspecs_len);
+ if (rc)
+ goto leave;
+
+ /* Check that all ARG_POS fields are set. */
+ for (argidx=0,max_pos=0; argidx < argspecs_len; argidx++)
+ {
+ if (argspecs[argidx].arg_pos != -1
+ && argspecs[argidx].arg_pos > max_pos)
+ max_pos = argspecs[argidx].arg_pos;
+ if (argspecs[argidx].width_pos > max_pos)
+ max_pos = argspecs[argidx].width_pos;
+ if (argspecs[argidx].precision_pos > max_pos)
+ max_pos = argspecs[argidx].precision_pos;
+ }
+ if (!max_pos)
+ {
+ /* Fill in all the positions. */
+ for (argidx=0; argidx < argspecs_len; argidx++)
+ {
+ if (argspecs[argidx].width == STAR_FIELD_VALUE)
+ argspecs[argidx].width_pos = ++max_pos;
+ if (argspecs[argidx].precision == STAR_FIELD_VALUE)
+ argspecs[argidx].precision_pos = ++max_pos;
+ if (argspecs[argidx].arg_pos != -1 )
+ argspecs[argidx].arg_pos = ++max_pos;
+ }
+ }
+ else
+ {
+ /* Check that they are all filled. More test are done later. */
+ for (argidx=0; argidx < argspecs_len; argidx++)
+ {
+ if (!argspecs[argidx].arg_pos
+ || (argspecs[argidx].width == STAR_FIELD_VALUE
+ && !argspecs[argidx].width_pos)
+ || (argspecs[argidx].precision == STAR_FIELD_VALUE
+ && !argspecs[argidx].precision_pos))
+ goto leave_einval;
+ }
+ }
+ /* Check that there is no overflow in max_pos and that it has a
+ reasonable length. There may never be more elements than the
+ number of characters in FORMAT. */
+ if (max_pos < 0 || max_pos >= strlen (format))
+ goto leave_einval;
+
+#ifdef DEBUG
+ dump_argspecs (argspecs, argspecs_len);
+#endif
+
+ /* Allocate a table to hold the values. If it is small enough we
+ use a stack allocated buffer. */
+ if (max_pos > DIM(valuetable_buffer))
+ {
+ valuetable = calloc (max_pos, sizeof *valuetable);
+ if (!valuetable)
+ goto leave_error;
+ }
+ else
+ {
+ for (validx=0; validx < DIM(valuetable_buffer); validx++)
+ valuetable[validx].vt = VALTYPE_UNSUPPORTED;
+ }
+ for (argidx=0; argidx < argspecs_len; argidx++)
+ {
+ if (argspecs[argidx].arg_pos != - 1)
+ {
+ validx = argspecs[argidx].arg_pos - 1;
+ if (valuetable[validx].vt)
+ goto leave_einval; /* Already defined. */
+ valuetable[validx].vt = argspecs[argidx].vt;
+ }
+ if (argspecs[argidx].width == STAR_FIELD_VALUE)
+ {
+ validx = argspecs[argidx].width_pos - 1;
+ if (valuetable[validx].vt)
+ goto leave_einval; /* Already defined. */
+ valuetable[validx].vt = VALTYPE_INT;
+ }
+ if (argspecs[argidx].precision == STAR_FIELD_VALUE)
+ {
+ validx = argspecs[argidx].precision_pos - 1;
+ if (valuetable[validx].vt)
+ goto leave_einval; /* Already defined. */
+ valuetable[validx].vt = VALTYPE_INT;
+ }
+ }
+
+ /* Read all the arguments. This will error out for unsupported
+ types and for not given positional arguments. */
+ rc = read_values (valuetable, max_pos, vaargs);
+ if (rc)
+ goto leave_einval;
+
+/* for (validx=0; validx < max_pos; validx++) */
+/* fprintf (stderr, "%2d: vt=%d\n", validx, valuetable[validx].vt); */
+
+ /* Everything has been collected, go ahead with the formatting. */
+ rc = do_format (outfnc, outfncarg, format,
+ argspecs, argspecs_len, valuetable, myerrno, &nbytes);
+
+ goto leave;
+
+ leave_einval:
+ _set_errno (EINVAL);
+ leave_error:
+ rc = -1;
+ leave:
+ if (valuetable != valuetable_buffer)
+ free (valuetable);
+ if (argspecs != argspecs_buffer)
+ free (argspecs);
+ return rc;
+}
+
+
+
+
+/* A simple output handler utilizing stdio. */
+static int
+plain_stdio_out (void *outfncarg, const char *buf, size_t buflen)
+{
+ FILE *fp = (FILE*)outfncarg;
+
+ if ( fwrite (buf, buflen, 1, fp) != 1 )
+ return -1;
+ return 0;
+}
+
+
+/* A replacement for printf. */
+int
+_gpgrt_estream_printf (const char *format, ...)
+{
+ int rc;
+ va_list arg_ptr;
+
+ va_start (arg_ptr, format);
+ rc = _gpgrt_estream_format (plain_stdio_out, stderr, format, arg_ptr);
+ va_end (arg_ptr);
+
+ return rc;
+}
+
+/* A replacement for fprintf. */
+int
+_gpgrt_estream_fprintf (FILE *fp, const char *format, ...)
+{
+ int rc;
+ va_list arg_ptr;
+
+ va_start (arg_ptr, format);
+ rc = _gpgrt_estream_format (plain_stdio_out, fp, format, arg_ptr);
+ va_end (arg_ptr);
+
+ return rc;
+}
+
+/* A replacement for vfprintf. */
+int
+_gpgrt_estream_vfprintf (FILE *fp, const char *format, va_list arg_ptr)
+{
+ return _gpgrt_estream_format (plain_stdio_out, fp, format, arg_ptr);
+}
+
+
+
+/* Communication object used between estream_snprintf and
+ fixed_buffer_out. */
+struct fixed_buffer_parm_s
+{
+ size_t size; /* Size of the buffer. */
+ size_t count; /* Number of bytes requested for output. */
+ size_t used; /* Used size of the buffer. */
+ char *buffer; /* Provided buffer. */
+};
+
+/* A simple malloced buffer output handler. */
+static int
+fixed_buffer_out (void *outfncarg, const char *buf, size_t buflen)
+{
+ struct fixed_buffer_parm_s *parm = outfncarg;
+
+ parm->count += buflen;
+
+ if (!parm->buffer)
+ ;
+ else if (parm->used + buflen < parm->size)
+ {
+ /* Handle the common case that everything fits into the buffer
+ separately. */
+ memcpy (parm->buffer + parm->used, buf, buflen);
+ parm->used += buflen;
+ }
+ else
+ {
+ /* The slow version of above. */
+ for ( ;buflen && parm->used < parm->size; buflen--)
+ parm->buffer[parm->used++] = *buf++;
+ }
+
+ return 0;
+}
+
+
+/* A replacement for vsnprintf. */
+int
+_gpgrt_estream_vsnprintf (char *buf, size_t bufsize,
+ const char *format, va_list arg_ptr)
+{
+ struct fixed_buffer_parm_s parm;
+ int rc;
+
+ parm.size = bufsize;
+ parm.count = 0;
+ parm.used = 0;
+ parm.buffer = bufsize?buf:NULL;
+ rc = _gpgrt_estream_format (fixed_buffer_out, &parm, format, arg_ptr);
+ if (!rc)
+ rc = fixed_buffer_out (&parm, "", 1); /* Print terminating Nul. */
+ if (rc == -1)
+ return -1;
+ if (bufsize && buf && parm.size && parm.count >= parm.size)
+ buf[parm.size-1] = 0;
+
+ parm.count--; /* Do not count the trailing nul. */
+ return (int)parm.count; /* Return number of bytes which would have
+ been written. */
+}
+
+/* A replacement for snprintf. */
+int
+_gpgrt_estream_snprintf (char *buf, size_t bufsize, const char *format, ...)
+{
+ int rc;
+ va_list arg_ptr;
+
+ va_start (arg_ptr, format);
+ rc = _gpgrt_estream_vsnprintf (buf, bufsize, format, arg_ptr);
+ va_end (arg_ptr);
+
+ return rc;
+}
+
+
+
+/* Communication object used between estream_asprintf and
+ dynamic_buffer_out. */
+struct dynamic_buffer_parm_s
+{
+ int error_flag; /* Internal helper. */
+ size_t alloced; /* Allocated size of the buffer. */
+ size_t used; /* Used size of the buffer. */
+ char *buffer; /* Malloced buffer. */
+};
+
+/* A simple malloced buffer output handler. */
+static int
+dynamic_buffer_out (void *outfncarg, const char *buf, size_t buflen)
+{
+ struct dynamic_buffer_parm_s *parm = outfncarg;
+
+ if (parm->error_flag)
+ {
+ /* Just in case some formatting routine did not checked for an
+ error. */
+ _set_errno (parm->error_flag);
+ return -1;
+ }
+
+ if (parm->used + buflen >= parm->alloced)
+ {
+ char *p;
+
+ parm->alloced += buflen + 512;
+ p = my_printf_realloc (parm->buffer, parm->alloced);
+ if (!p)
+ {
+ parm->error_flag = errno ? errno : ENOMEM;
+ /* Wipe out what we already accumulated. This is useful in
+ case sensitive data is formatted. */
+ memset (parm->buffer, 0, parm->used);
+ return -1;
+ }
+ parm->buffer = p;
+ }
+ memcpy (parm->buffer + parm->used, buf, buflen);
+ parm->used += buflen;
+
+ return 0;
+}
+
+
+/* A replacement for vasprintf. As with the BSD version of vasprintf
+ -1 will be returned on error and NULL stored at BUFP. On success
+ the number of bytes printed will be returned. */
+int
+_gpgrt_estream_vasprintf (char **bufp, const char *format, va_list arg_ptr)
+{
+ struct dynamic_buffer_parm_s parm;
+ int rc;
+
+ parm.error_flag = 0;
+ parm.alloced = 512;
+ parm.used = 0;
+ parm.buffer = my_printf_realloc (NULL, parm.alloced);
+ if (!parm.buffer)
+ {
+ *bufp = NULL;
+ return -1;
+ }
+
+ rc = _gpgrt_estream_format (dynamic_buffer_out, &parm, format, arg_ptr);
+ if (!rc)
+ rc = dynamic_buffer_out (&parm, "", 1); /* Print terminating Nul. */
+ /* Fixme: Should we shrink the resulting buffer? */
+ if (rc != -1 && parm.error_flag)
+ {
+ rc = -1;
+ _set_errno (parm.error_flag);
+ }
+ if (rc == -1)
+ {
+ memset (parm.buffer, 0, parm.used);
+ if (parm.buffer)
+ my_printf_realloc (parm.buffer, 0);
+ *bufp = NULL;
+ return -1;
+ }
+ assert (parm.used); /* We have at least the terminating Nul. */
+ *bufp = parm.buffer;
+ return parm.used - 1; /* Do not include that Nul. */
+}
+
+/* A replacement for asprintf. As with the BSD of asprintf version -1
+ will be returned on error and NULL stored at BUFP. On success the
+ number of bytes printed will be returned. */
+int
+_gpgrt_estream_asprintf (char **bufp, const char *format, ...)
+{
+ int rc;
+ va_list arg_ptr;
+
+ va_start (arg_ptr, format);
+ rc = _gpgrt_estream_vasprintf (bufp, format, arg_ptr);
+ va_end (arg_ptr);
+
+ return rc;
+}
+
+/* A variant of asprintf. The function returns the allocated buffer
+ or NULL on error; ERRNO is set in the error case. The caller
+ should use es_free to release the buffer. This function actually
+ belongs into estream-printf but we put it here as a convenience
+ and because es_free is required anyway. */
+char *
+_gpgrt_estream_bsprintf (const char *format, ...)
+{
+ int rc;
+ va_list ap;
+ char *buf;
+
+ va_start (ap, format);
+ rc = _gpgrt_estream_vasprintf (&buf, format, ap);
+ va_end (ap);
+ if (rc < 0)
+ return NULL;
+ return buf;
+}
diff --git a/src/estream-printf.h b/src/estream-printf.h
new file mode 100644
index 0000000..ae303a7
--- /dev/null
+++ b/src/estream-printf.h
@@ -0,0 +1,151 @@
+/* estream-printf.h - Versatile mostly C-99 compliant printf formatting.
+ * Copyright (C) 2007, 2010, 2012 g10 Code GmbH
+ *
+ * This file is part of Libestream.
+ *
+ * Libestream is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * Libestream is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libestream; if not, see <https://www.gnu.org/licenses/>.
+ *
+ * ALTERNATIVELY, Libestream may be distributed under the terms of the
+ * following license, in which case the provisions of this license are
+ * required INSTEAD OF the GNU General Public License. If you wish to
+ * allow use of your version of this file only under the terms of the
+ * GNU General Public License, and not to allow others to use your
+ * version of this file under the terms of the following license,
+ * indicate your decision by deleting this paragraph and the license
+ * below.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, and the entire permission notice in its entirety,
+ * including the disclaimer of warranties.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ESTREAM_PRINTF_H
+#define ESTREAM_PRINTF_H
+
+#include <stdarg.h>
+#include <stdio.h>
+
+/* To use this file with libraries the following macro is useful:
+
+ #define _ESTREAM_EXT_SYM_PREFIX _foo_
+
+ This prefixes all external symbols with "_foo_".
+
+ For the implementation of the code (estream-printf.c) the following
+ macros may be used to tune the implementation for certain systems:
+
+ #define _ESTREAM_PRINTF_REALLOC foo_realloc
+
+ Make estream_asprintf and estream_vasprintf use foo_realloc
+ instead of the standard realloc to allocate memory returned to
+ the caller. Note that foo_realloc needs to be C-90 compliant:
+ foo_realloc (NULL,n) is the same as a call to malloc(n) and
+ foo_realloc (a, 0) is the same as a call to free (a).
+
+ #define _ESTREAM_PRINTF_EXTRA_INCLUDE "foo.h"
+
+ This includes the file "foo.h" which may provide prototypes for
+ the custom memory allocation functions.
+ */
+
+
+#ifdef _ESTREAM_EXT_SYM_PREFIX
+#ifndef _ESTREAM_PREFIX
+#define _ESTREAM_PREFIX1(x,y) x ## y
+#define _ESTREAM_PREFIX2(x,y) _ESTREAM_PREFIX1(x,y)
+#define _ESTREAM_PREFIX(x) _ESTREAM_PREFIX2(_ESTREAM_EXT_SYM_PREFIX,x)
+#endif /*_ESTREAM_PREFIX*/
+#define estream_printf_out_t _ESTREAM_PREFIX(estream_printf_out_t)
+#define estream_format _ESTREAM_PREFIX(estream_format)
+#define estream_printf _ESTREAM_PREFIX(estream_printf)
+#define estream_fprintf _ESTREAM_PREFIX(estream_fprintf)
+#define estream_vfprintf _ESTREAM_PREFIX(estream_vfprintf)
+#define estream_snprintf _ESTREAM_PREFIX(estream_snprintf)
+#define estream_vsnprintf _ESTREAM_PREFIX(estream_vsnprintf)
+#define estream_asprintf _ESTREAM_PREFIX(estream_asprintf)
+#define estream_vasprintf _ESTREAM_PREFIX(estream_vasprintf)
+#endif /*_ESTREAM_EXT_SYM_PREFIX*/
+
+#ifndef _ESTREAM_GCC_A_PRINTF
+# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4 )
+# define _ESTREAM_GCC_A_PRINTF( f, a ) \
+ __attribute__ ((format (__gnu_printf__,f,a)))
+# elif __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5 )
+# define _ESTREAM_GCC_A_PRINTF( f, a ) \
+ __attribute__ ((format (printf,f,a)))
+# else
+# define _ESTREAM_GCC_A_PRINTF( f, a )
+# endif
+#endif /*_ESTREAM_GCC_A_PRINTF*/
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#if 0
+}
+#endif
+#endif
+
+
+typedef int (*estream_printf_out_t)
+ (void *outfncarg, const char *buf, size_t buflen);
+
+int _gpgrt_estream_format (estream_printf_out_t outfnc, void *outfncarg,
+ const char *format, va_list vaargs)
+ _ESTREAM_GCC_A_PRINTF(3,0);
+int _gpgrt_estream_printf (const char *format, ...)
+ _ESTREAM_GCC_A_PRINTF(1,2);
+int _gpgrt_estream_fprintf (FILE *fp, const char *format, ... )
+ _ESTREAM_GCC_A_PRINTF(2,3);
+int _gpgrt_estream_vfprintf (FILE *fp, const char *format, va_list arg_ptr)
+ _ESTREAM_GCC_A_PRINTF(2,0);
+int _gpgrt_estream_snprintf (char *buf, size_t bufsize, const char *format, ...)
+ _ESTREAM_GCC_A_PRINTF(3,4);
+int _gpgrt_estream_vsnprintf (char *buf,size_t bufsize,
+ const char *format, va_list arg_ptr)
+ _ESTREAM_GCC_A_PRINTF(3,0);
+int _gpgrt_estream_asprintf (char **bufp, const char *format, ...)
+ _ESTREAM_GCC_A_PRINTF(2,3);
+int _gpgrt_estream_vasprintf (char **bufp, const char *format, va_list arg_ptr)
+ _ESTREAM_GCC_A_PRINTF(2,0);
+char *_gpgrt_estream_bsprintf (const char *format, ...)
+ _ESTREAM_GCC_A_PRINTF(1,2);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /*ESTREAM_PRINTF_H*/
diff --git a/src/estream.c b/src/estream.c
new file mode 100644
index 0000000..2f29cdb
--- /dev/null
+++ b/src/estream.c
@@ -0,0 +1,5208 @@
+/* estream.c - Extended Stream I/O Library
+ * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011,
+ * 2014, 2015, 2016, 2017 g10 Code GmbH
+ *
+ * This file is part of Libestream.
+ *
+ * Libestream is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * Libestream is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libestream; if not, see <https://www.gnu.org/licenses/>.
+ *
+ * ALTERNATIVELY, Libestream may be distributed under the terms of the
+ * following license, in which case the provisions of this license are
+ * required INSTEAD OF the GNU General Public License. If you wish to
+ * allow use of your version of this file only under the terms of the
+ * GNU General Public License, and not to allow others to use your
+ * version of this file under the terms of the following license,
+ * indicate your decision by deleting this paragraph and the license
+ * below.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, and the entire permission notice in its entirety,
+ * including the disclaimer of warranties.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef USE_ESTREAM_SUPPORT_H
+# include <estream-support.h>
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined(_WIN32) && !defined(HAVE_W32_SYSTEM)
+# define HAVE_W32_SYSTEM 1
+# if defined(__MINGW32CE__) && !defined (HAVE_W32CE_SYSTEM)
+# define HAVE_W32CE_SYSTEM
+# endif
+#endif
+
+#ifdef HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#include <sys/types.h>
+#include <sys/file.h>
+#include <sys/stat.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdarg.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <stddef.h>
+#include <assert.h>
+#ifdef HAVE_W32_SYSTEM
+# ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+# endif
+# include <windows.h>
+#endif
+
+/* Enable tracing. The value is the module name to be printed. */
+/*#define ENABLE_TRACING "estream"*/
+
+#include "gpgrt-int.h"
+#include "estream-printf.h"
+#include "thread.h"
+#include "lock.h"
+
+
+#ifndef O_BINARY
+# define O_BINARY 0
+#endif
+#ifndef HAVE_DOSISH_SYSTEM
+# ifdef HAVE_W32_SYSTEM
+# define HAVE_DOSISH_SYSTEM 1
+# endif
+#endif
+
+
+#ifdef HAVE_W32_SYSTEM
+# ifndef S_IRGRP
+# define S_IRGRP S_IRUSR
+# endif
+# ifndef S_IROTH
+# define S_IROTH S_IRUSR
+# endif
+# ifndef S_IWGRP
+# define S_IWGRP S_IWUSR
+# endif
+# ifndef S_IWOTH
+# define S_IWOTH S_IWUSR
+# endif
+# ifndef S_IXGRP
+# define S_IXGRP S_IXUSR
+# endif
+# ifndef S_IXOTH
+# define S_IXOTH S_IXUSR
+# endif
+#endif
+
+#if !defined (EWOULDBLOCK) && defined (HAVE_W32_SYSTEM)
+/* Compatibility with errno.h from mingw-2.0 */
+# define EWOULDBLOCK 140
+#endif
+
+#ifndef EAGAIN
+# define EAGAIN EWOULDBLOCK
+#endif
+
+
+#ifdef HAVE_W32CE_SYSTEM
+# define _set_errno(a) gpg_err_set_errno ((a))
+/* Setmode is missing in cegcc but available since CE 5.0. */
+int _setmode (int handle, int mode);
+# define setmode(a,b) _setmode ((a),(b))
+#else
+# define _set_errno(a) do { errno = (a); } while (0)
+#endif
+
+#ifdef HAVE_W32_SYSTEM
+# define IS_INVALID_FD(a) ((void*)(a) == (void*)(-1)) /* ?? FIXME. */
+#else
+# define IS_INVALID_FD(a) ((a) == -1)
+#endif
+
+/* Calculate array dimension. */
+#ifndef DIM
+#define DIM(array) (sizeof (array) / sizeof (*array))
+#endif
+
+/* A helper macro used to convert to a hex string. */
+#define tohex(n) ((n) < 10 ? ((n) + '0') : (((n) - 10) + 'A'))
+
+
+/* Generally used types. */
+
+typedef void *(*func_realloc_t) (void *mem, size_t size);
+typedef void (*func_free_t) (void *mem);
+
+
+
+
+/*
+ * A linked list to hold active stream objects.
+ * Protected by ESTREAM_LIST_LOCK.
+ */
+struct estream_list_s
+{
+ struct estream_list_s *next;
+ estream_t stream; /* Entry is not used if NULL. */
+};
+typedef struct estream_list_s *estream_list_t;
+static estream_list_t estream_list;
+
+/*
+ * File descriptors registered for use as the standard file handles.
+ * Protected by ESTREAM_LIST_LOCK.
+ */
+static int custom_std_fds[3];
+static unsigned char custom_std_fds_valid[3];
+
+/*
+ * A lock object to protect ESTREAM LIST, CUSTOM_STD_FDS and
+ * CUSTOM_STD_FDS_VALID. Used by lock_list() and unlock_list().
+ */
+GPGRT_LOCK_DEFINE (estream_list_lock);
+
+
+/*
+ * Functions called before and after blocking syscalls.
+ * gpgrt_set_syscall_clamp is used to set them.
+ */
+static void (*pre_syscall_func)(void);
+static void (*post_syscall_func)(void);
+
+
+/*
+ * Error code replacements.
+ */
+#ifndef EOPNOTSUPP
+# define EOPNOTSUPP ENOSYS
+#endif
+
+
+/* Local prototypes. */
+static void fname_set_internal (estream_t stream, const char *fname, int quote);
+
+
+
+
+/*
+ * Memory allocation wrappers used in this file.
+ */
+static void *
+mem_alloc (size_t n)
+{
+ return _gpgrt_malloc (n);
+}
+
+static void *
+mem_realloc (void *p, size_t n)
+{
+ return _gpgrt_realloc (p, n);
+}
+
+static void
+mem_free (void *p)
+{
+ if (p)
+ _gpgrt_free (p);
+}
+
+
+/*
+ * A Windows helper function to map a W32 API error code to a standard
+ * system error code.
+ */
+#ifdef HAVE_W32_SYSTEM
+static int
+map_w32_to_errno (DWORD w32_err)
+{
+ switch (w32_err)
+ {
+ case 0:
+ return 0;
+
+ case ERROR_FILE_NOT_FOUND:
+ return ENOENT;
+
+ case ERROR_PATH_NOT_FOUND:
+ return ENOENT;
+
+ case ERROR_ACCESS_DENIED:
+ return EPERM;
+
+ case ERROR_INVALID_HANDLE:
+ case ERROR_INVALID_BLOCK:
+ return EINVAL;
+
+ case ERROR_NOT_ENOUGH_MEMORY:
+ return ENOMEM;
+
+ case ERROR_NO_DATA:
+ return EPIPE;
+
+ default:
+ return EIO;
+ }
+}
+#endif /*HAVE_W32_SYSTEM*/
+
+/*
+ * Replacement for a missing memrchr.
+ */
+#ifndef HAVE_MEMRCHR
+static void *
+memrchr (const void *buffer, int c, size_t n)
+{
+ const unsigned char *p = buffer;
+
+ for (p += n; n ; n--)
+ if (*--p == c)
+ return (void *)p;
+ return NULL;
+}
+#endif /*HAVE_MEMRCHR*/
+
+
+
+/*
+ * Wrappers to lock a stream or the list of streams.
+ */
+#if 0
+# define dbg_lock_0(f) fprintf (stderr, "estream: " f);
+# define dbg_lock_1(f, a) fprintf (stderr, "estream: " f, (a));
+# define dbg_lock_2(f, a, b) fprintf (stderr, "estream: " f, (a), (b));
+#else
+# define dbg_lock_0(f)
+# define dbg_lock_1(f, a)
+# define dbg_lock_2(f, a, b)
+#endif
+
+static int
+init_stream_lock (estream_t _GPGRT__RESTRICT stream)
+{
+ int rc;
+
+ if (!stream->intern->samethread)
+ {
+ dbg_lock_1 ("enter init_stream_lock for %p\n", stream);
+ memset (&stream->intern->lock, 0 , sizeof stream->intern->lock);
+ rc = _gpgrt_lock_init (&stream->intern->lock);
+ dbg_lock_2 ("leave init_stream_lock for %p: rc=%d\n", stream, rc);
+ }
+ else
+ rc = 0;
+ return rc;
+}
+
+
+static void
+destroy_stream_lock (estream_t _GPGRT__RESTRICT stream)
+{
+ if (!stream->intern->samethread)
+ {
+ dbg_lock_1 ("enter destroy_stream_lock for %p\n", stream);
+ _gpgrt_lock_destroy (&stream->intern->lock);
+ dbg_lock_1 ("leave destroy_stream_lock for %p\n", stream);
+ }
+}
+
+
+static void
+lock_stream (estream_t _GPGRT__RESTRICT stream)
+{
+ if (!stream->intern->samethread)
+ {
+ dbg_lock_1 ("enter lock_stream for %p\n", stream);
+ _gpgrt_lock_lock (&stream->intern->lock);
+ dbg_lock_1 ("leave lock_stream for %p\n", stream);
+ }
+}
+
+
+static int
+trylock_stream (estream_t _GPGRT__RESTRICT stream)
+{
+ int rc;
+
+ if (!stream->intern->samethread)
+ {
+ dbg_lock_1 ("enter trylock_stream for %p\n", stream);
+ rc = _gpgrt_lock_trylock (&stream->intern->lock)? 0 : -1;
+ dbg_lock_2 ("leave trylock_stream for %p: rc=%d\n", stream, rc);
+ }
+ else
+ rc = 0;
+ return rc;
+}
+
+
+static void
+unlock_stream (estream_t _GPGRT__RESTRICT stream)
+{
+ if (!stream->intern->samethread)
+ {
+ dbg_lock_1 ("enter unlock_stream for %p\n", stream);
+ _gpgrt_lock_unlock (&stream->intern->lock);
+ dbg_lock_1 ("leave unlock_stream for %p\n", stream);
+ }
+}
+
+
+static void
+lock_list (void)
+{
+ dbg_lock_0 ("enter lock_list\n");
+ _gpgrt_lock_lock (&estream_list_lock);
+ dbg_lock_0 ("leave lock_list\n");
+}
+
+
+static void
+unlock_list (void)
+{
+ dbg_lock_0 ("enter unlock_list\n");
+ _gpgrt_lock_unlock (&estream_list_lock);
+ dbg_lock_0 ("leave unlock_list\n");
+}
+
+
+#undef dbg_lock_0
+#undef dbg_lock_1
+#undef dbg_lock_2
+
+
+
+/*
+ * Manipulation of the list of stream.
+ */
+
+/*
+ * Add STREAM to the list of registered stream objects. If
+ * WITH_LOCKED_LIST is true it is assumed that the list of streams is
+ * already locked. The implementation is straightforward: We first
+ * look for an unused entry in the list and use that; if none is
+ * available we put a new item at the head. We drawback of the
+ * strategy never to shorten the list is that a one time allocation of
+ * many streams will lead to scanning unused entries later. If that
+ * turns out to be a problem, we may either free some items from the
+ * list or append new entries at the end; or use a table. Returns 0
+ * on success; on error or non-zero is returned and ERRNO set.
+ */
+static int
+do_list_add (estream_t stream, int with_locked_list)
+{
+ estream_list_t item;
+
+ if (!with_locked_list)
+ lock_list ();
+
+ for (item = estream_list; item && item->stream; item = item->next)
+ ;
+ if (!item)
+ {
+ item = mem_alloc (sizeof *item);
+ if (item)
+ {
+ item->next = estream_list;
+ estream_list = item;
+ }
+ }
+ if (item)
+ item->stream = stream;
+
+ if (!with_locked_list)
+ unlock_list ();
+
+ return item? 0 : -1;
+}
+
+/*
+ * Remove STREAM from the list of registered stream objects.
+ */
+static void
+do_list_remove (estream_t stream, int with_locked_list)
+{
+ estream_list_t item, item_prev = NULL;
+
+ if (!with_locked_list)
+ lock_list ();
+
+ for (item = estream_list; item; item = item->next)
+ if (item->stream == stream)
+ break;
+ else
+ item_prev = item;
+
+ if (item_prev)
+ {
+ item_prev->next = item->next;
+ mem_free (item);
+ }
+ else
+ {
+ if (item)
+ {
+ estream_list = item->next;
+ mem_free (item);
+ }
+ }
+
+ if (!with_locked_list)
+ unlock_list ();
+}
+
+
+
+/*
+ * The atexit handler for this estream module.
+ */
+static void
+do_deinit (void)
+{
+ /* Flush all streams. */
+ _gpgrt_fflush (NULL);
+
+ /* We should release the estream_list. However there is one
+ problem: That list is also used to search for the standard
+ estream file descriptors. If we would remove the entire list,
+ any use of es_foo in another atexit function may re-create the
+ list and the streams with possible undesirable effects. Given
+ that we don't close the stream either, it should not matter that
+ we keep the list and let the OS clean it up at process end. */
+
+ /* Reset the syscall clamp. */
+ pre_syscall_func = NULL;
+ post_syscall_func = NULL;
+ _gpgrt_thread_set_syscall_clamp (NULL, NULL);
+ _gpgrt_lock_set_lock_clamp (NULL, NULL);
+}
+
+
+/*
+ * Initialization of the estream module.
+ */
+int
+_gpgrt_estream_init (void)
+{
+ static int initialized;
+
+ if (!initialized)
+ {
+ initialized = 1;
+ atexit (do_deinit);
+ }
+ return 0;
+}
+
+/*
+ * Register the syscall clamp. These two functions are called
+ * immediately before and after a possible blocking system call. This
+ * should be used before any I/O happens. The function is commonly
+ * used with the nPth library:
+ *
+ * gpgrt_set_syscall_clamp (npth_unprotect, npth_protect);
+ *
+ * These functions may not modify ERRNO.
+ */
+void
+_gpgrt_set_syscall_clamp (void (*pre)(void), void (*post)(void))
+{
+ pre_syscall_func = pre;
+ post_syscall_func = post;
+ _gpgrt_thread_set_syscall_clamp (pre, post);
+ _gpgrt_lock_set_lock_clamp (pre, post);
+}
+
+/*
+ * Return the current sycall clamp functions. This can be used by
+ * other libraries which have blocking functions.
+ */
+void
+_gpgrt_get_syscall_clamp (void (**r_pre)(void), void (**r_post)(void))
+{
+ *r_pre = pre_syscall_func;
+ *r_post = post_syscall_func;
+}
+
+
+
+/*
+ * Implementation of memory based I/O.
+ */
+
+/* Cookie for memory objects. */
+typedef struct estream_cookie_mem
+{
+ unsigned int modeflags; /* Open flags. */
+ unsigned char *memory; /* Allocated data buffer. */
+ size_t memory_size; /* Allocated size of MEMORY. */
+ size_t memory_limit; /* Caller supplied maximum allowed
+ allocation size or 0 for no limit. */
+ size_t offset; /* Current offset in MEMORY. */
+ size_t data_len; /* Used length of data in MEMORY. */
+ size_t block_size; /* Block size. */
+ struct {
+ unsigned int grow: 1; /* MEMORY is allowed to grow. */
+ } flags;
+ func_realloc_t func_realloc;
+ func_free_t func_free;
+} *estream_cookie_mem_t;
+
+
+/*
+ * Create function for memory objects. DATA is either NULL or a user
+ * supplied buffer with the initial conetnt of the memory buffer. If
+ * DATA is NULL, DATA_N and DATA_LEN need to be 0 as well. If DATA is
+ * not NULL, DATA_N gives the allocated size of DATA and DATA_LEN the
+ * used length in DATA. If this function succeeds DATA is now owned
+ * by this function. If GROW is false FUNC_REALLOC is not
+ * required.
+ */
+static int
+func_mem_create (void *_GPGRT__RESTRICT *_GPGRT__RESTRICT cookie,
+ unsigned char *_GPGRT__RESTRICT data, size_t data_n,
+ size_t data_len,
+ size_t block_size, unsigned int grow,
+ func_realloc_t func_realloc, func_free_t func_free,
+ unsigned int modeflags,
+ size_t memory_limit)
+{
+ estream_cookie_mem_t mem_cookie;
+ int err;
+
+ if (!data && (data_n || data_len))
+ {
+ _set_errno (EINVAL);
+ return -1;
+ }
+ if (grow && func_free && !func_realloc)
+ {
+ _set_errno (EINVAL);
+ return -1;
+ }
+
+ /* Round a memory limit up to the next block length. */
+ if (memory_limit && block_size)
+ {
+ memory_limit += block_size - 1;
+ memory_limit /= block_size;
+ memory_limit *= block_size;
+ }
+
+ mem_cookie = mem_alloc (sizeof (*mem_cookie));
+ if (!mem_cookie)
+ err = -1;
+ else
+ {
+ mem_cookie->modeflags = modeflags;
+ mem_cookie->memory = data;
+ mem_cookie->memory_size = data_n;
+ mem_cookie->memory_limit = memory_limit;
+ mem_cookie->offset = 0;
+ mem_cookie->data_len = data_len;
+ mem_cookie->block_size = block_size;
+ mem_cookie->flags.grow = !!grow;
+ mem_cookie->func_realloc
+ = grow? (func_realloc ? func_realloc : mem_realloc) : NULL;
+ mem_cookie->func_free = func_free ? func_free : mem_free;
+ *cookie = mem_cookie;
+ err = 0;
+ }
+
+ return err;
+}
+
+
+/*
+ * Read function for memory objects.
+ */
+static gpgrt_ssize_t
+func_mem_read (void *cookie, void *buffer, size_t size)
+{
+ estream_cookie_mem_t mem_cookie = cookie;
+ gpgrt_ssize_t ret;
+
+ if (!size) /* Just the pending data check. */
+ return (mem_cookie->data_len - mem_cookie->offset)? 0 : -1;
+
+ if (size > mem_cookie->data_len - mem_cookie->offset)
+ size = mem_cookie->data_len - mem_cookie->offset;
+
+ if (size)
+ {
+ memcpy (buffer, mem_cookie->memory + mem_cookie->offset, size);
+ mem_cookie->offset += size;
+ }
+
+ ret = size;
+ return ret;
+}
+
+
+/*
+ * Write function for memory objects.
+ */
+static gpgrt_ssize_t
+func_mem_write (void *cookie, const void *buffer, size_t size)
+{
+ estream_cookie_mem_t mem_cookie = cookie;
+ gpgrt_ssize_t ret;
+ size_t nleft;
+
+ if (!size)
+ return 0; /* A flush is a NOP for memory objects. */
+
+ if (mem_cookie->modeflags & O_APPEND)
+ {
+ /* Append to data. */
+ mem_cookie->offset = mem_cookie->data_len;
+ }
+
+ assert (mem_cookie->memory_size >= mem_cookie->offset);
+ nleft = mem_cookie->memory_size - mem_cookie->offset;
+
+ /* If we are not allowed to grow the buffer, limit the size to the
+ left space. */
+ if (!mem_cookie->flags.grow && size > nleft)
+ size = nleft;
+
+ /* Enlarge the memory buffer if needed. */
+ if (size > nleft)
+ {
+ unsigned char *newbuf;
+ size_t newsize;
+
+ if (!mem_cookie->memory_size)
+ newsize = size; /* Not yet allocated. */
+ else
+ newsize = mem_cookie->memory_size + (size - nleft);
+ if (newsize < mem_cookie->offset)
+ {
+ _set_errno (EINVAL);
+ return -1;
+ }
+
+ /* Round up to the next block length. BLOCK_SIZE should always
+ be set; we check anyway. */
+ if (mem_cookie->block_size)
+ {
+ newsize += mem_cookie->block_size - 1;
+ if (newsize < mem_cookie->offset)
+ {
+ _set_errno (EINVAL);
+ return -1;
+ }
+ newsize /= mem_cookie->block_size;
+ newsize *= mem_cookie->block_size;
+ }
+
+ /* Check for a total limit. */
+ if (mem_cookie->memory_limit && newsize > mem_cookie->memory_limit)
+ {
+ _set_errno (ENOSPC);
+ return -1;
+ }
+
+ assert (mem_cookie->func_realloc);
+ newbuf = mem_cookie->func_realloc (mem_cookie->memory, newsize);
+ if (!newbuf)
+ return -1;
+
+ mem_cookie->memory = newbuf;
+ mem_cookie->memory_size = newsize;
+
+ assert (mem_cookie->memory_size >= mem_cookie->offset);
+ nleft = mem_cookie->memory_size - mem_cookie->offset;
+
+ assert (size <= nleft);
+ }
+
+ memcpy (mem_cookie->memory + mem_cookie->offset, buffer, size);
+ if (mem_cookie->offset + size > mem_cookie->data_len)
+ mem_cookie->data_len = mem_cookie->offset + size;
+ mem_cookie->offset += size;
+
+ ret = size;
+ return ret;
+}
+
+
+/*
+ * Seek function for memory objects.
+ */
+static int
+func_mem_seek (void *cookie, gpgrt_off_t *offset, int whence)
+{
+ estream_cookie_mem_t mem_cookie = cookie;
+ gpgrt_off_t pos_new;
+
+ switch (whence)
+ {
+ case SEEK_SET:
+ pos_new = *offset;
+ break;
+
+ case SEEK_CUR:
+ pos_new = mem_cookie->offset += *offset;
+ break;
+
+ case SEEK_END:
+ pos_new = mem_cookie->data_len += *offset;
+ break;
+
+ default:
+ _set_errno (EINVAL);
+ return -1;
+ }
+
+ if (pos_new > mem_cookie->memory_size)
+ {
+ size_t newsize;
+ void *newbuf;
+
+ if (!mem_cookie->flags.grow)
+ {
+ _set_errno (ENOSPC);
+ return -1;
+ }
+
+ newsize = pos_new + mem_cookie->block_size - 1;
+ if (newsize < pos_new)
+ {
+ _set_errno (EINVAL);
+ return -1;
+ }
+ newsize /= mem_cookie->block_size;
+ newsize *= mem_cookie->block_size;
+
+ if (mem_cookie->memory_limit && newsize > mem_cookie->memory_limit)
+ {
+ _set_errno (ENOSPC);
+ return -1;
+ }
+
+ assert (mem_cookie->func_realloc);
+ newbuf = mem_cookie->func_realloc (mem_cookie->memory, newsize);
+ if (!newbuf)
+ return -1;
+
+ mem_cookie->memory = newbuf;
+ mem_cookie->memory_size = newsize;
+ }
+
+ if (pos_new > mem_cookie->data_len)
+ {
+ /* Fill spare space with zeroes. */
+ memset (mem_cookie->memory + mem_cookie->data_len,
+ 0, pos_new - mem_cookie->data_len);
+ mem_cookie->data_len = pos_new;
+ }
+
+ mem_cookie->offset = pos_new;
+ *offset = pos_new;
+
+ return 0;
+}
+
+
+/*
+ * The IOCTL function for memory objects.
+ */
+static int
+func_mem_ioctl (void *cookie, int cmd, void *ptr, size_t *len)
+{
+ estream_cookie_mem_t mem_cookie = cookie;
+ int ret;
+
+ if (cmd == COOKIE_IOCTL_SNATCH_BUFFER)
+ {
+ /* Return the internal buffer of the stream to the caller and
+ invalidate it for the stream. */
+ *(void**)ptr = mem_cookie->memory;
+ *len = mem_cookie->data_len;
+ mem_cookie->memory = NULL;
+ mem_cookie->memory_size = 0;
+ mem_cookie->offset = 0;
+ ret = 0;
+ }
+ else
+ {
+ _set_errno (EINVAL);
+ ret = -1;
+ }
+
+ return ret;
+}
+
+
+/*
+ * The destroy function for memory objects.
+ */
+static int
+func_mem_destroy (void *cookie)
+{
+ estream_cookie_mem_t mem_cookie = cookie;
+
+ if (cookie)
+ {
+ mem_cookie->func_free (mem_cookie->memory);
+ mem_free (mem_cookie);
+ }
+ return 0;
+}
+
+/*
+ * Access object for the memory functions.
+ */
+static struct cookie_io_functions_s estream_functions_mem =
+ {
+ {
+ func_mem_read,
+ func_mem_write,
+ func_mem_seek,
+ func_mem_destroy,
+ },
+ func_mem_ioctl,
+ };
+
+
+
+/*
+ * Implementation of file descriptor based I/O.
+ */
+
+/* Cookie for fd objects. */
+typedef struct estream_cookie_fd
+{
+ int fd; /* The file descriptor we are using for actual output. */
+ int no_close; /* If set we won't close the file descriptor. */
+ int nonblock; /* Non-blocking mode is enabled. */
+} *estream_cookie_fd_t;
+
+
+/*
+ * Create function for objects indentified by a libc file descriptor.
+ */
+static int
+func_fd_create (void **cookie, int fd, unsigned int modeflags, int no_close)
+{
+ estream_cookie_fd_t fd_cookie;
+ int err;
+
+ trace (("enter: fd=%d mf=%x nc=%d", fd, modeflags, no_close));
+
+ fd_cookie = mem_alloc (sizeof (*fd_cookie));
+ if (! fd_cookie)
+ err = -1;
+ else
+ {
+#ifdef HAVE_DOSISH_SYSTEM
+ /* Make sure it is in binary mode if requested. */
+ if ( (modeflags & O_BINARY) )
+ setmode (fd, O_BINARY);
+#endif
+ fd_cookie->fd = fd;
+ fd_cookie->no_close = no_close;
+ fd_cookie->nonblock = !!(modeflags & O_NONBLOCK);
+ *cookie = fd_cookie;
+ err = 0;
+ }
+
+ trace_errno (err, ("leave: cookie=%p err=%d", *cookie, err));
+ return err;
+}
+
+
+/*
+ * Read function for fd objects.
+ */
+static gpgrt_ssize_t
+func_fd_read (void *cookie, void *buffer, size_t size)
+
+{
+ estream_cookie_fd_t file_cookie = cookie;
+ gpgrt_ssize_t bytes_read;
+
+ trace (("enter: cookie=%p buffer=%p size=%d", cookie, buffer, (int)size));
+
+ if (!size)
+ bytes_read = -1; /* We don't know whether anything is pending. */
+ else if (IS_INVALID_FD (file_cookie->fd))
+ {
+ _gpgrt_yield ();
+ bytes_read = 0;
+ }
+ else
+ {
+ if (pre_syscall_func)
+ pre_syscall_func ();
+ do
+ {
+ bytes_read = read (file_cookie->fd, buffer, size);
+ }
+ while (bytes_read == -1 && errno == EINTR);
+ if (post_syscall_func)
+ post_syscall_func ();
+ }
+
+ trace_errno (bytes_read == -1, ("leave: bytes_read=%d", (int)bytes_read));
+ return bytes_read;
+}
+
+
+/*
+ * Write function for fd objects.
+ */
+static gpgrt_ssize_t
+func_fd_write (void *cookie, const void *buffer, size_t size)
+{
+ estream_cookie_fd_t file_cookie = cookie;
+ gpgrt_ssize_t bytes_written;
+
+ trace (("enter: cookie=%p buffer=%p size=%d", cookie, buffer, (int)size));
+
+ if (IS_INVALID_FD (file_cookie->fd))
+ {
+ _gpgrt_yield ();
+ bytes_written = size; /* Yeah: Success writing to the bit bucket. */
+ }
+ else if (buffer)
+ {
+ if (pre_syscall_func)
+ pre_syscall_func ();
+ do
+ {
+ bytes_written = write (file_cookie->fd, buffer, size);
+ }
+ while (bytes_written == -1 && errno == EINTR);
+ if (post_syscall_func)
+ post_syscall_func ();
+ }
+ else
+ bytes_written = size; /* Note that for a flush SIZE should be 0. */
+
+ trace_errno (bytes_written == -1,
+ ("leave: bytes_written=%d", (int)bytes_written));
+ return bytes_written;
+}
+
+
+/*
+ * Seek function for fd objects.
+ */
+static int
+func_fd_seek (void *cookie, gpgrt_off_t *offset, int whence)
+{
+ estream_cookie_fd_t file_cookie = cookie;
+ gpgrt_off_t offset_new;
+ int err;
+
+ if (IS_INVALID_FD (file_cookie->fd))
+ {
+ _set_errno (ESPIPE);
+ err = -1;
+ }
+ else
+ {
+ if (pre_syscall_func)
+ pre_syscall_func ();
+ offset_new = lseek (file_cookie->fd, *offset, whence);
+ if (post_syscall_func)
+ post_syscall_func ();
+ if (offset_new == -1)
+ err = -1;
+ else
+ {
+ *offset = offset_new;
+ err = 0;
+ }
+ }
+
+ return err;
+}
+
+
+/*
+ * The IOCTL function for fd objects.
+ */
+static int
+func_fd_ioctl (void *cookie, int cmd, void *ptr, size_t *len)
+{
+ estream_cookie_fd_t fd_cookie = cookie;
+ int ret;
+
+ if (cmd == COOKIE_IOCTL_NONBLOCK && !len)
+ {
+ fd_cookie->nonblock = !!ptr;
+ if (IS_INVALID_FD (fd_cookie->fd))
+ {
+ _set_errno (EINVAL);
+ ret = -1;
+ }
+ else
+ {
+#ifdef _WIN32
+ _set_errno (EOPNOTSUPP); /* FIXME: Implement for Windows. */
+ ret = -1;
+#else
+ _set_errno (0);
+ ret = fcntl (fd_cookie->fd, F_GETFL, 0);
+ if (ret == -1 && errno)
+ ;
+ else if (fd_cookie->nonblock)
+ ret = fcntl (fd_cookie->fd, F_SETFL, (ret | O_NONBLOCK));
+ else
+ ret = fcntl (fd_cookie->fd, F_SETFL, (ret & ~O_NONBLOCK));
+#endif
+ }
+ }
+ else
+ {
+ _set_errno (EINVAL);
+ ret = -1;
+ }
+
+ return ret;
+}
+
+/*
+ * The destroy function for fd objects.
+ */
+static int
+func_fd_destroy (void *cookie)
+{
+ estream_cookie_fd_t fd_cookie = cookie;
+ int err;
+
+ trace (("enter: cookie=%p", cookie));
+
+ if (fd_cookie)
+ {
+ if (IS_INVALID_FD (fd_cookie->fd))
+ err = 0;
+ else
+ err = fd_cookie->no_close? 0 : close (fd_cookie->fd);
+ mem_free (fd_cookie);
+ }
+ else
+ err = 0;
+
+ trace_errno (err,("leave: err=%d", err));
+ return err;
+}
+
+
+/*
+ * Access object for the fd functions.
+ */
+static struct cookie_io_functions_s estream_functions_fd =
+ {
+ {
+ func_fd_read,
+ func_fd_write,
+ func_fd_seek,
+ func_fd_destroy,
+ },
+ func_fd_ioctl,
+ };
+
+
+
+
+/*
+ * Implementation of W32 handle based I/O.
+ */
+#ifdef HAVE_W32_SYSTEM
+
+/* Cookie for fd objects. */
+typedef struct estream_cookie_w32
+{
+ HANDLE hd; /* The handle we are using for actual output. */
+ int no_close; /* If set we won't close the handle. */
+ int no_syscall_clamp; /* Do not use the syscall clamp. */
+} *estream_cookie_w32_t;
+
+
+/*
+ * Create function for w32 handle objects.
+ */
+static int
+func_w32_create (void **cookie, HANDLE hd,
+ unsigned int modeflags, int no_close, int no_syscall_clamp)
+{
+ estream_cookie_w32_t w32_cookie;
+ int err;
+
+ trace (("enter: hd=%p mf=%x nc=%d nsc=%d",
+ hd, modeflags, no_close, no_syscall_clamp));
+ w32_cookie = mem_alloc (sizeof (*w32_cookie));
+ if (!w32_cookie)
+ err = -1;
+ else
+ {
+ /* CR/LF translations are not supported when using the bare W32
+ API. If that is really required we need to implemented that
+ in the upper layer. */
+ (void)modeflags;
+
+ w32_cookie->hd = hd;
+ w32_cookie->no_close = no_close;
+ w32_cookie->no_syscall_clamp = no_syscall_clamp;
+ *cookie = w32_cookie;
+ err = 0;
+ }
+
+ trace_errno (err, ("leave: cookie=%p err=%d", *cookie, err));
+ return err;
+}
+
+/*
+ * Read function for W32 handle objects.
+ *
+ * Note that this function may also be used by the reader thread of
+ * w32-stream. In that case the NO_SYSCALL_CLAMP is set.
+ */
+static gpgrt_ssize_t
+func_w32_read (void *cookie, void *buffer, size_t size)
+{
+ estream_cookie_w32_t w32_cookie = cookie;
+ gpgrt_ssize_t bytes_read;
+
+ trace (("enter: cookie=%p buffer=%p size=%d", cookie, buffer, (int)size));
+
+ if (!size)
+ bytes_read = -1; /* We don't know whether anything is pending. */
+ else if (w32_cookie->hd == INVALID_HANDLE_VALUE)
+ {
+ _gpgrt_yield ();
+ bytes_read = 0;
+ }
+ else
+ {
+ if (pre_syscall_func && !w32_cookie->no_syscall_clamp)
+ pre_syscall_func ();
+ do
+ {
+ DWORD nread, ec;
+
+ trace (("cookie=%p calling ReadFile", cookie));
+ if (!ReadFile (w32_cookie->hd, buffer, size, &nread, NULL))
+ {
+ ec = GetLastError ();
+ trace (("cookie=%p ReadFile failed: ec=%ld", cookie,ec));
+ if (ec == ERROR_BROKEN_PIPE)
+ bytes_read = 0; /* Like our pth_read we handle this as EOF. */
+ else
+ {
+ _set_errno (map_w32_to_errno (ec));
+ bytes_read = -1;
+ }
+ }
+ else
+ bytes_read = (int)nread;
+ }
+ while (bytes_read == -1 && errno == EINTR);
+ if (post_syscall_func && !w32_cookie->no_syscall_clamp)
+ post_syscall_func ();
+ }
+
+ trace_errno (bytes_read==-1,("leave: bytes_read=%d", (int)bytes_read));
+ return bytes_read;
+}
+
+
+/*
+ * Write function for W32 handle objects.
+ *
+ * Note that this function may also be used by the writer thread of
+ * w32-stream. In that case the NO_SYSCALL_CLAMP is set.
+ */
+static gpgrt_ssize_t
+func_w32_write (void *cookie, const void *buffer, size_t size)
+{
+ estream_cookie_w32_t w32_cookie = cookie;
+ gpgrt_ssize_t bytes_written;
+
+ trace (("enter: cookie=%p buffer=%p size=%d", cookie, buffer, (int)size));
+
+ if (w32_cookie->hd == INVALID_HANDLE_VALUE)
+ {
+ _gpgrt_yield ();
+ bytes_written = size; /* Yeah: Success writing to the bit bucket. */
+ }
+ else if (buffer)
+ {
+ if (pre_syscall_func && !w32_cookie->no_syscall_clamp)
+ pre_syscall_func ();
+ do
+ {
+ DWORD nwritten;
+
+ trace (("cookie=%p calling WriteFile", cookie));
+ if (!WriteFile (w32_cookie->hd, buffer, size, &nwritten, NULL))
+ {
+ DWORD ec = GetLastError ();
+ trace (("cookie=%p WriteFile failed: ec=%ld", cookie, ec));
+ _set_errno (map_w32_to_errno (ec));
+ bytes_written = -1;
+ }
+ else
+ bytes_written = (int)nwritten;
+ }
+ while (bytes_written == -1 && errno == EINTR);
+ if (post_syscall_func && !w32_cookie->no_syscall_clamp)
+ post_syscall_func ();
+ }
+ else
+ bytes_written = size; /* Note that for a flush SIZE should be 0. */
+
+ trace_errno (bytes_written==-1,
+ ("leave: bytes_written=%d", (int)bytes_written));
+ return bytes_written;
+}
+
+
+/*
+ * Seek function for W32 handle objects.
+ */
+static int
+func_w32_seek (void *cookie, gpgrt_off_t *offset, int whence)
+{
+ estream_cookie_w32_t w32_cookie = cookie;
+ DWORD method;
+ LARGE_INTEGER distance, newoff;
+
+ if (w32_cookie->hd == INVALID_HANDLE_VALUE)
+ {
+ _set_errno (ESPIPE);
+ return -1;
+ }
+
+ if (whence == SEEK_SET)
+ {
+ method = FILE_BEGIN;
+ distance.QuadPart = (unsigned long long)(*offset);
+ }
+ else if (whence == SEEK_CUR)
+ {
+ method = FILE_CURRENT;
+ distance.QuadPart = (long long)(*offset);
+ }
+ else if (whence == SEEK_END)
+ {
+ method = FILE_END;
+ distance.QuadPart = (long long)(*offset);
+ }
+ else
+ {
+ _set_errno (EINVAL);
+ return -1;
+ }
+#ifdef HAVE_W32CE_SYSTEM
+# warning need to use SetFilePointer
+#else
+ if (pre_syscall_func && !w32_cookie->no_syscall_clamp)
+ pre_syscall_func ();
+ if (!SetFilePointerEx (w32_cookie->hd, distance, &newoff, method))
+ {
+ _set_errno (map_w32_to_errno (GetLastError ()));
+ if (post_syscall_func)
+ post_syscall_func ();
+ return -1;
+ }
+ if (post_syscall_func && !w32_cookie->no_syscall_clamp)
+ post_syscall_func ();
+#endif
+ /* Note that gpgrt_off_t is always 64 bit. */
+ *offset = (gpgrt_off_t)newoff.QuadPart;
+ return 0;
+}
+
+
+/*
+ * Destroy function for W32 handle objects.
+ */
+static int
+func_w32_destroy (void *cookie)
+{
+ estream_cookie_w32_t w32_cookie = cookie;
+ int err;
+
+ trace (("enter: cookie=%p", cookie));
+
+ if (w32_cookie)
+ {
+ if (w32_cookie->hd == INVALID_HANDLE_VALUE)
+ err = 0;
+ else if (w32_cookie->no_close)
+ err = 0;
+ else
+ {
+ trace (("cookie=%p closing handle %p", cookie, w32_cookie->hd));
+ if (!CloseHandle (w32_cookie->hd))
+ {
+ DWORD ec = GetLastError ();
+ trace (("cookie=%p CloseHandle failed: ec=%ld", cookie,ec));
+ _set_errno (map_w32_to_errno (ec));
+ err = -1;
+ }
+ else
+ err = 0;
+ }
+ mem_free (w32_cookie);
+ }
+ else
+ err = 0;
+
+ trace_errno (err, ("leave: err=%d", err));
+ return err;
+}
+
+
+/*
+ * Access object for the W32 handle based objects.
+ */
+static struct cookie_io_functions_s estream_functions_w32 =
+ {
+ {
+ func_w32_read,
+ func_w32_write,
+ func_w32_seek,
+ func_w32_destroy,
+ },
+ NULL,
+ };
+#endif /*HAVE_W32_SYSTEM*/
+
+
+
+
+/*
+ * Implementation of stdio based I/O.
+ */
+
+/* Cookie for fp objects. */
+typedef struct estream_cookie_fp
+{
+ FILE *fp; /* The file pointer we are using for actual output. */
+ int no_close; /* If set we won't close the file pointer. */
+} *estream_cookie_fp_t;
+
+
+/*
+ * Create function for stdio based objects.
+ */
+static int
+func_fp_create (void **cookie, FILE *fp,
+ unsigned int modeflags, int no_close)
+{
+ estream_cookie_fp_t fp_cookie;
+ int err;
+
+ fp_cookie = mem_alloc (sizeof *fp_cookie);
+ if (!fp_cookie)
+ err = -1;
+ else
+ {
+#ifdef HAVE_DOSISH_SYSTEM
+ /* Make sure it is in binary mode if requested. */
+ if ( (modeflags & O_BINARY) )
+ setmode (fileno (fp), O_BINARY);
+#else
+ (void)modeflags;
+#endif
+ fp_cookie->fp = fp;
+ fp_cookie->no_close = no_close;
+ *cookie = fp_cookie;
+ err = 0;
+ }
+
+ return err;
+}
+
+
+/*
+ * Read function for stdio based objects.
+ */
+static gpgrt_ssize_t
+func_fp_read (void *cookie, void *buffer, size_t size)
+
+{
+ estream_cookie_fp_t file_cookie = cookie;
+ gpgrt_ssize_t bytes_read;
+
+ if (!size)
+ return -1; /* We don't know whether anything is pending. */
+
+ if (file_cookie->fp)
+ {
+ if (pre_syscall_func)
+ pre_syscall_func ();
+ bytes_read = fread (buffer, 1, size, file_cookie->fp);
+ if (post_syscall_func)
+ post_syscall_func ();
+ }
+ else
+ bytes_read = 0;
+ if (!bytes_read && ferror (file_cookie->fp))
+ return -1;
+ return bytes_read;
+}
+
+
+/*
+ * Write function for stdio bases objects.
+ */
+static gpgrt_ssize_t
+func_fp_write (void *cookie, const void *buffer, size_t size)
+{
+ estream_cookie_fp_t file_cookie = cookie;
+ size_t bytes_written;
+
+ if (file_cookie->fp)
+ {
+ if (pre_syscall_func)
+ pre_syscall_func ();
+ if (buffer)
+ {
+#ifdef HAVE_W32_SYSTEM
+ /* Using an fwrite to stdout connected to the console fails
+ with the error "Not enough space" for an fwrite size of
+ >= 52KB (tested on Windows XP SP2). To solve this we
+ always chunk the writes up into smaller blocks. */
+ bytes_written = 0;
+ while (bytes_written < size)
+ {
+ size_t cnt = size - bytes_written;
+
+ if (cnt > 32*1024)
+ cnt = 32*1024;
+ if (fwrite ((const char*)buffer + bytes_written,
+ cnt, 1, file_cookie->fp) != 1)
+ break; /* Write error. */
+ bytes_written += cnt;
+ }
+#else
+ bytes_written = fwrite (buffer, 1, size, file_cookie->fp);
+#endif
+ }
+ else /* Only flush requested. */
+ bytes_written = size;
+
+ fflush (file_cookie->fp);
+ if (post_syscall_func)
+ post_syscall_func ();
+ }
+ else
+ bytes_written = size; /* Successfully written to the bit bucket. */
+
+ if (bytes_written != size)
+ return -1;
+ return bytes_written;
+}
+
+
+/*
+ * Seek function for stdio based objects.
+ */
+static int
+func_fp_seek (void *cookie, gpgrt_off_t *offset, int whence)
+{
+ estream_cookie_fp_t file_cookie = cookie;
+ long int offset_new;
+
+ if (!file_cookie->fp)
+ {
+ _set_errno (ESPIPE);
+ return -1;
+ }
+
+ if (pre_syscall_func)
+ pre_syscall_func ();
+ if ( fseek (file_cookie->fp, (long int)*offset, whence) )
+ {
+ /* fprintf (stderr, "\nfseek failed: errno=%d (%s)\n", */
+ /* errno,strerror (errno)); */
+ if (post_syscall_func)
+ post_syscall_func ();
+ return -1;
+ }
+
+ offset_new = ftell (file_cookie->fp);
+ if (post_syscall_func)
+ post_syscall_func ();
+ if (offset_new == -1)
+ {
+ /* fprintf (stderr, "\nftell failed: errno=%d (%s)\n", */
+ /* errno,strerror (errno)); */
+ return -1;
+ }
+ *offset = offset_new;
+ return 0;
+}
+
+
+/*
+ * Destroy function for stdio based objects.
+ */
+static int
+func_fp_destroy (void *cookie)
+{
+ estream_cookie_fp_t fp_cookie = cookie;
+ int err;
+
+ if (fp_cookie)
+ {
+ if (fp_cookie->fp)
+ {
+ if (pre_syscall_func)
+ pre_syscall_func ();
+ fflush (fp_cookie->fp);
+ if (post_syscall_func)
+ post_syscall_func ();
+ err = fp_cookie->no_close? 0 : fclose (fp_cookie->fp);
+ }
+ else
+ err = 0;
+ mem_free (fp_cookie);
+ }
+ else
+ err = 0;
+
+ return err;
+}
+
+
+/*
+ * Access object for stdio based objects.
+ */
+static struct cookie_io_functions_s estream_functions_fp =
+ {
+ {
+ func_fp_read,
+ func_fp_write,
+ func_fp_seek,
+ func_fp_destroy,
+ },
+ NULL,
+ };
+
+
+
+
+/*
+ * Implementation of file name based I/O.
+ *
+ * Note that only a create function is required because the other
+ * operations ares handled by file descriptor based I/O.
+ */
+
+/* Create function for objects identified by a file name. */
+static int
+func_file_create (void **cookie, int *filedes,
+ const char *path, unsigned int modeflags, unsigned int cmode)
+{
+ estream_cookie_fd_t file_cookie;
+ int err;
+ int fd;
+
+ err = 0;
+
+ file_cookie = mem_alloc (sizeof (*file_cookie));
+ if (! file_cookie)
+ {
+ err = -1;
+ goto out;
+ }
+
+ fd = open (path, modeflags, cmode);
+ if (fd == -1)
+ {
+ err = -1;
+ goto out;
+ }
+#ifdef HAVE_DOSISH_SYSTEM
+ /* Make sure it is in binary mode if requested. */
+ if ( (modeflags & O_BINARY) )
+ setmode (fd, O_BINARY);
+#endif
+
+ file_cookie->fd = fd;
+ file_cookie->no_close = 0;
+ *cookie = file_cookie;
+ *filedes = fd;
+
+ out:
+
+ if (err)
+ mem_free (file_cookie);
+
+ return err;
+}
+
+
+
+/* Flags used by parse_mode and friends. */
+#define X_SAMETHREAD (1 << 0)
+#define X_SYSOPEN (1 << 1)
+#define X_POLLABLE (1 << 2)
+
+/* Parse the mode flags of fopen et al. In addition to the POSIX
+ * defined mode flags keyword parameters are supported. These are
+ * key/value pairs delimited by comma and optional white spaces.
+ * Keywords and values may not contain a comma or white space; unknown
+ * keywords are skipped. Supported keywords are:
+ *
+ * mode=<string>
+ *
+ * Creates a file and gives the new file read and write permissions
+ * for the user and read permission for the group. The format of
+ * the string is the same as shown by the -l option of the ls(1)
+ * command. However the first letter must be a dash and it is
+ * allowed to leave out trailing dashes. If this keyword parameter
+ * is not given the default mode for creating files is "-rw-rw-r--"
+ * (664). Note that the system still applies the current umask to
+ * the mode when crating a file. Example:
+ *
+ * "wb,mode=-rw-r--"
+ *
+ * samethread
+ *
+ * Assumes that the object is only used by the creating thread and
+ * disables any internal locking. This keyword is also found on
+ * IBM systems.
+ *
+ * nonblock
+ *
+ * The object is opened in non-blocking mode. This is the same as
+ * calling gpgrt_set_nonblock on the file.
+ *
+ * sysopen
+ *
+ * The object is opened in sysmode. On POSIX this is a NOP but
+ * under Windows the direct W32 API functions (HANDLE) are used
+ * instead of their libc counterparts (fd).
+ * FIXME: The functionality is not yet implemented.
+ *
+ * pollable
+ *
+ * The object is opened in a way suitable for use with es_poll. On
+ * POSIX this is a NOP but under Windows we create up to two
+ * threads, one for reading and one for writing, do any I/O there,
+ * and synchronize with them in order to support es_poll.
+ *
+ * Note: R_CMODE is optional because is only required by functions
+ * which are able to creat a file.
+ */
+static int
+parse_mode (const char *modestr,
+ unsigned int *modeflags,
+ unsigned int *r_xmode,
+ unsigned int *r_cmode)
+{
+ unsigned int omode, oflags, cmode;
+ int got_cmode = 0;
+
+ *r_xmode = 0;
+
+ switch (*modestr)
+ {
+ case 'r':
+ omode = O_RDONLY;
+ oflags = 0;
+ break;
+ case 'w':
+ omode = O_WRONLY;
+ oflags = O_TRUNC | O_CREAT;
+ break;
+ case 'a':
+ omode = O_WRONLY;
+ oflags = O_APPEND | O_CREAT;
+ break;
+ default:
+ _set_errno (EINVAL);
+ return -1;
+ }
+ for (modestr++; *modestr; modestr++)
+ {
+ switch (*modestr)
+ {
+ case '+':
+ omode = O_RDWR;
+ break;
+ case 'b':
+ oflags |= O_BINARY;
+ break;
+ case 'x':
+ oflags |= O_EXCL;
+ break;
+ case ',':
+ goto keyvalue;
+ default: /* Ignore unknown flags. */
+ break;
+ }
+ }
+
+ keyvalue:
+ /* Parse key/value pairs (similar to fopen on mainframes). */
+ for (cmode=0; *modestr == ','; modestr += strcspn (modestr, ","))
+ {
+ modestr++;
+ modestr += strspn (modestr, " \t");
+ if (!strncmp (modestr, "mode=", 5))
+ {
+ static struct {
+ char letter;
+ unsigned int value;
+ } table[] = { { '-', 0 },
+ { 'r', S_IRUSR }, { 'w', S_IWUSR }, { 'x', S_IXUSR },
+ { 'r', S_IRGRP }, { 'w', S_IWGRP }, { 'x', S_IXGRP },
+ { 'r', S_IROTH }, { 'w', S_IWOTH }, { 'x', S_IXOTH }};
+ int idx;
+
+ got_cmode = 1;
+ modestr += 5;
+ /* For now we only support a string as used by ls(1) and no
+ octal numbers. The first character must be a dash. */
+ for (idx=0; idx < 10 && *modestr; idx++, modestr++)
+ {
+ if (*modestr == table[idx].letter)
+ cmode |= table[idx].value;
+ else if (*modestr != '-')
+ break;
+ }
+ if (*modestr && !strchr (" \t,", *modestr))
+ {
+ _set_errno (EINVAL);
+ return -1;
+ }
+ }
+ else if (!strncmp (modestr, "samethread", 10))
+ {
+ modestr += 10;
+ if (*modestr && !strchr (" \t,", *modestr))
+ {
+ _set_errno (EINVAL);
+ return -1;
+ }
+ *r_xmode |= X_SAMETHREAD;
+ }
+ else if (!strncmp (modestr, "nonblock", 8))
+ {
+ modestr += 8;
+ if (*modestr && !strchr (" \t,", *modestr))
+ {
+ _set_errno (EINVAL);
+ return -1;
+ }
+ oflags |= O_NONBLOCK;
+#if HAVE_W32_SYSTEM
+ /* Currently, nonblock implies pollable on Windows. */
+ *r_xmode |= X_POLLABLE;
+#endif
+ }
+ else if (!strncmp (modestr, "sysopen", 7))
+ {
+ modestr += 7;
+ if (*modestr && !strchr (" \t,", *modestr))
+ {
+ _set_errno (EINVAL);
+ return -1;
+ }
+ *r_xmode |= X_SYSOPEN;
+ }
+ else if (!strncmp (modestr, "pollable", 8))
+ {
+ modestr += 8;
+ if (*modestr && !strchr (" \t,", *modestr))
+ {
+ _set_errno (EINVAL);
+ return -1;
+ }
+ *r_xmode |= X_POLLABLE;
+ }
+ }
+ if (!got_cmode)
+ cmode = (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
+
+ *modeflags = (omode | oflags);
+ if (r_cmode)
+ *r_cmode = cmode;
+ return 0;
+}
+
+
+
+/*
+ * Low level stream functionality.
+ */
+
+static int
+fill_stream (estream_t stream)
+{
+ size_t bytes_read = 0;
+ int err;
+
+ if (!stream->intern->func_read)
+ {
+ _set_errno (EOPNOTSUPP);
+ err = -1;
+ }
+ else if (!stream->buffer_size)
+ err = 0;
+ else
+ {
+ gpgrt_cookie_read_function_t func_read = stream->intern->func_read;
+ gpgrt_ssize_t ret;
+
+ ret = (*func_read) (stream->intern->cookie,
+ stream->buffer, stream->buffer_size);
+ if (ret == -1)
+ {
+ bytes_read = 0;
+ err = -1;
+#if EWOULDBLOCK != EAGAIN
+ if (errno == EWOULDBLOCK)
+ _set_errno (EAGAIN);
+#endif
+ }
+ else
+ {
+ bytes_read = ret;
+ err = 0;
+ }
+ }
+
+ if (err)
+ {
+ if (errno != EAGAIN)
+ {
+ if (errno == EPIPE)
+ stream->intern->indicators.hup = 1;
+ stream->intern->indicators.err = 1;
+ }
+ }
+ else if (!bytes_read)
+ stream->intern->indicators.eof = 1;
+
+ stream->intern->offset += stream->data_len;
+ stream->data_len = bytes_read;
+ stream->data_offset = 0;
+
+ return err;
+}
+
+static int
+flush_stream (estream_t stream)
+{
+ gpgrt_cookie_write_function_t func_write = stream->intern->func_write;
+ int err;
+
+ assert (stream->flags.writing);
+
+ if (stream->data_offset)
+ {
+ size_t bytes_written;
+ size_t data_flushed;
+ gpgrt_ssize_t ret;
+
+ if (! func_write)
+ {
+ _set_errno (EOPNOTSUPP);
+ err = -1;
+ goto out;
+ }
+
+ /* Note: to prevent an endless loop caused by user-provided
+ write-functions that pretend to have written more bytes than
+ they were asked to write, we have to check for
+ "(stream->data_offset - data_flushed) > 0" instead of
+ "stream->data_offset - data_flushed". */
+
+ data_flushed = 0;
+ err = 0;
+
+ while ((((gpgrt_ssize_t) (stream->data_offset - data_flushed)) > 0)
+ && !err)
+ {
+ ret = (*func_write) (stream->intern->cookie,
+ stream->buffer + data_flushed,
+ stream->data_offset - data_flushed);
+ if (ret == -1)
+ {
+ bytes_written = 0;
+ err = -1;
+#if EWOULDBLOCK != EAGAIN
+ if (errno == EWOULDBLOCK)
+ _set_errno (EAGAIN);
+#endif
+ }
+ else
+ bytes_written = ret;
+
+ data_flushed += bytes_written;
+ if (err)
+ break;
+ }
+
+ stream->data_flushed += data_flushed;
+ if (stream->data_offset == data_flushed)
+ {
+ stream->intern->offset += stream->data_offset;
+ stream->data_offset = 0;
+ stream->data_flushed = 0;
+
+ /* Propagate flush event. */
+ (*func_write) (stream->intern->cookie, NULL, 0);
+ }
+ }
+ else
+ err = 0;
+
+ out:
+
+ if (err && errno != EAGAIN)
+ {
+ if (errno == EPIPE)
+ stream->intern->indicators.hup = 1;
+ stream->intern->indicators.err = 1;
+ }
+
+ return err;
+}
+
+
+/*
+ * Discard buffered data for STREAM.
+ */
+static void
+es_empty (estream_t stream)
+{
+ assert (!stream->flags.writing);
+ stream->data_len = 0;
+ stream->data_offset = 0;
+ stream->unread_data_len = 0;
+}
+
+
+/*
+ * Initialize STREAM.
+ */
+static void
+init_stream_obj (estream_t stream,
+ void *cookie, es_syshd_t *syshd,
+ gpgrt_stream_backend_kind_t kind,
+ struct cookie_io_functions_s functions,
+ unsigned int modeflags, unsigned int xmode)
+{
+ stream->intern->kind = kind;
+ stream->intern->cookie = cookie;
+ stream->intern->opaque = NULL;
+ stream->intern->offset = 0;
+ stream->intern->func_read = functions.public.func_read;
+ stream->intern->func_write = functions.public.func_write;
+ stream->intern->func_seek = functions.public.func_seek;
+ stream->intern->func_ioctl = functions.func_ioctl;
+ stream->intern->func_close = functions.public.func_close;
+ stream->intern->strategy = _IOFBF;
+ stream->intern->syshd = *syshd;
+ stream->intern->print_ntotal = 0;
+ stream->intern->indicators.err = 0;
+ stream->intern->indicators.eof = 0;
+ stream->intern->indicators.hup = 0;
+ stream->intern->is_stdstream = 0;
+ stream->intern->stdstream_fd = 0;
+ stream->intern->deallocate_buffer = 0;
+ stream->intern->printable_fname = NULL;
+ stream->intern->printable_fname_inuse = 0;
+ stream->intern->samethread = !! (xmode & X_SAMETHREAD);
+ stream->intern->onclose = NULL;
+
+ stream->data_len = 0;
+ stream->data_offset = 0;
+ stream->data_flushed = 0;
+ stream->unread_data_len = 0;
+ /* Depending on the modeflags we set whether we start in writing or
+ reading mode. This is required in case we are working on a
+ stream which is not seeekable (like stdout). Without this
+ pre-initialization we would do a seek at the first write call and
+ as this will fail no output will be delivered. */
+ if ((modeflags & O_WRONLY) || (modeflags & O_RDWR) )
+ stream->flags.writing = 1;
+ else
+ stream->flags.writing = 0;
+}
+
+
+/*
+ * Deinitialize the STREAM object. This does _not_ free the memory,
+ * destroys the lock, or closes the underlying descriptor.
+ */
+static int
+deinit_stream_obj (estream_t stream)
+{
+ gpgrt_cookie_close_function_t func_close;
+ int err, tmp_err;
+
+ trace (("enter: stream %p", stream));
+ func_close = stream->intern->func_close;
+
+ err = 0;
+ if (stream->flags.writing)
+ {
+ tmp_err = flush_stream (stream);
+ if (!err)
+ err = tmp_err;
+ }
+ if (func_close)
+ {
+ trace (("stream %p calling func_close", stream));
+ tmp_err = func_close (stream->intern->cookie);
+ if (!err)
+ err = tmp_err;
+ }
+
+ mem_free (stream->intern->printable_fname);
+ stream->intern->printable_fname = NULL;
+ stream->intern->printable_fname_inuse = 0;
+ while (stream->intern->onclose)
+ {
+ notify_list_t tmp = stream->intern->onclose->next;
+ mem_free (stream->intern->onclose);
+ stream->intern->onclose = tmp;
+ }
+
+ trace_errno (err, ("leave: stream %p err=%d", stream, err));
+ return err;
+}
+
+
+/*
+ * Create a new stream and initialize it. On success the new stream
+ * handle is tsored at R_STREAM. On failure NULL is stored at
+ * R_STREAM.
+ */
+static int
+create_stream (estream_t *r_stream, void *cookie, es_syshd_t *syshd,
+ gpgrt_stream_backend_kind_t kind,
+ struct cookie_io_functions_s functions, unsigned int modeflags,
+ unsigned int xmode, int with_locked_list)
+{
+ estream_internal_t stream_internal_new;
+ estream_t stream_new;
+ int err;
+#if HAVE_W32_SYSTEM
+ void *old_cookie = NULL;
+#endif
+
+ stream_new = NULL;
+ stream_internal_new = NULL;
+
+#if HAVE_W32_SYSTEM
+ if ((xmode & X_POLLABLE) && kind != BACKEND_W32)
+ {
+ /* We require the W32 backend, because only that allows us to
+ * write directly using the native W32 API and to disable the
+ * system clamp. Note that func_w32_create has already been
+ * called with the flag to disable the system call clamp. */
+ _set_errno (EINVAL);
+ err = -1;
+ goto out;
+ }
+#endif /*HAVE_W32_SYSTEM*/
+
+ stream_new = mem_alloc (sizeof (*stream_new));
+ if (! stream_new)
+ {
+ err = -1;
+ goto out;
+ }
+
+ stream_internal_new = mem_alloc (sizeof (*stream_internal_new));
+ if (! stream_internal_new)
+ {
+ err = -1;
+ goto out;
+ }
+
+ stream_new->buffer = stream_internal_new->buffer;
+ stream_new->buffer_size = sizeof (stream_internal_new->buffer);
+ stream_new->unread_buffer = stream_internal_new->unread_buffer;
+ stream_new->unread_buffer_size = sizeof (stream_internal_new->unread_buffer);
+ stream_new->intern = stream_internal_new;
+
+#if HAVE_W32_SYSTEM
+ if ((xmode & X_POLLABLE))
+ {
+ void *new_cookie;
+
+ err = _gpgrt_w32_pollable_create (&new_cookie, modeflags,
+ functions, cookie);
+ if (err)
+ goto out;
+
+ modeflags &= ~O_NONBLOCK;
+ old_cookie = cookie;
+ cookie = new_cookie;
+ kind = BACKEND_W32_POLLABLE;
+ functions = _gpgrt_functions_w32_pollable;
+ }
+#endif /*HAVE_W32_SYSTEM*/
+
+ init_stream_obj (stream_new, cookie, syshd, kind, functions, modeflags,
+ xmode);
+ init_stream_lock (stream_new);
+
+ err = do_list_add (stream_new, with_locked_list);
+ if (err)
+ goto out;
+
+ *r_stream = stream_new;
+
+ out:
+
+ if (err)
+ {
+ trace_errno (err, ("leave: err=%d", err));
+ if (stream_new)
+ {
+ deinit_stream_obj (stream_new);
+ destroy_stream_lock (stream_new);
+ mem_free (stream_new->intern);
+ mem_free (stream_new);
+ }
+ }
+#if HAVE_W32_SYSTEM
+ else if (old_cookie)
+ trace (("leave: success stream=%p cookie=%p,%p",
+ *r_stream, old_cookie, cookie));
+#endif
+ else
+ trace (("leave: success stream=%p cookie=%p", *r_stream, cookie));
+
+ return err;
+}
+
+
+/*
+ * Deinitialize a stream object and destroy it.
+ */
+static int
+do_close (estream_t stream, int with_locked_list)
+{
+ int err;
+
+ trace (("stream %p %s", stream, with_locked_list? "(with locked list)":""));
+
+ if (stream)
+ {
+ do_list_remove (stream, with_locked_list);
+ while (stream->intern->onclose)
+ {
+ notify_list_t tmp = stream->intern->onclose->next;
+
+ if (stream->intern->onclose->fnc)
+ stream->intern->onclose->fnc (stream,
+ stream->intern->onclose->fnc_value);
+ mem_free (stream->intern->onclose);
+ stream->intern->onclose = tmp;
+ }
+ err = deinit_stream_obj (stream);
+ destroy_stream_lock (stream);
+ if (stream->intern->deallocate_buffer)
+ mem_free (stream->buffer);
+ mem_free (stream->intern);
+ mem_free (stream);
+ }
+ else
+ err = 0;
+
+ trace_errno (err, ("stream %p err=%d", stream, err));
+ return err;
+}
+
+
+/*
+ * The onclose worker function which is called with a locked
+ * stream.
+ */
+static int
+do_onclose (estream_t stream, int mode,
+ void (*fnc) (estream_t, void*), void *fnc_value)
+{
+ notify_list_t item;
+
+ if (!mode)
+ {
+ for (item = stream->intern->onclose; item; item = item->next)
+ if (item->fnc && item->fnc == fnc && item->fnc_value == fnc_value)
+ item->fnc = NULL; /* Disable this notification. */
+ }
+ else
+ {
+ item = mem_alloc (sizeof *item);
+ if (!item)
+ return -1;
+ item->fnc = fnc;
+ item->fnc_value = fnc_value;
+ item->next = stream->intern->onclose;
+ stream->intern->onclose = item;
+ }
+ return 0;
+}
+
+
+/*
+ * Try to read BYTES_TO_READ bytes from STREAM into BUFFER in
+ * unbuffered-mode, storing the amount of bytes read at BYTES_READ.
+ */
+static int
+do_read_nbf (estream_t _GPGRT__RESTRICT stream,
+ unsigned char *_GPGRT__RESTRICT buffer,
+ size_t bytes_to_read, size_t *_GPGRT__RESTRICT bytes_read)
+{
+ gpgrt_cookie_read_function_t func_read = stream->intern->func_read;
+ size_t data_read;
+ gpgrt_ssize_t ret;
+ int err;
+
+ data_read = 0;
+ err = 0;
+
+ while (bytes_to_read - data_read)
+ {
+ ret = (*func_read) (stream->intern->cookie,
+ buffer + data_read, bytes_to_read - data_read);
+ if (ret == -1)
+ {
+ err = -1;
+#if EWOULDBLOCK != EAGAIN
+ if (errno == EWOULDBLOCK)
+ _set_errno (EAGAIN);
+#endif
+ break;
+ }
+ else if (ret)
+ data_read += ret;
+ else
+ break;
+ }
+
+ stream->intern->offset += data_read;
+ *bytes_read = data_read;
+
+ return err;
+}
+
+
+/*
+ * Helper for check_pending.
+ */
+static int
+check_pending_nbf (estream_t _GPGRT__RESTRICT stream)
+{
+ gpgrt_cookie_read_function_t func_read = stream->intern->func_read;
+ char buffer[1];
+
+ if (!(*func_read) (stream->intern->cookie, buffer, 0))
+ return 1; /* Pending bytes. */
+ return 0; /* No pending bytes or error. */
+}
+
+
+/*
+ * Try to read BYTES_TO_READ bytes from STREAM into BUFFER in
+ * fully-buffered-mode, storing the amount of bytes read at
+ * BYTES_READ.
+ */
+static int
+do_read_fbf (estream_t _GPGRT__RESTRICT stream,
+ unsigned char *_GPGRT__RESTRICT buffer,
+ size_t bytes_to_read, size_t *_GPGRT__RESTRICT bytes_read)
+{
+ size_t data_available;
+ size_t data_to_read;
+ size_t data_read;
+ int err;
+
+ data_read = 0;
+ err = 0;
+
+ while ((bytes_to_read - data_read) && (! err))
+ {
+ if (stream->data_offset == stream->data_len)
+ {
+ /* Nothing more to read in current container, try to
+ fill container with new data. */
+ err = fill_stream (stream);
+ if (! err)
+ if (! stream->data_len)
+ /* Filling did not result in any data read. */
+ break;
+ }
+
+ if (! err)
+ {
+ /* Filling resulted in some new data. */
+
+ data_to_read = bytes_to_read - data_read;
+ data_available = stream->data_len - stream->data_offset;
+ if (data_to_read > data_available)
+ data_to_read = data_available;
+
+ memcpy (buffer + data_read,
+ stream->buffer + stream->data_offset, data_to_read);
+ stream->data_offset += data_to_read;
+ data_read += data_to_read;
+ }
+ }
+
+ *bytes_read = data_read;
+
+ return err;
+}
+
+
+/*
+ * Helper for check_pending.
+ */
+static int
+check_pending_fbf (estream_t _GPGRT__RESTRICT stream)
+{
+ gpgrt_cookie_read_function_t func_read = stream->intern->func_read;
+ char buffer[1];
+
+ if (stream->data_offset == stream->data_len)
+ {
+ /* Nothing more to read in current container, check whether it
+ would be possible to fill the container with new data. */
+ if (!(*func_read) (stream->intern->cookie, buffer, 0))
+ return 1; /* Pending bytes. */
+ }
+ else
+ return 1;
+ return 0;
+}
+
+
+/*
+ * Try to read BYTES_TO_READ bytes from STREAM into BUFFER in
+ * line-buffered-mode, storing the amount of bytes read at BYTES_READ.
+ */
+static int
+do_read_lbf (estream_t _GPGRT__RESTRICT stream,
+ unsigned char *_GPGRT__RESTRICT buffer,
+ size_t bytes_to_read, size_t *_GPGRT__RESTRICT bytes_read)
+{
+ int err;
+
+ err = do_read_fbf (stream, buffer, bytes_to_read, bytes_read);
+
+ return err;
+}
+
+
+/*
+ * Try to read BYTES_TO_READ bytes from STREAM into BUFFER, storing
+ * the amount of bytes read at BYTES_READ.
+ */
+static int
+es_readn (estream_t _GPGRT__RESTRICT stream,
+ void *_GPGRT__RESTRICT buffer_arg,
+ size_t bytes_to_read, size_t *_GPGRT__RESTRICT bytes_read)
+{
+ unsigned char *buffer = (unsigned char *)buffer_arg;
+ size_t data_read_unread, data_read;
+ int err;
+
+ data_read_unread = 0;
+ data_read = 0;
+ err = 0;
+
+ if (stream->flags.writing)
+ {
+ /* Switching to reading mode -> flush output. */
+ err = flush_stream (stream);
+ if (err)
+ goto out;
+ stream->flags.writing = 0;
+ }
+
+ /* Read unread data first. */
+ while ((bytes_to_read - data_read_unread) && stream->unread_data_len)
+ {
+ buffer[data_read_unread]
+ = stream->unread_buffer[stream->unread_data_len - 1];
+ stream->unread_data_len--;
+ data_read_unread++;
+ }
+
+ switch (stream->intern->strategy)
+ {
+ case _IONBF:
+ err = do_read_nbf (stream,
+ buffer + data_read_unread,
+ bytes_to_read - data_read_unread, &data_read);
+ break;
+ case _IOLBF:
+ err = do_read_lbf (stream,
+ buffer + data_read_unread,
+ bytes_to_read - data_read_unread, &data_read);
+ break;
+ case _IOFBF:
+ err = do_read_fbf (stream,
+ buffer + data_read_unread,
+ bytes_to_read - data_read_unread, &data_read);
+ break;
+ }
+
+ out:
+
+ if (bytes_read)
+ *bytes_read = data_read_unread + data_read;
+
+ return err;
+}
+
+
+/*
+ * Return true if at least one byte is pending for read. This is a
+ * best effort check and it it possible that bytes are still pending
+ * even if false is returned. If the stream is in writing mode it is
+ * switched to read mode.
+ */
+static int
+check_pending (estream_t _GPGRT__RESTRICT stream)
+{
+ if (stream->flags.writing)
+ {
+ /* Switching to reading mode -> flush output. */
+ if (flush_stream (stream))
+ return 0; /* Better return 0 on error. */
+ stream->flags.writing = 0;
+ }
+
+ /* Check unread data first. */
+ if (stream->unread_data_len)
+ return 1;
+
+ switch (stream->intern->strategy)
+ {
+ case _IONBF:
+ return check_pending_nbf (stream);
+ case _IOLBF:
+ case _IOFBF:
+ return check_pending_fbf (stream);
+ }
+
+ return 0;
+}
+
+
+/*
+ * Try to unread DATA_N bytes from DATA into STREAM, storing the
+ * amount of bytes successfully unread at BYTES_UNREAD.
+ */
+static void
+es_unreadn (estream_t _GPGRT__RESTRICT stream,
+ const unsigned char *_GPGRT__RESTRICT data, size_t data_n,
+ size_t *_GPGRT__RESTRICT bytes_unread)
+{
+ size_t space_left;
+
+ space_left = stream->unread_buffer_size - stream->unread_data_len;
+
+ if (data_n > space_left)
+ data_n = space_left;
+
+ if (! data_n)
+ goto out;
+
+ memcpy (stream->unread_buffer + stream->unread_data_len, data, data_n);
+ stream->unread_data_len += data_n;
+ stream->intern->indicators.eof = 0;
+
+ out:
+
+ if (bytes_unread)
+ *bytes_unread = data_n;
+}
+
+
+/*
+ * Seek in STREAM.
+ */
+static int
+es_seek (estream_t _GPGRT__RESTRICT stream, gpgrt_off_t offset, int whence,
+ gpgrt_off_t *_GPGRT__RESTRICT offset_new)
+{
+ gpgrt_cookie_seek_function_t func_seek = stream->intern->func_seek;
+ int err, ret;
+ gpgrt_off_t off;
+
+ if (! func_seek)
+ {
+ _set_errno (EOPNOTSUPP);
+ err = -1;
+ goto out;
+ }
+
+ if (stream->flags.writing)
+ {
+ /* Flush data first in order to prevent flushing it to the wrong
+ offset. */
+ err = flush_stream (stream);
+ if (err)
+ goto out;
+ stream->flags.writing = 0;
+ }
+
+ off = offset;
+ if (whence == SEEK_CUR)
+ {
+ off = off - stream->data_len + stream->data_offset;
+ off -= stream->unread_data_len;
+ }
+
+ ret = (*func_seek) (stream->intern->cookie, &off, whence);
+ if (ret == -1)
+ {
+ err = -1;
+#if EWOULDBLOCK != EAGAIN
+ if (errno == EWOULDBLOCK)
+ _set_errno (EAGAIN);
+#endif
+ goto out;
+ }
+
+ err = 0;
+ es_empty (stream);
+
+ if (offset_new)
+ *offset_new = off;
+
+ stream->intern->indicators.eof = 0;
+ stream->intern->offset = off;
+
+ out:
+
+ if (err)
+ {
+ if (errno == EPIPE)
+ stream->intern->indicators.hup = 1;
+ stream->intern->indicators.err = 1;
+ }
+
+ return err;
+}
+
+
+/*
+ * Write BYTES_TO_WRITE bytes from BUFFER into STREAM in
+ * unbuffered-mode, storing the amount of bytes written at
+ * BYTES_WRITTEN.
+ */
+static int
+es_write_nbf (estream_t _GPGRT__RESTRICT stream,
+ const unsigned char *_GPGRT__RESTRICT buffer,
+ size_t bytes_to_write, size_t *_GPGRT__RESTRICT bytes_written)
+{
+ gpgrt_cookie_write_function_t func_write = stream->intern->func_write;
+ size_t data_written;
+ gpgrt_ssize_t ret;
+ int err;
+
+ if (bytes_to_write && (! func_write))
+ {
+ _set_errno (EOPNOTSUPP);
+ err = -1;
+ goto out;
+ }
+
+ data_written = 0;
+ err = 0;
+
+ while (bytes_to_write - data_written)
+ {
+ ret = (*func_write) (stream->intern->cookie,
+ buffer + data_written,
+ bytes_to_write - data_written);
+ if (ret == -1)
+ {
+ err = -1;
+#if EWOULDBLOCK != EAGAIN
+ if (errno == EWOULDBLOCK)
+ _set_errno (EAGAIN);
+#endif
+ break;
+ }
+ else
+ data_written += ret;
+ }
+
+ stream->intern->offset += data_written;
+ *bytes_written = data_written;
+
+ out:
+
+ return err;
+}
+
+
+/*
+ * Write BYTES_TO_WRITE bytes from BUFFER into STREAM in
+ * fully-buffered-mode, storing the amount of bytes written at
+ * BYTES_WRITTEN.
+ */
+static int
+es_write_fbf (estream_t _GPGRT__RESTRICT stream,
+ const unsigned char *_GPGRT__RESTRICT buffer,
+ size_t bytes_to_write, size_t *_GPGRT__RESTRICT bytes_written)
+{
+ size_t space_available;
+ size_t data_to_write;
+ size_t data_written;
+ int err;
+
+ data_written = 0;
+ err = 0;
+
+ while ((bytes_to_write - data_written) && (! err))
+ {
+ if (stream->data_offset == stream->buffer_size)
+ /* Container full, flush buffer. */
+ err = flush_stream (stream);
+
+ if (! err)
+ {
+ /* Flushing resulted in empty container. */
+
+ data_to_write = bytes_to_write - data_written;
+ space_available = stream->buffer_size - stream->data_offset;
+ if (data_to_write > space_available)
+ data_to_write = space_available;
+
+ memcpy (stream->buffer + stream->data_offset,
+ buffer + data_written, data_to_write);
+ stream->data_offset += data_to_write;
+ data_written += data_to_write;
+ }
+ }
+
+ *bytes_written = data_written;
+
+ return err;
+}
+
+
+/* Write BYTES_TO_WRITE bytes from BUFFER into STREAM in
+ line-buffered-mode, storing the amount of bytes written in
+ *BYTES_WRITTEN. */
+static int
+es_write_lbf (estream_t _GPGRT__RESTRICT stream,
+ const unsigned char *_GPGRT__RESTRICT buffer,
+ size_t bytes_to_write, size_t *_GPGRT__RESTRICT bytes_written)
+{
+ size_t data_flushed = 0;
+ size_t data_buffered = 0;
+ unsigned char *nlp;
+ int err = 0;
+
+ nlp = memrchr (buffer, '\n', bytes_to_write);
+ if (nlp)
+ {
+ /* Found a newline, directly write up to (including) this
+ character. */
+ err = flush_stream (stream);
+ if (!err)
+ err = es_write_nbf (stream, buffer, nlp - buffer + 1, &data_flushed);
+ }
+
+ if (!err)
+ {
+ /* Write remaining data fully buffered. */
+ err = es_write_fbf (stream, buffer + data_flushed,
+ bytes_to_write - data_flushed, &data_buffered);
+ }
+
+ *bytes_written = data_flushed + data_buffered;
+ return err;
+}
+
+
+/* Write BYTES_TO_WRITE bytes from BUFFER into STREAM in, storing the
+ amount of bytes written in BYTES_WRITTEN. */
+static int
+es_writen (estream_t _GPGRT__RESTRICT stream,
+ const void *_GPGRT__RESTRICT buffer,
+ size_t bytes_to_write, size_t *_GPGRT__RESTRICT bytes_written)
+{
+ size_t data_written;
+ int err;
+
+ data_written = 0;
+ err = 0;
+
+ if (!stream->flags.writing)
+ {
+ /* Switching to writing mode -> discard input data and seek to
+ position at which reading has stopped. We can do this only
+ if a seek function has been registered. */
+ if (stream->intern->func_seek)
+ {
+ err = es_seek (stream, 0, SEEK_CUR, NULL);
+ if (err)
+ {
+ if (errno == ESPIPE)
+ err = 0;
+ else
+ goto out;
+ }
+ stream->flags.writing = 1;
+ }
+ }
+
+ switch (stream->intern->strategy)
+ {
+ case _IONBF:
+ err = es_write_nbf (stream, buffer, bytes_to_write, &data_written);
+ break;
+
+ case _IOLBF:
+ err = es_write_lbf (stream, buffer, bytes_to_write, &data_written);
+ break;
+
+ case _IOFBF:
+ err = es_write_fbf (stream, buffer, bytes_to_write, &data_written);
+ break;
+ }
+
+ out:
+
+ if (bytes_written)
+ *bytes_written = data_written;
+
+ return err;
+}
+
+
+static int
+peek_stream (estream_t _GPGRT__RESTRICT stream,
+ unsigned char **_GPGRT__RESTRICT data,
+ size_t *_GPGRT__RESTRICT data_len)
+{
+ int err;
+
+ if (stream->flags.writing)
+ {
+ /* Switching to reading mode -> flush output. */
+ err = flush_stream (stream);
+ if (err)
+ goto out;
+ stream->flags.writing = 0;
+ }
+
+ if (stream->data_offset == stream->data_len)
+ {
+ /* Refill container. */
+ err = fill_stream (stream);
+ if (err)
+ goto out;
+ }
+
+ if (data)
+ *data = stream->buffer + stream->data_offset;
+ if (data_len)
+ *data_len = stream->data_len - stream->data_offset;
+ err = 0;
+
+ out:
+
+ return err;
+}
+
+
+/* Skip SIZE bytes of input data contained in buffer. */
+static int
+skip_stream (estream_t stream, size_t size)
+{
+ int err;
+
+ if (stream->data_offset + size > stream->data_len)
+ {
+ _set_errno (EINVAL);
+ err = -1;
+ }
+ else
+ {
+ stream->data_offset += size;
+ err = 0;
+ }
+
+ return err;
+}
+
+
+static int
+doreadline (estream_t _GPGRT__RESTRICT stream, size_t max_length,
+ char *_GPGRT__RESTRICT *_GPGRT__RESTRICT line,
+ size_t *_GPGRT__RESTRICT line_length)
+{
+ size_t line_size;
+ estream_t line_stream;
+ char *line_new;
+ void *line_stream_cookie;
+ char *newline;
+ unsigned char *data;
+ size_t data_len;
+ int err;
+ es_syshd_t syshd;
+
+ line_new = NULL;
+ line_stream = NULL;
+ line_stream_cookie = NULL;
+
+ err = func_mem_create (&line_stream_cookie, NULL, 0, 0,
+ BUFFER_BLOCK_SIZE, 1,
+ mem_realloc, mem_free,
+ O_RDWR,
+ 0);
+ if (err)
+ goto out;
+
+ memset (&syshd, 0, sizeof syshd);
+ err = create_stream (&line_stream, line_stream_cookie,
+ &syshd, BACKEND_MEM,
+ estream_functions_mem, O_RDWR, 1, 0);
+ if (err)
+ goto out;
+
+ {
+ size_t space_left = max_length;
+
+ line_size = 0;
+ for (;;)
+ {
+ if (max_length && (space_left == 1))
+ break;
+
+ err = peek_stream (stream, &data, &data_len);
+ if (err || (! data_len))
+ break;
+
+ if (data_len > (space_left - 1))
+ data_len = space_left - 1;
+
+ newline = memchr (data, '\n', data_len);
+ if (newline)
+ {
+ data_len = (newline - (char *) data) + 1;
+ err = _gpgrt_write (line_stream, data, data_len, NULL);
+ if (! err)
+ {
+ /* Not needed: space_left -= data_len */
+ line_size += data_len;
+ skip_stream (stream, data_len);
+ break; /* endless loop */
+ }
+ }
+ else
+ {
+ err = _gpgrt_write (line_stream, data, data_len, NULL);
+ if (! err)
+ {
+ space_left -= data_len;
+ line_size += data_len;
+ skip_stream (stream, data_len);
+ }
+ }
+ if (err)
+ break;
+ }
+ }
+ if (err)
+ goto out;
+
+ /* Complete line has been written to line_stream. */
+
+ if ((max_length > 1) && (! line_size))
+ {
+ stream->intern->indicators.eof = 1;
+ goto out;
+ }
+
+ err = es_seek (line_stream, 0, SEEK_SET, NULL);
+ if (err)
+ goto out;
+
+ if (! *line)
+ {
+ line_new = mem_alloc (line_size + 1);
+ if (! line_new)
+ {
+ err = -1;
+ goto out;
+ }
+ }
+ else
+ line_new = *line;
+
+ err = _gpgrt_read (line_stream, line_new, line_size, NULL);
+ if (err)
+ goto out;
+
+ line_new[line_size] = '\0';
+
+ if (! *line)
+ *line = line_new;
+ if (line_length)
+ *line_length = line_size;
+
+ out:
+
+ if (line_stream)
+ do_close (line_stream, 0);
+ else if (line_stream_cookie)
+ func_mem_destroy (line_stream_cookie);
+
+ if (err)
+ {
+ if (! *line)
+ mem_free (line_new);
+ stream->intern->indicators.err = 1;
+ }
+
+ return err;
+}
+
+
+/* Output function used by estream_format. */
+static int
+print_writer (void *outfncarg, const char *buf, size_t buflen)
+{
+ estream_t stream = outfncarg;
+ size_t nwritten;
+ int rc;
+
+ nwritten = 0;
+ rc = es_writen (stream, buf, buflen, &nwritten);
+ stream->intern->print_ntotal += nwritten;
+ return rc;
+}
+
+
+/* The core of our printf function. This is called in locked state. */
+static int
+do_print_stream (estream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format, va_list ap)
+{
+ int rc;
+
+ stream->intern->print_ntotal = 0;
+ rc = _gpgrt_estream_format (print_writer, stream, format, ap);
+ if (rc)
+ return -1;
+ return (int)stream->intern->print_ntotal;
+}
+
+
+static int
+es_set_buffering (estream_t _GPGRT__RESTRICT stream,
+ char *_GPGRT__RESTRICT buffer, int mode, size_t size)
+{
+ int err;
+
+ /* Flush or empty buffer depending on mode. */
+ if (stream->flags.writing)
+ {
+ err = flush_stream (stream);
+ if (err)
+ goto out;
+ }
+ else
+ es_empty (stream);
+
+ stream->intern->indicators.eof = 0;
+
+ /* Free old buffer in case that was allocated by this function. */
+ if (stream->intern->deallocate_buffer)
+ {
+ stream->intern->deallocate_buffer = 0;
+ mem_free (stream->buffer);
+ stream->buffer = NULL;
+ }
+
+ if (mode == _IONBF)
+ stream->buffer_size = 0;
+ else
+ {
+ void *buffer_new;
+
+ if (buffer)
+ buffer_new = buffer;
+ else
+ {
+ if (!size)
+ size = BUFSIZ;
+ buffer_new = mem_alloc (size);
+ if (! buffer_new)
+ {
+ err = -1;
+ goto out;
+ }
+ }
+
+ stream->buffer = buffer_new;
+ stream->buffer_size = size;
+ if (! buffer)
+ stream->intern->deallocate_buffer = 1;
+ }
+ stream->intern->strategy = mode;
+ err = 0;
+
+ out:
+
+ return err;
+}
+
+
+static gpgrt_off_t
+es_offset_calculate (estream_t stream)
+{
+ gpgrt_off_t offset;
+
+ offset = stream->intern->offset + stream->data_offset;
+ if (offset < stream->unread_data_len)
+ /* Offset undefined. */
+ offset = 0;
+ else
+ offset -= stream->unread_data_len;
+
+ return offset;
+}
+
+
+static void
+es_opaque_ctrl (estream_t _GPGRT__RESTRICT stream,
+ void *_GPGRT__RESTRICT opaque_new,
+ void **_GPGRT__RESTRICT opaque_old)
+{
+ if (opaque_old)
+ *opaque_old = stream->intern->opaque;
+ if (opaque_new)
+ stream->intern->opaque = opaque_new;
+}
+
+
+/* API. */
+
+estream_t
+_gpgrt_fopen (const char *_GPGRT__RESTRICT path,
+ const char *_GPGRT__RESTRICT mode)
+{
+ unsigned int modeflags, cmode, xmode;
+ int create_called;
+ estream_t stream;
+ void *cookie;
+ int err;
+ int fd;
+ es_syshd_t syshd;
+
+ stream = NULL;
+ cookie = NULL;
+ create_called = 0;
+
+ err = parse_mode (mode, &modeflags, &xmode, &cmode);
+ if (err)
+ goto out;
+
+ err = func_file_create (&cookie, &fd, path, modeflags, cmode);
+ if (err)
+ goto out;
+
+ syshd.type = ES_SYSHD_FD;
+ syshd.u.fd = fd;
+ create_called = 1;
+ err = create_stream (&stream, cookie, &syshd, BACKEND_FD,
+ estream_functions_fd, modeflags, xmode, 0);
+ if (err)
+ goto out;
+
+ if (stream && path)
+ fname_set_internal (stream, path, 1);
+
+ out:
+
+ if (err && create_called)
+ (*estream_functions_fd.public.func_close) (cookie);
+
+ return stream;
+}
+
+
+
+/* Create a new estream object in memory. If DATA is not NULL this
+ buffer will be used as the memory buffer; thus after this functions
+ returns with the success the the memory at DATA belongs to the new
+ estream. The allocated length of DATA is given by DATA_LEN and its
+ used length by DATA_N. Usually this is malloced buffer; if a
+ static buffer is provided, the caller must pass false for GROW and
+ provide a dummy function for FUNC_FREE. FUNC_FREE and FUNC_REALLOC
+ allow the caller to provide custom functions for realloc and free
+ to be used by the new estream object. Note that the realloc
+ function is also used for initial allocation. If DATA is NULL a
+ buffer is internally allocated; either using internal function or
+ those provide by the caller. It is an error to provide a realloc
+ function but no free function. Providing only a free function is
+ allowed as long as GROW is false. */
+estream_t
+_gpgrt_mopen (void *_GPGRT__RESTRICT data, size_t data_n, size_t data_len,
+ unsigned int grow,
+ func_realloc_t func_realloc, func_free_t func_free,
+ const char *_GPGRT__RESTRICT mode)
+{
+ int create_called = 0;
+ estream_t stream = NULL;
+ void *cookie = NULL;
+ unsigned int modeflags, xmode;
+ int err;
+ es_syshd_t syshd;
+
+ err = parse_mode (mode, &modeflags, &xmode, NULL);
+ if (err)
+ goto out;
+
+ err = func_mem_create (&cookie, data, data_n, data_len,
+ BUFFER_BLOCK_SIZE, grow,
+ func_realloc, func_free, modeflags, 0);
+ if (err)
+ goto out;
+
+ memset (&syshd, 0, sizeof syshd);
+ create_called = 1;
+ err = create_stream (&stream, cookie, &syshd, BACKEND_MEM,
+ estream_functions_mem, modeflags, xmode, 0);
+
+ out:
+
+ if (err && create_called)
+ (*estream_functions_mem.public.func_close) (cookie);
+
+ return stream;
+}
+
+
+
+estream_t
+_gpgrt_fopenmem (size_t memlimit, const char *_GPGRT__RESTRICT mode)
+{
+ unsigned int modeflags, xmode;
+ estream_t stream = NULL;
+ void *cookie = NULL;
+ es_syshd_t syshd;
+
+ /* Memory streams are always read/write. We use MODE only to get
+ the append flag. */
+ if (parse_mode (mode, &modeflags, &xmode, NULL))
+ return NULL;
+ modeflags |= O_RDWR;
+
+ if (func_mem_create (&cookie, NULL, 0, 0,
+ BUFFER_BLOCK_SIZE, 1,
+ mem_realloc, mem_free, modeflags,
+ memlimit))
+ return NULL;
+
+ memset (&syshd, 0, sizeof syshd);
+ if (create_stream (&stream, cookie, &syshd, BACKEND_MEM,
+ estream_functions_mem, modeflags, xmode, 0))
+ (*estream_functions_mem.public.func_close) (cookie);
+
+ return stream;
+}
+
+
+/* This is the same as es_fopenmem but intializes the memory with a
+ copy of (DATA,DATALEN). The stream is initially set to the
+ beginning. If MEMLIMIT is not 0 but shorter than DATALEN it
+ DATALEN will be used as the value for MEMLIMIT. */
+estream_t
+_gpgrt_fopenmem_init (size_t memlimit, const char *_GPGRT__RESTRICT mode,
+ const void *data, size_t datalen)
+{
+ estream_t stream;
+
+ if (memlimit && memlimit < datalen)
+ memlimit = datalen;
+
+ stream = _gpgrt_fopenmem (memlimit, mode);
+ if (stream && data && datalen)
+ {
+ if (es_writen (stream, data, datalen, NULL))
+ {
+ int saveerrno = errno;
+ _gpgrt_fclose (stream);
+ stream = NULL;
+ _set_errno (saveerrno);
+ }
+ else
+ {
+ es_seek (stream, 0L, SEEK_SET, NULL);
+ stream->intern->indicators.eof = 0;
+ stream->intern->indicators.err = 0;
+ }
+ }
+ return stream;
+}
+
+
+
+estream_t
+_gpgrt_fopencookie (void *_GPGRT__RESTRICT cookie,
+ const char *_GPGRT__RESTRICT mode,
+ gpgrt_cookie_io_functions_t functions)
+{
+ unsigned int modeflags, xmode;
+ estream_t stream;
+ int err;
+ es_syshd_t syshd;
+ struct cookie_io_functions_s io_functions = { functions, NULL, };
+
+ stream = NULL;
+ modeflags = 0;
+
+ err = parse_mode (mode, &modeflags, &xmode, NULL);
+ if (err)
+ goto out;
+
+ memset (&syshd, 0, sizeof syshd);
+ err = create_stream (&stream, cookie, &syshd, BACKEND_USER, io_functions,
+ modeflags, xmode, 0);
+ if (err)
+ goto out;
+
+ out:
+ return stream;
+}
+
+
+
+static estream_t
+do_fdopen (int filedes, const char *mode, int no_close, int with_locked_list)
+{
+ int create_called = 0;
+ estream_t stream = NULL;
+ void *cookie = NULL;
+ unsigned int modeflags, xmode;
+ int err;
+ es_syshd_t syshd;
+
+ err = parse_mode (mode, &modeflags, &xmode, NULL);
+ if (err)
+ goto out;
+ if ((xmode & X_SYSOPEN))
+ {
+ /* Not allowed for fdopen. */
+ _set_errno (EINVAL);
+ err = -1;
+ goto out;
+ }
+
+ err = func_fd_create (&cookie, filedes, modeflags, no_close);
+ if (err)
+ goto out;
+
+ syshd.type = ES_SYSHD_FD;
+ syshd.u.fd = filedes;
+ create_called = 1;
+ err = create_stream (&stream, cookie, &syshd,
+ BACKEND_FD, estream_functions_fd,
+ modeflags, xmode, with_locked_list);
+
+ if (!err && stream)
+ {
+ if ((modeflags & O_NONBLOCK))
+ err = stream->intern->func_ioctl (cookie, COOKIE_IOCTL_NONBLOCK,
+ "", NULL);
+ }
+
+ out:
+ if (err && create_called)
+ (*estream_functions_fd.public.func_close) (cookie);
+
+ return stream;
+}
+
+estream_t
+_gpgrt_fdopen (int filedes, const char *mode)
+{
+ return do_fdopen (filedes, mode, 0, 0);
+}
+
+/* A variant of es_fdopen which does not close FILEDES at the end. */
+estream_t
+_gpgrt_fdopen_nc (int filedes, const char *mode)
+{
+ return do_fdopen (filedes, mode, 1, 0);
+}
+
+
+
+static estream_t
+do_fpopen (FILE *fp, const char *mode, int no_close, int with_locked_list)
+{
+ unsigned int modeflags, cmode, xmode;
+ int create_called = 0;
+ estream_t stream = NULL;
+ void *cookie = NULL;
+ int err;
+ es_syshd_t syshd;
+
+ err = parse_mode (mode, &modeflags, &xmode, &cmode);
+ if (err)
+ goto out;
+ if ((xmode & X_SYSOPEN))
+ {
+ /* Not allowed for fpopen. */
+ _set_errno (EINVAL);
+ err = -1;
+ goto out;
+ }
+
+ if (fp)
+ fflush (fp);
+ err = func_fp_create (&cookie, fp, modeflags, no_close);
+ if (err)
+ goto out;
+
+ syshd.type = ES_SYSHD_FD;
+ syshd.u.fd = fp? fileno (fp): -1;
+ create_called = 1;
+ err = create_stream (&stream, cookie, &syshd,
+ BACKEND_FP, estream_functions_fp,
+ modeflags, xmode, with_locked_list);
+
+ out:
+ if (err && create_called)
+ (*estream_functions_fp.public.func_close) (cookie);
+
+ return stream;
+}
+
+
+/* Create an estream from the stdio stream FP. This mechanism is
+ useful in case the stdio streams have special properties and may
+ not be mixed with fd based functions. This is for example the case
+ under Windows where the 3 standard streams are associated with the
+ console whereas a duped and fd-opened stream of one of this stream
+ won't be associated with the console. As this messes things up it
+ is easier to keep on using the standard I/O stream as a backend for
+ estream. */
+estream_t
+_gpgrt_fpopen (FILE *fp, const char *mode)
+{
+ return do_fpopen (fp, mode, 0, 0);
+}
+
+
+/* Same as es_fpopen but does not close FP at the end. */
+estream_t
+_gpgrt_fpopen_nc (FILE *fp, const char *mode)
+{
+ return do_fpopen (fp, mode, 1, 0);
+}
+
+
+
+#ifdef HAVE_W32_SYSTEM
+estream_t
+do_w32open (HANDLE hd, const char *mode,
+ int no_close, int with_locked_list)
+{
+ unsigned int modeflags, cmode, xmode;
+ int create_called = 0;
+ estream_t stream = NULL;
+ void *cookie = NULL;
+ int err;
+ es_syshd_t syshd;
+
+ /* For obvious reasons we ignore sysmode here. */
+ err = parse_mode (mode, &modeflags, &xmode, &cmode);
+ if (err)
+ goto leave;
+
+ /* If we are pollable we create the function cookie with syscall
+ * clamp disabled. This is because functions are called from
+ * separatre reader and writer threads in w32-stream. */
+ err = func_w32_create (&cookie, hd, modeflags,
+ no_close, !!(xmode & X_POLLABLE));
+ if (err)
+ goto leave;
+
+ syshd.type = ES_SYSHD_HANDLE;
+ syshd.u.handle = hd;
+ create_called = 1;
+ err = create_stream (&stream, cookie, &syshd,
+ BACKEND_W32, estream_functions_w32,
+ modeflags, xmode, with_locked_list);
+
+ leave:
+ if (err && create_called)
+ (*estream_functions_w32.public.func_close) (cookie);
+
+ return stream;
+}
+#endif /*HAVE_W32_SYSTEM*/
+
+static estream_t
+do_sysopen (es_syshd_t *syshd, const char *mode, int no_close)
+{
+ estream_t stream;
+
+ switch (syshd->type)
+ {
+ case ES_SYSHD_FD:
+ case ES_SYSHD_SOCK:
+ stream = do_fdopen (syshd->u.fd, mode, no_close, 0);
+ break;
+
+#ifdef HAVE_W32_SYSTEM
+ case ES_SYSHD_HANDLE:
+ stream = do_w32open (syshd->u.handle, mode, no_close, 0);
+ break;
+#endif
+
+ /* FIXME: Support RVIDs under Wince? */
+
+ default:
+ _set_errno (EINVAL);
+ stream = NULL;
+ }
+ return stream;
+}
+
+/* On POSIX systems this function is an alias for es_fdopen. Under
+ Windows it uses the bare W32 API and thus a HANDLE instead of a
+ file descriptor. */
+estream_t
+_gpgrt_sysopen (es_syshd_t *syshd, const char *mode)
+{
+ return do_sysopen (syshd, mode, 0);
+}
+
+/* Same as es_sysopen but the handle/fd will not be closed by
+ es_fclose. */
+estream_t
+_gpgrt_sysopen_nc (es_syshd_t *syshd, const char *mode)
+{
+ return do_sysopen (syshd, mode, 1);
+}
+
+
+
+/* Set custom standard descriptors to be used for stdin, stdout and
+ stderr. This function needs to be called before any of the
+ standard streams are accessed. This internal version uses a double
+ dash inside its name. */
+void
+_gpgrt__set_std_fd (int no, int fd)
+{
+ /* fprintf (stderr, "es_set_std_fd(%d, %d)\n", no, fd); */
+ lock_list ();
+ if (no >= 0 && no < 3 && !custom_std_fds_valid[no])
+ {
+ custom_std_fds[no] = fd;
+ custom_std_fds_valid[no] = 1;
+ }
+ unlock_list ();
+}
+
+
+/* Return the stream used for stdin, stdout or stderr.
+ This internal version uses a double dash inside its name. */
+estream_t
+_gpgrt__get_std_stream (int fd)
+{
+ estream_list_t list_obj;
+ estream_t stream = NULL;
+
+ fd %= 3; /* We only allow 0, 1 or 2 but we don't want to return an error. */
+
+ lock_list ();
+
+ for (list_obj = estream_list; list_obj; list_obj = list_obj->next)
+ if (list_obj->stream && list_obj->stream->intern->is_stdstream
+ && list_obj->stream->intern->stdstream_fd == fd)
+ {
+ stream = list_obj->stream;
+ break;
+ }
+ if (!stream)
+ {
+ /* Standard stream not yet created. We first try to create them
+ from registered file descriptors. */
+ if (!fd && custom_std_fds_valid[0])
+ stream = do_fdopen (custom_std_fds[0], "r", 1, 1);
+ else if (fd == 1 && custom_std_fds_valid[1])
+ stream = do_fdopen (custom_std_fds[1], "a", 1, 1);
+ else if (custom_std_fds_valid[2])
+ stream = do_fdopen (custom_std_fds[2], "a", 1, 1);
+
+ if (!stream)
+ {
+ /* Second try is to use the standard C streams. */
+ if (!fd)
+ stream = do_fpopen (stdin, "r", 1, 1);
+ else if (fd == 1)
+ stream = do_fpopen (stdout, "a", 1, 1);
+ else
+ stream = do_fpopen (stderr, "a", 1, 1);
+ }
+
+ if (!stream)
+ {
+ /* Last try: Create a bit bucket. */
+ stream = do_fpopen (NULL, fd? "a":"r", 0, 1);
+ if (!stream)
+ {
+ fprintf (stderr, "fatal: error creating a dummy estream"
+ " for %d: %s\n", fd, strerror (errno));
+ abort();
+ }
+ }
+
+ stream->intern->is_stdstream = 1;
+ stream->intern->stdstream_fd = fd;
+ if (fd == 2)
+ es_set_buffering (stream, NULL, _IOLBF, 0);
+ fname_set_internal (stream,
+ fd == 0? "[stdin]" :
+ fd == 1? "[stdout]" : "[stderr]", 0);
+ }
+
+ unlock_list ();
+ return stream;
+}
+
+/* Note: A "samethread" keyword given in "mode" is ignored and the
+ * value used by STREAM is used instead. Note that this function is
+ * the reasons why some of the init and deinit code is split up into
+ * several functions. */
+estream_t
+_gpgrt_freopen (const char *_GPGRT__RESTRICT path,
+ const char *_GPGRT__RESTRICT mode,
+ estream_t _GPGRT__RESTRICT stream)
+{
+ int err;
+
+ if (path)
+ {
+ unsigned int modeflags, cmode, xmode, dummy;
+ int create_called;
+ void *cookie;
+ int fd;
+ es_syshd_t syshd;
+
+ cookie = NULL;
+ create_called = 0;
+
+ xmode = stream->intern->samethread ? X_SAMETHREAD : 0;
+
+ lock_stream (stream);
+
+ deinit_stream_obj (stream);
+
+ err = parse_mode (mode, &modeflags, &dummy, &cmode);
+ if (err)
+ goto leave;
+ (void)dummy;
+
+ err = func_file_create (&cookie, &fd, path, modeflags, cmode);
+ if (err)
+ goto leave;
+
+ syshd.type = ES_SYSHD_FD;
+ syshd.u.fd = fd;
+ create_called = 1;
+ init_stream_obj (stream, cookie, &syshd, BACKEND_FD,
+ estream_functions_fd, modeflags, xmode);
+
+ leave:
+
+ if (err)
+ {
+ if (create_called)
+ func_fd_destroy (cookie);
+
+ do_close (stream, 0);
+ stream = NULL;
+ }
+ else
+ {
+ if (path)
+ fname_set_internal (stream, path, 1);
+ unlock_stream (stream);
+ }
+ }
+ else
+ {
+ /* FIXME? We don't support re-opening at the moment. */
+ _set_errno (EINVAL);
+ deinit_stream_obj (stream);
+ do_close (stream, 0);
+ stream = NULL;
+ }
+
+ return stream;
+}
+
+
+int
+_gpgrt_fclose (estream_t stream)
+{
+ int err;
+
+ err = do_close (stream, 0);
+
+ return err;
+}
+
+
+/* This is a special version of es_fclose which can be used with
+ es_fopenmem to return the memory buffer. This is feature is useful
+ to write to a memory buffer using estream. Note that the function
+ does not close the stream if the stream does not support snatching
+ the buffer. On error NULL is stored at R_BUFFER. Note that if no
+ write operation has happened, NULL may also be stored at BUFFER on
+ success. The caller needs to release the returned memory using
+ gpgrt_free. */
+int
+_gpgrt_fclose_snatch (estream_t stream, void **r_buffer, size_t *r_buflen)
+{
+ int err;
+
+ /* Note: There is no need to lock the stream in a close call. The
+ object will be destroyed after the close and thus any other
+ contender for the lock would work on a closed stream. */
+
+ if (r_buffer)
+ {
+ cookie_ioctl_function_t func_ioctl = stream->intern->func_ioctl;
+ size_t buflen;
+
+ *r_buffer = NULL;
+
+ if (!func_ioctl)
+ {
+ _set_errno (EOPNOTSUPP);
+ err = -1;
+ goto leave;
+ }
+
+ if (stream->flags.writing)
+ {
+ err = flush_stream (stream);
+ if (err)
+ goto leave;
+ stream->flags.writing = 0;
+ }
+
+ err = func_ioctl (stream->intern->cookie, COOKIE_IOCTL_SNATCH_BUFFER,
+ r_buffer, &buflen);
+ if (err)
+ goto leave;
+ if (r_buflen)
+ *r_buflen = buflen;
+ }
+
+ err = do_close (stream, 0);
+
+ leave:
+ if (err && r_buffer)
+ {
+ mem_free (*r_buffer);
+ *r_buffer = NULL;
+ }
+ return err;
+}
+
+
+/* Register or unregister a close notification function for STREAM.
+ FNC is the function to call and FNC_VALUE the value passed as
+ second argument. To register the notification the value for MODE
+ must be 1. If mode is 0 the function tries to remove or disable an
+ already registered notification; for this to work the value of FNC
+ and FNC_VALUE must be the same as with the registration and
+ FNC_VALUE must be a unique value. No error will be returned if
+ MODE is 0.
+
+ FIXME: I think the next comment is not anymore correct:
+ Unregister should only be used in the error case because it may not
+ be able to remove memory internally allocated for the onclose
+ handler.
+
+ FIXME: Unregister is not thread safe.
+
+ The notification will be called right before the stream is closed.
+ It may not call any estream function for STREAM, neither direct nor
+ indirectly. */
+int
+_gpgrt_onclose (estream_t stream, int mode,
+ void (*fnc) (estream_t, void*), void *fnc_value)
+{
+ int err;
+
+ lock_stream (stream);
+ err = do_onclose (stream, mode, fnc, fnc_value);
+ unlock_stream (stream);
+
+ return err;
+}
+
+
+int
+_gpgrt_fileno_unlocked (estream_t stream)
+{
+ es_syshd_t syshd;
+
+ if (_gpgrt_syshd_unlocked (stream, &syshd))
+ return -1;
+ switch (syshd.type)
+ {
+ case ES_SYSHD_FD: return syshd.u.fd;
+ case ES_SYSHD_SOCK: return syshd.u.sock;
+ default:
+ _set_errno (EINVAL);
+ return -1;
+ }
+}
+
+
+/* Return the handle of a stream which has been opened by es_sysopen.
+ The caller needs to pass a structure which will be filled with the
+ sys handle. Return 0 on success or true on error and sets errno.
+ This is the unlocked version. */
+int
+_gpgrt_syshd_unlocked (estream_t stream, es_syshd_t *syshd)
+{
+ if (!stream || !syshd || stream->intern->syshd.type == ES_SYSHD_NONE)
+ {
+ if (syshd)
+ syshd->type = ES_SYSHD_NONE;
+ _set_errno (EINVAL);
+ return -1;
+ }
+
+ *syshd = stream->intern->syshd;
+ return 0;
+}
+
+
+void
+_gpgrt_flockfile (estream_t stream)
+{
+ lock_stream (stream);
+}
+
+
+int
+_gpgrt_ftrylockfile (estream_t stream)
+{
+ return trylock_stream (stream);
+}
+
+
+void
+_gpgrt_funlockfile (estream_t stream)
+{
+ unlock_stream (stream);
+}
+
+
+int
+_gpgrt_fileno (estream_t stream)
+{
+ int ret;
+
+ lock_stream (stream);
+ ret = _gpgrt_fileno_unlocked (stream);
+ unlock_stream (stream);
+
+ return ret;
+}
+
+
+/* Return the handle of a stream which has been opened by es_sysopen.
+ The caller needs to pass a structure which will be filled with the
+ sys handle. Return 0 on success or true on error and sets errno.
+ This is the unlocked version. */
+int
+_gpgrt_syshd (estream_t stream, es_syshd_t *syshd)
+{
+ int ret;
+
+ lock_stream (stream);
+ ret = _gpgrt_syshd_unlocked (stream, syshd);
+ unlock_stream (stream);
+
+ return ret;
+}
+
+
+int
+_gpgrt__pending_unlocked (estream_t stream)
+{
+ return check_pending (stream);
+}
+
+
+/* Return true if there is at least one byte pending for read on
+ STREAM. This does only work if the backend supports checking for
+ pending bytes and is thus mostly useful with cookie based backends.
+
+ Note that if this function is used with cookie based functions, the
+ read cookie may be called with 0 for the SIZE argument. If bytes
+ are pending the function is expected to return -1 in this case and
+ thus deviates from the standard behavior of read(2). */
+int
+_gpgrt__pending (estream_t stream)
+{
+ int ret;
+
+ lock_stream (stream);
+ ret = _gpgrt__pending_unlocked (stream);
+ unlock_stream (stream);
+
+ return ret;
+}
+
+
+int
+_gpgrt_feof_unlocked (estream_t stream)
+{
+ return stream->intern->indicators.eof;
+}
+
+
+int
+_gpgrt_feof (estream_t stream)
+{
+ int ret;
+
+ lock_stream (stream);
+ ret = _gpgrt_feof_unlocked (stream);
+ unlock_stream (stream);
+
+ return ret;
+}
+
+
+int
+_gpgrt_ferror_unlocked (estream_t stream)
+{
+ return stream->intern->indicators.err;
+}
+
+
+int
+_gpgrt_ferror (estream_t stream)
+{
+ int ret;
+
+ lock_stream (stream);
+ ret = _gpgrt_ferror_unlocked (stream);
+ unlock_stream (stream);
+
+ return ret;
+}
+
+
+void
+_gpgrt_clearerr_unlocked (estream_t stream)
+{
+ stream->intern->indicators.eof = 0;
+ stream->intern->indicators.err = 0;
+ /* We do not reset the HUP indicator because there is no way to
+ get out of this state. */
+}
+
+
+void
+_gpgrt_clearerr (estream_t stream)
+{
+ lock_stream (stream);
+ _gpgrt_clearerr_unlocked (stream);
+ unlock_stream (stream);
+}
+
+
+static int
+do_fflush (estream_t stream)
+{
+ int err;
+
+ if (stream->flags.writing)
+ err = flush_stream (stream);
+ else
+ {
+ es_empty (stream);
+ err = 0;
+ }
+
+ return err;
+}
+
+
+int
+_gpgrt_fflush (estream_t stream)
+{
+ int err;
+
+ if (stream)
+ {
+ lock_stream (stream);
+ err = do_fflush (stream);
+ unlock_stream (stream);
+ }
+ else
+ {
+ estream_list_t item;
+
+ err = 0;
+ lock_list ();
+ for (item = estream_list; item; item = item->next)
+ if (item->stream)
+ {
+ lock_stream (item->stream);
+ err |= do_fflush (item->stream);
+ unlock_stream (item->stream);
+ }
+ unlock_list ();
+ }
+ return err ? EOF : 0;
+}
+
+
+int
+_gpgrt_fseek (estream_t stream, long int offset, int whence)
+{
+ int err;
+
+ lock_stream (stream);
+ err = es_seek (stream, offset, whence, NULL);
+ unlock_stream (stream);
+
+ return err;
+}
+
+
+int
+_gpgrt_fseeko (estream_t stream, gpgrt_off_t offset, int whence)
+{
+ int err;
+
+ lock_stream (stream);
+ err = es_seek (stream, offset, whence, NULL);
+ unlock_stream (stream);
+
+ return err;
+}
+
+
+long int
+_gpgrt_ftell (estream_t stream)
+{
+ long int ret;
+
+ lock_stream (stream);
+ ret = es_offset_calculate (stream);
+ unlock_stream (stream);
+
+ return ret;
+}
+
+
+gpgrt_off_t
+_gpgrt_ftello (estream_t stream)
+{
+ gpgrt_off_t ret = -1;
+
+ lock_stream (stream);
+ ret = es_offset_calculate (stream);
+ unlock_stream (stream);
+
+ return ret;
+}
+
+
+void
+_gpgrt_rewind (estream_t stream)
+{
+ lock_stream (stream);
+ es_seek (stream, 0L, SEEK_SET, NULL);
+ /* Note that es_seek already cleared the EOF flag. */
+ stream->intern->indicators.err = 0;
+ unlock_stream (stream);
+}
+
+
+int
+_gpgrt__getc_underflow (estream_t stream)
+{
+ int err;
+ unsigned char c;
+ size_t bytes_read;
+
+ err = es_readn (stream, &c, 1, &bytes_read);
+
+ return (err || (! bytes_read)) ? EOF : c;
+}
+
+
+int
+_gpgrt__putc_overflow (int c, estream_t stream)
+{
+ unsigned char d = c;
+ int err;
+
+ err = es_writen (stream, &d, 1, NULL);
+
+ return err ? EOF : c;
+}
+
+
+int
+_gpgrt_fgetc (estream_t stream)
+{
+ int ret;
+
+ lock_stream (stream);
+ ret = _gpgrt_getc_unlocked (stream);
+ unlock_stream (stream);
+
+ return ret;
+}
+
+
+int
+_gpgrt_fputc (int c, estream_t stream)
+{
+ int ret;
+
+ lock_stream (stream);
+ ret = _gpgrt_putc_unlocked (c, stream);
+ unlock_stream (stream);
+
+ return ret;
+}
+
+
+int
+_gpgrt_ungetc (int c, estream_t stream)
+{
+ unsigned char data = (unsigned char) c;
+ size_t data_unread;
+
+ lock_stream (stream);
+ es_unreadn (stream, &data, 1, &data_unread);
+ unlock_stream (stream);
+
+ return data_unread ? c : EOF;
+}
+
+
+int
+_gpgrt_read (estream_t _GPGRT__RESTRICT stream,
+ void *_GPGRT__RESTRICT buffer, size_t bytes_to_read,
+ size_t *_GPGRT__RESTRICT bytes_read)
+{
+ int err;
+
+ if (bytes_to_read)
+ {
+ lock_stream (stream);
+ err = es_readn (stream, buffer, bytes_to_read, bytes_read);
+ unlock_stream (stream);
+ }
+ else
+ err = 0;
+
+ return err;
+}
+
+
+int
+_gpgrt_write (estream_t _GPGRT__RESTRICT stream,
+ const void *_GPGRT__RESTRICT buffer, size_t bytes_to_write,
+ size_t *_GPGRT__RESTRICT bytes_written)
+{
+ int err;
+
+ if (bytes_to_write)
+ {
+ lock_stream (stream);
+ err = es_writen (stream, buffer, bytes_to_write, bytes_written);
+ unlock_stream (stream);
+ }
+ else
+ err = 0;
+
+ return err;
+}
+
+
+size_t
+_gpgrt_fread (void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems,
+ estream_t _GPGRT__RESTRICT stream)
+{
+ size_t ret, bytes;
+
+ if (size && nitems)
+ {
+ lock_stream (stream);
+ es_readn (stream, ptr, size * nitems, &bytes);
+ unlock_stream (stream);
+
+ ret = bytes / size;
+ }
+ else
+ ret = 0;
+
+ return ret;
+}
+
+
+size_t
+_gpgrt_fwrite (const void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems,
+ estream_t _GPGRT__RESTRICT stream)
+{
+ size_t ret, bytes;
+
+ if (size && nitems)
+ {
+ lock_stream (stream);
+ es_writen (stream, ptr, size * nitems, &bytes);
+ unlock_stream (stream);
+
+ ret = bytes / size;
+ }
+ else
+ ret = 0;
+
+ return ret;
+}
+
+
+char *
+_gpgrt_fgets (char *_GPGRT__RESTRICT buffer, int length,
+ estream_t _GPGRT__RESTRICT stream)
+{
+ unsigned char *s = (unsigned char*)buffer;
+ int c;
+
+ if (!length)
+ return NULL;
+
+ c = EOF;
+ lock_stream (stream);
+ while (length > 1 && (c = _gpgrt_getc_unlocked (stream)) != EOF && c != '\n')
+ {
+ *s++ = c;
+ length--;
+ }
+ unlock_stream (stream);
+
+ if (c == EOF && s == (unsigned char*)buffer)
+ return NULL; /* Nothing read. */
+
+ if (c != EOF && length > 1)
+ *s++ = c;
+
+ *s = 0;
+ return buffer;
+}
+
+
+int
+_gpgrt_fputs_unlocked (const char *_GPGRT__RESTRICT s,
+ estream_t _GPGRT__RESTRICT stream)
+{
+ size_t length;
+ int err;
+
+ length = strlen (s);
+ err = es_writen (stream, s, length, NULL);
+ return err ? EOF : 0;
+}
+
+int
+_gpgrt_fputs (const char *_GPGRT__RESTRICT s, estream_t _GPGRT__RESTRICT stream)
+{
+ size_t length;
+ int err;
+
+ length = strlen (s);
+ lock_stream (stream);
+ err = es_writen (stream, s, length, NULL);
+ unlock_stream (stream);
+
+ return err ? EOF : 0;
+}
+
+
+gpgrt_ssize_t
+_gpgrt_getline (char *_GPGRT__RESTRICT *_GPGRT__RESTRICT lineptr,
+ size_t *_GPGRT__RESTRICT n, estream_t _GPGRT__RESTRICT stream)
+{
+ char *line = NULL;
+ size_t line_n = 0;
+ int err;
+
+ lock_stream (stream);
+ err = doreadline (stream, 0, &line, &line_n);
+ unlock_stream (stream);
+ if (err)
+ goto out;
+
+ if (*n)
+ {
+ /* Caller wants us to use his buffer. */
+
+ if (*n < (line_n + 1))
+ {
+ /* Provided buffer is too small -> resize. */
+
+ void *p;
+
+ p = mem_realloc (*lineptr, line_n + 1);
+ if (! p)
+ err = -1;
+ else
+ {
+ if (*lineptr != p)
+ *lineptr = p;
+ }
+ }
+
+ if (! err)
+ {
+ memcpy (*lineptr, line, line_n + 1);
+ if (*n != line_n)
+ *n = line_n;
+ }
+ mem_free (line);
+ }
+ else
+ {
+ /* Caller wants new buffers. */
+ *lineptr = line;
+ *n = line_n;
+ }
+
+ out:
+
+ return err ? err : (gpgrt_ssize_t)line_n;
+}
+
+
+
+/* Same as fgets() but if the provided buffer is too short a larger
+ one will be allocated. This is similar to getline. A line is
+ considered a byte stream ending in a LF.
+
+ If MAX_LENGTH is not NULL, it shall point to a value with the
+ maximum allowed allocation.
+
+ Returns the length of the line. EOF is indicated by a line of
+ length zero. A truncated line is indicated my setting the value at
+ MAX_LENGTH to 0. If the returned value is less then 0 not enough
+ memory was available or another error occurred; ERRNO is then set
+ accordingly.
+
+ If a line has been truncated, the file pointer is moved forward to
+ the end of the line so that the next read starts with the next
+ line. Note that MAX_LENGTH must be re-initialzied in this case.
+
+ The caller initially needs to provide the address of a variable,
+ initialized to NULL, at ADDR_OF_BUFFER and don't change this value
+ anymore with the following invocations. LENGTH_OF_BUFFER should be
+ the address of a variable, initialized to 0, which is also
+ maintained by this function. Thus, both paramaters should be
+ considered the state of this function.
+
+ Note: The returned buffer is allocated with enough extra space to
+ allow the caller to append a CR,LF,Nul. The buffer should be
+ released using gpgrt_free.
+ */
+gpgrt_ssize_t
+_gpgrt_read_line (estream_t stream,
+ char **addr_of_buffer, size_t *length_of_buffer,
+ size_t *max_length)
+{
+ int c;
+ char *buffer = *addr_of_buffer;
+ size_t length = *length_of_buffer;
+ size_t nbytes = 0;
+ size_t maxlen = max_length? *max_length : 0;
+ char *p;
+
+ if (!buffer)
+ {
+ /* No buffer given - allocate a new one. */
+ length = 256;
+ buffer = mem_alloc (length);
+ *addr_of_buffer = buffer;
+ if (!buffer)
+ {
+ *length_of_buffer = 0;
+ if (max_length)
+ *max_length = 0;
+ return -1;
+ }
+ *length_of_buffer = length;
+ }
+
+ if (length < 4)
+ {
+ /* This should never happen. If it does, the function has been
+ called with wrong arguments. */
+ _set_errno (EINVAL);
+ return -1;
+ }
+ length -= 3; /* Reserve 3 bytes for CR,LF,EOL. */
+
+ lock_stream (stream);
+ p = buffer;
+ while ((c = _gpgrt_getc_unlocked (stream)) != EOF)
+ {
+ if (nbytes == length)
+ {
+ /* Enlarge the buffer. */
+ if (maxlen && length > maxlen)
+ {
+ /* We are beyond our limit: Skip the rest of the line. */
+ while (c != '\n' && (c=_gpgrt_getc_unlocked (stream)) != EOF)
+ ;
+ *p++ = '\n'; /* Always append a LF (we reserved some space). */
+ nbytes++;
+ if (max_length)
+ *max_length = 0; /* Indicate truncation. */
+ break; /* the while loop. */
+ }
+ length += 3; /* Adjust for the reserved bytes. */
+ length += length < 1024? 256 : 1024;
+ *addr_of_buffer = mem_realloc (buffer, length);
+ if (!*addr_of_buffer)
+ {
+ int save_errno = errno;
+ mem_free (buffer);
+ *length_of_buffer = 0;
+ if (max_length)
+ *max_length = 0;
+ unlock_stream (stream);
+ _set_errno (save_errno);
+ return -1;
+ }
+ buffer = *addr_of_buffer;
+ *length_of_buffer = length;
+ length -= 3;
+ p = buffer + nbytes;
+ }
+ *p++ = c;
+ nbytes++;
+ if (c == '\n')
+ break;
+ }
+ *p = 0; /* Make sure the line is a string. */
+ unlock_stream (stream);
+
+ return nbytes;
+}
+
+/* Wrapper around free() to match the memory allocation system used by
+ estream. Should be used for all buffers returned to the caller by
+ libestream. If a custom allocation handler has been set with
+ gpgrt_set_alloc_func that register function may be used
+ instead. This function has been moved to init.c. */
+/* void */
+/* _gpgrt_free (void *a) */
+/* { */
+/* mem_free (a); */
+/* } */
+
+
+int
+_gpgrt_vfprintf_unlocked (estream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format,
+ va_list ap)
+{
+ return do_print_stream (stream, format, ap);
+}
+
+
+int
+_gpgrt_vfprintf (estream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format,
+ va_list ap)
+{
+ int ret;
+
+ lock_stream (stream);
+ ret = do_print_stream (stream, format, ap);
+ unlock_stream (stream);
+
+ return ret;
+}
+
+
+int
+_gpgrt_fprintf_unlocked (estream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format, ...)
+{
+ int ret;
+
+ va_list ap;
+ va_start (ap, format);
+ ret = do_print_stream (stream, format, ap);
+ va_end (ap);
+
+ return ret;
+}
+
+
+int
+_gpgrt_fprintf (estream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format, ...)
+{
+ int ret;
+
+ va_list ap;
+ va_start (ap, format);
+ lock_stream (stream);
+ ret = do_print_stream (stream, format, ap);
+ unlock_stream (stream);
+ va_end (ap);
+
+ return ret;
+}
+
+
+static int
+tmpfd (void)
+{
+#ifdef HAVE_W32_SYSTEM
+ int attempts, n;
+#ifdef HAVE_W32CE_SYSTEM
+ wchar_t buffer[MAX_PATH+9+12+1];
+# define mystrlen(a) wcslen (a)
+ wchar_t *name, *p;
+#else
+ char buffer[MAX_PATH+9+12+1];
+# define mystrlen(a) strlen (a)
+ char *name, *p;
+#endif
+ HANDLE file;
+ int pid = GetCurrentProcessId ();
+ unsigned int value;
+ int i;
+
+ n = GetTempPath (MAX_PATH+1, buffer);
+ if (!n || n > MAX_PATH || mystrlen (buffer) > MAX_PATH)
+ {
+ _set_errno (ENOENT);
+ return -1;
+ }
+ p = buffer + mystrlen (buffer);
+#ifdef HAVE_W32CE_SYSTEM
+ wcscpy (p, L"_estream");
+#else
+ strcpy (p, "_estream");
+#endif
+ p += 8;
+ /* We try to create the directory but don't care about an error as
+ it may already exist and the CreateFile would throw an error
+ anyway. */
+ CreateDirectory (buffer, NULL);
+ *p++ = '\\';
+ name = p;
+ for (attempts=0; attempts < 10; attempts++)
+ {
+ p = name;
+ value = (GetTickCount () ^ ((pid<<16) & 0xffff0000));
+ for (i=0; i < 8; i++)
+ {
+ *p++ = tohex (((value >> 28) & 0x0f));
+ value <<= 4;
+ }
+#ifdef HAVE_W32CE_SYSTEM
+ wcscpy (p, L".tmp");
+#else
+ strcpy (p, ".tmp");
+#endif
+ file = CreateFile (buffer,
+ GENERIC_READ | GENERIC_WRITE,
+ 0,
+ NULL,
+ CREATE_NEW,
+ FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE,
+ NULL);
+ if (file != INVALID_HANDLE_VALUE)
+ {
+#ifdef HAVE_W32CE_SYSTEM
+ int fd = (int)file;
+#else
+ int fd = _open_osfhandle ((long)file, 0);
+ if (fd == -1)
+ {
+ CloseHandle (file);
+ return -1;
+ }
+#endif
+ return fd;
+ }
+ Sleep (1); /* One ms as this is the granularity of GetTickCount. */
+ }
+ _set_errno (ENOENT);
+ return -1;
+#else /*!HAVE_W32_SYSTEM*/
+ FILE *fp;
+ int fp_fd;
+ int fd;
+
+ fp = NULL;
+ fd = -1;
+
+ fp = tmpfile ();
+ if (! fp)
+ goto out;
+
+ fp_fd = fileno (fp);
+ fd = dup (fp_fd);
+
+ out:
+
+ if (fp)
+ fclose (fp);
+
+ return fd;
+#endif /*!HAVE_W32_SYSTEM*/
+}
+
+estream_t
+_gpgrt_tmpfile (void)
+{
+ unsigned int modeflags;
+ int create_called = 0;
+ estream_t stream = NULL;
+ void *cookie = NULL;
+ int err;
+ int fd;
+ es_syshd_t syshd;
+
+ modeflags = O_RDWR | O_TRUNC | O_CREAT;
+
+ fd = tmpfd ();
+ if (fd == -1)
+ {
+ err = -1;
+ goto out;
+ }
+
+ err = func_fd_create (&cookie, fd, modeflags, 0);
+ if (err)
+ goto out;
+
+ syshd.type = ES_SYSHD_FD;
+ syshd.u.fd = fd;
+ create_called = 1;
+ err = create_stream (&stream, cookie, &syshd,
+ BACKEND_FD, estream_functions_fd,
+ modeflags, 0, 0);
+
+ out:
+ if (err)
+ {
+ if (create_called)
+ func_fd_destroy (cookie);
+ else if (fd != -1)
+ close (fd);
+ stream = NULL;
+ }
+
+ return stream;
+}
+
+
+int
+_gpgrt_setvbuf (estream_t _GPGRT__RESTRICT stream,
+ char *_GPGRT__RESTRICT buf, int type, size_t size)
+{
+ int err;
+
+ if ((type == _IOFBF || type == _IOLBF || type == _IONBF)
+ && (!buf || size || type == _IONBF))
+ {
+ lock_stream (stream);
+ err = es_set_buffering (stream, buf, type, size);
+ unlock_stream (stream);
+ }
+ else
+ {
+ _set_errno (EINVAL);
+ err = -1;
+ }
+
+ return err;
+}
+
+
+/* Put a stream into binary mode. This is only needed for the
+ standard streams if they are to be used in a binary way. On Unix
+ systems it is never needed but MSDOS based systems require such a
+ call. It needs to be called before any I/O is done on STREAM. */
+void
+_gpgrt_set_binary (estream_t stream)
+{
+ lock_stream (stream);
+ if (!(stream->intern->modeflags & O_BINARY))
+ {
+ stream->intern->modeflags |= O_BINARY;
+#ifdef HAVE_DOSISH_SYSTEM
+ if (stream->intern->func_read == func_fd_read)
+ {
+ estream_cookie_fd_t fd_cookie = stream->intern->cookie;
+
+ if (!IS_INVALID_FD (fd_cookie->fd))
+ setmode (fd_cookie->fd, O_BINARY);
+ }
+ else if (stream->intern->func_read == func_fp_read)
+ {
+ estream_cookie_fp_t fp_cookie = stream->intern->cookie;
+
+ if (fp_cookie->fp)
+ setmode (fileno (fp_cookie->fp), O_BINARY);
+ }
+#endif
+ }
+ unlock_stream (stream);
+}
+
+
+/* Set non-blocking mode for STREAM. Use true for ONOFF to enable and
+ false to disable non-blocking mode. Returns 0 on success or -1 on
+ error and sets ERRNO. Note that not all backends support
+ non-blocking mode.
+
+ In non-blocking mode a system call will not block but return an
+ error and set errno to EAGAIN. The estream API always uses EAGAIN
+ and not EWOULDBLOCK. If a buffered function like es_fgetc() or
+ es_fgets() returns an error and both, feof() and ferror() return
+ false the caller may assume that the error condition was EAGAIN.
+
+ Switching back from non-blocking to blocking may raise problems
+ with buffering, thus care should be taken. Although read+write
+ sockets are supported in theory, switching from write to read may
+ result into problems because estream may first flush the write
+ buffers and there is no way to handle that non-blocking (EAGAIN)
+ case. Explicit flushing should thus be done before before
+ switching to read. */
+int
+_gpgrt_set_nonblock (estream_t stream, int onoff)
+{
+ cookie_ioctl_function_t func_ioctl;
+ int ret;
+
+ lock_stream (stream);
+ func_ioctl = stream->intern->func_ioctl;
+ if (!func_ioctl)
+ {
+ _set_errno (EOPNOTSUPP);
+ ret = -1;
+ }
+ else
+ {
+ unsigned int save_flags = stream->intern->modeflags;
+
+ if (onoff)
+ stream->intern->modeflags |= O_NONBLOCK;
+ else
+ stream->intern->modeflags &= ~O_NONBLOCK;
+
+ ret = func_ioctl (stream->intern->cookie, COOKIE_IOCTL_NONBLOCK,
+ onoff?"":NULL, NULL);
+ if (ret)
+ stream->intern->modeflags = save_flags;
+ }
+ unlock_stream (stream);
+ return ret;
+}
+
+
+/* Return true if STREAM is in non-blocking mode. */
+int
+_gpgrt_get_nonblock (estream_t stream)
+{
+ int ret;
+
+ lock_stream (stream);
+ ret = !!(stream->intern->modeflags & O_NONBLOCK);
+ unlock_stream (stream);
+ return ret;
+}
+
+
+/* A version of poll(2) working on estream handles. Note that not all
+ estream types work with this function. In contrast to the standard
+ poll function the gpgrt_poll_t object uses a set of bit flags
+ instead of the EVENTS and REVENTS members. An item with the IGNORE
+ flag set is entirely ignored. The TIMEOUT values is given in
+ milliseconds, a value of -1 waits indefinitely, and a value of 0
+ returns immediately.
+
+ A positive return value gives the number of fds with new
+ information. A return value of 0 indicates a timeout and -1
+ indicates an error in which case ERRNO is set. */
+int
+_gpgrt_poll (gpgrt_poll_t *fds, unsigned int nfds, int timeout)
+{
+ gpgrt_poll_t *item;
+ int count = 0;
+ int idx;
+#ifndef HAVE_W32_SYSTEM
+ fd_set readfds, writefds, exceptfds;
+ int any_readfd, any_writefd, any_exceptfd;
+ int max_fd;
+ int fd, ret, any;
+#endif /*HAVE_W32_SYSTEM*/
+
+ trace (("enter: nfds=%u timeout=%d", nfds, timeout));
+
+ if (!fds)
+ {
+ _set_errno (EINVAL);
+ count = -1;
+ goto leave;
+ }
+
+ /* Clear all response fields (even for ignored items). */
+ for (item = fds, idx = 0; idx < nfds; item++, idx++)
+ {
+ item->got_read = 0;
+ item->got_write = 0;
+ item->got_oob = 0;
+ item->got_rdhup = 0;
+ item->got_err = 0;
+ item->got_hup = 0;
+ item->got_nval = 0;
+ }
+
+ /* Check for pending reads. */
+ for (item = fds, idx = 0; idx < nfds; item++, idx++)
+ {
+ if (item->ignore)
+ continue;
+ if (!item->want_read)
+ continue;
+ if (_gpgrt__pending (item->stream))
+ {
+ item->got_read = 1;
+ count++;
+ }
+ }
+
+ /* Check for space in the write buffers. */
+ for (item = fds, idx = 0; idx < nfds; item++, idx++)
+ {
+ if (item->ignore)
+ continue;
+ if (!item->want_write)
+ continue;
+ /* FIXME */
+ }
+
+ /* Now do the real select. */
+#ifdef HAVE_W32_SYSTEM
+
+ count = _gpgrt_w32_poll (fds, nfds, timeout);
+
+#else /*!HAVE_W32_SYSTEM*/
+
+ any_readfd = any_writefd = any_exceptfd = 0;
+ max_fd = 0;
+ for (item = fds, idx = 0; idx < nfds; item++, idx++)
+ {
+ if (item->ignore)
+ continue;
+ fd = _gpgrt_fileno (item->stream);
+ if (fd == -1)
+ continue; /* Stream does not support polling. */
+
+ if (item->want_read)
+ {
+ if (!any_readfd)
+ {
+ FD_ZERO (&readfds);
+ any_readfd = 1;
+ }
+ FD_SET (fd, &readfds);
+ if (fd > max_fd)
+ max_fd = fd;
+ }
+ if (item->want_write)
+ {
+ if (!any_writefd)
+ {
+ FD_ZERO (&writefds);
+ any_writefd = 1;
+ }
+ FD_SET (fd, &writefds);
+ if (fd > max_fd)
+ max_fd = fd;
+ }
+ if (item->want_oob)
+ {
+ if (!any_exceptfd)
+ {
+ FD_ZERO (&exceptfds);
+ any_exceptfd = 1;
+ }
+ FD_SET (fd, &exceptfds);
+ if (fd > max_fd)
+ max_fd = fd;
+ }
+ }
+
+ if (pre_syscall_func)
+ pre_syscall_func ();
+ do
+ {
+ struct timeval timeout_val;
+
+ timeout_val.tv_sec = timeout / 1000;
+ timeout_val.tv_usec = (timeout % 1000) * 1000;
+ ret = select (max_fd+1,
+ any_readfd? &readfds : NULL,
+ any_writefd? &writefds : NULL,
+ any_exceptfd? &exceptfds : NULL,
+ timeout == -1 ? NULL : &timeout_val);
+ }
+ while (ret == -1 && errno == EINTR);
+ if (post_syscall_func)
+ post_syscall_func ();
+
+ if (ret == -1)
+ {
+ trace_errno (1, ("select failed: "));
+ count = -1;
+ goto leave;
+ }
+ if (!ret)
+ {
+ /* Timeout. Note that in this case we can't return got_err for
+ * an invalid stream. */
+ count = 0;
+ goto leave;
+ }
+
+ for (item = fds, idx = 0; idx < nfds; item++, idx++)
+ {
+ if (item->ignore)
+ continue;
+ fd = _gpgrt_fileno (item->stream);
+ if (fd == -1)
+ {
+ item->got_err = 1; /* Stream does not support polling. */
+ count++;
+ continue;
+ }
+
+ any = 0;
+ if (item->stream->intern->indicators.hup)
+ {
+ item->got_hup = 1;
+ any = 1;
+ }
+ if (item->want_read && FD_ISSET (fd, &readfds))
+ {
+ item->got_read = 1;
+ any = 1;
+ }
+ if (item->want_write && FD_ISSET (fd, &writefds))
+ {
+ item->got_write = 1;
+ any = 1;
+ }
+ if (item->want_oob && FD_ISSET (fd, &exceptfds))
+ {
+ item->got_oob = 1;
+ any = 1;
+ }
+
+ if (any)
+ count++;
+ }
+#endif /*!HAVE_W32_SYSTEM*/
+
+ leave:
+#ifdef ENABLE_TRACING
+ trace (("leave: count=%d", count));
+ if (count > 0)
+ {
+ for (item = fds, idx = 0; idx < nfds; item++, idx++)
+ {
+ trace ((" %3d %c%c%c%c%c %c%c%c%c%c%c%c",
+ idx,
+ fds[idx].want_read? 'r':'-',
+ fds[idx].want_write? 'w':'-',
+ fds[idx].want_oob? 'o':'-',
+ fds[idx].want_rdhup? 'h':'-',
+ fds[idx].ignore? 'i':'-',
+ fds[idx].got_read? 'r':'-',
+ fds[idx].got_write? 'w':'-',
+ fds[idx].got_oob? 'o':'-',
+ fds[idx].got_rdhup? 'h':'-',
+ fds[idx].got_hup? 'H':'-',
+ fds[idx].got_err? 'e':'-',
+ fds[idx].got_nval? 'n':'-'
+ ));
+ }
+ }
+#endif /*ENABLE_TRACING*/
+ return count;
+}
+
+
+void
+_gpgrt_opaque_set (estream_t stream, void *opaque)
+{
+ lock_stream (stream);
+ es_opaque_ctrl (stream, opaque, NULL);
+ unlock_stream (stream);
+}
+
+
+void *
+_gpgrt_opaque_get (estream_t stream)
+{
+ void *opaque;
+
+ lock_stream (stream);
+ es_opaque_ctrl (stream, NULL, &opaque);
+ unlock_stream (stream);
+
+ return opaque;
+}
+
+
+static void
+fname_set_internal (estream_t stream, const char *fname, int quote)
+{
+ if (stream->intern->printable_fname
+ && !stream->intern->printable_fname_inuse)
+ {
+ mem_free (stream->intern->printable_fname);
+ stream->intern->printable_fname = NULL;
+ }
+ if (stream->intern->printable_fname)
+ return; /* Can't change because it is in use. */
+
+ if (*fname != '[')
+ quote = 0;
+ else
+ quote = !!quote;
+
+ stream->intern->printable_fname = mem_alloc (strlen (fname) + quote + 1);
+ if (quote)
+ stream->intern->printable_fname[0] = '\\';
+ strcpy (stream->intern->printable_fname+quote, fname);
+}
+
+
+/* Set the filename attribute of STREAM. There is no error return.
+ as long as STREAM is valid. This function is called internally by
+ functions which open a filename. */
+void
+_gpgrt_fname_set (estream_t stream, const char *fname)
+{
+ if (fname)
+ {
+ lock_stream (stream);
+ fname_set_internal (stream, fname, 1);
+ unlock_stream (stream);
+ }
+}
+
+
+/* Return the filename attribute of STREAM. In case no filename has
+ been set, "[?]" will be returned. The returned file name is valid
+ as long as STREAM is valid. */
+const char *
+_gpgrt_fname_get (estream_t stream)
+{
+ const char *fname;
+
+ lock_stream (stream);
+ fname = stream->intern->printable_fname;
+ if (fname)
+ stream->intern->printable_fname_inuse = 1;
+ unlock_stream (stream);
+ if (!fname)
+ fname = "[?]";
+ return fname;
+}
+
+
+
+/* Print a BUFFER to STREAM while replacing all control characters and
+ the characters in DELIMITERS by standard C escape sequences.
+ Returns 0 on success or -1 on error. If BYTES_WRITTEN is not NULL
+ the number of bytes actually written are stored at this
+ address. */
+int
+_gpgrt_write_sanitized (estream_t _GPGRT__RESTRICT stream,
+ const void * _GPGRT__RESTRICT buffer, size_t length,
+ const char * delimiters,
+ size_t * _GPGRT__RESTRICT bytes_written)
+{
+ const unsigned char *p = buffer;
+ size_t count = 0;
+ int ret;
+
+ lock_stream (stream);
+ for (; length; length--, p++, count++)
+ {
+ if (*p < 0x20
+ || *p == 0x7f
+ || (delimiters
+ && (strchr (delimiters, *p) || *p == '\\')))
+ {
+ _gpgrt_putc_unlocked ('\\', stream);
+ count++;
+ if (*p == '\n')
+ {
+ _gpgrt_putc_unlocked ('n', stream);
+ count++;
+ }
+ else if (*p == '\r')
+ {
+ _gpgrt_putc_unlocked ('r', stream);
+ count++;
+ }
+ else if (*p == '\f')
+ {
+ _gpgrt_putc_unlocked ('f', stream);
+ count++;
+ }
+ else if (*p == '\v')
+ {
+ _gpgrt_putc_unlocked ('v', stream);
+ count++;
+ }
+ else if (*p == '\b')
+ {
+ _gpgrt_putc_unlocked ('b', stream);
+ count++;
+ }
+ else if (!*p)
+ {
+ _gpgrt_putc_unlocked('0', stream);
+ count++;
+ }
+ else
+ {
+ _gpgrt_fprintf_unlocked (stream, "x%02x", *p);
+ count += 3;
+ }
+ }
+ else
+ {
+ _gpgrt_putc_unlocked (*p, stream);
+ count++;
+ }
+ }
+
+ if (bytes_written)
+ *bytes_written = count;
+ ret = _gpgrt_ferror_unlocked (stream)? -1 : 0;
+ unlock_stream (stream);
+
+ return ret;
+}
+
+
+/* Write LENGTH bytes of BUFFER to STREAM as a hex encoded string.
+ RESERVED must be 0. Returns 0 on success or -1 on error. If
+ BYTES_WRITTEN is not NULL the number of bytes actually written are
+ stored at this address. */
+int
+_gpgrt_write_hexstring (estream_t _GPGRT__RESTRICT stream,
+ const void *_GPGRT__RESTRICT buffer, size_t length,
+ int reserved, size_t *_GPGRT__RESTRICT bytes_written )
+{
+ int ret;
+ const unsigned char *s;
+ size_t count = 0;
+
+ (void)reserved;
+
+#define tohex(n) ((n) < 10 ? ((n) + '0') : (((n) - 10) + 'A'))
+
+ if (!length)
+ return 0;
+
+ lock_stream (stream);
+
+ for (s = buffer; length; s++, length--)
+ {
+ _gpgrt_putc_unlocked ( tohex ((*s>>4)&15), stream);
+ _gpgrt_putc_unlocked ( tohex (*s&15), stream);
+ count += 2;
+ }
+
+ if (bytes_written)
+ *bytes_written = count;
+ ret = _gpgrt_ferror_unlocked (stream)? -1 : 0;
+
+ unlock_stream (stream);
+
+ return ret;
+
+#undef tohex
+}
diff --git a/src/estream.h b/src/estream.h
new file mode 100644
index 0000000..2f2b11e
--- /dev/null
+++ b/src/estream.h
@@ -0,0 +1,30 @@
+/* gpgrt-int.h - Internal definitions
+ * Copyright (C) 2014 g10 Code GmbH
+ *
+ * This file is part of libgpg-error.
+ *
+ * libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * libgpg-error is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef ESTREAM_H
+#define ESTREAM_H
+
+#include "gpg-error.h"
+
+/* Local prototypes for estream. */
+int _gpgrt_estream_init (void);
+
+
+
+#endif /*ESTREAM_H*/
diff --git a/src/gen-posix-lock-obj.c b/src/gen-posix-lock-obj.c
new file mode 100644
index 0000000..e6f33ae
--- /dev/null
+++ b/src/gen-posix-lock-obj.c
@@ -0,0 +1,175 @@
+/* gen-posix-lock-obj.c - Build tool to construct the lock object.
+ Copyright (C) 2014 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_W32_SYSTEM
+# error This module may not be build for Windows.
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+#ifdef USE_POSIX_THREADS
+# include <pthread.h>
+#endif
+
+#include "posix-lock-obj.h"
+
+#define PGM "gen-posix-lock-obj"
+
+/* Check that configure did its job. */
+#ifdef USE_POSIX_THREADS
+#if SIZEOF_PTHREAD_MUTEX_T < 4
+# error sizeof pthread_mutex_t is not known.
+#endif
+#endif
+
+/* Special requirements for certain platforms. */
+# define USE_LONG_DOUBLE_FOR_ALIGNMENT 0
+#if defined(__sun) && !defined (__LP64__) && !defined(_LP64)
+/* Solaris on 32-bit architecture. */
+# define USE_DOUBLE_FOR_ALIGNMENT 1
+#else
+# define USE_DOUBLE_FOR_ALIGNMENT 0
+#endif
+#if defined(__hppa__)
+# define USE_16BYTE_ALIGNMENT 1
+#else
+# define USE_16BYTE_ALIGNMENT 0
+#endif
+
+#if USE_16BYTE_ALIGNMENT && !HAVE_GCC_ATTRIBUTE_ALIGNED
+# error compiler is not able to enforce a 16 byte alignment
+#endif
+
+#ifdef USE_POSIX_THREADS
+static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
+#endif
+
+int
+main (void)
+{
+#ifdef USE_POSIX_THREADS
+ unsigned char *p;
+ int i;
+#endif
+ struct {
+ long vers;
+#ifdef USE_POSIX_THREADS
+ pthread_mutex_t mtx;
+#endif
+ } dummyobj;
+
+
+#ifdef USE_POSIX_THREADS
+ if (sizeof mtx != SIZEOF_PTHREAD_MUTEX_T)
+ {
+ fprintf (stderr, PGM ": pthread_mutex_t mismatch\n");
+ exit (1);
+ }
+#endif /*USE_POSIX_THREADS*/
+
+ if (sizeof (dummyobj) != sizeof (_gpgrt_lock_t))
+ {
+ fprintf (stderr, PGM ": internal and external lock object mismatch\n");
+ exit (1);
+ }
+
+ printf ("## lock-obj-pub.%s.h%s\n"
+ "## File created by " PGM " - DO NOT EDIT\n"
+ "## To be included by mkheader into gpg-error.h\n"
+ "\n",
+ HOST_TRIPLET_STRING,
+#ifdef USE_POSIX_THREADS
+ ""
+#else
+ " - NO LOCK SUPPORT"
+#endif
+ );
+
+#ifdef USE_POSIX_THREADS
+
+ /* To force a probably suitable alignment of the structure we use a
+ union and include a long and a pointer to a long. */
+ printf ("typedef struct\n"
+ "{\n"
+ " long _vers;\n"
+ " union {\n"
+ " volatile char _priv[%d];\n"
+ "%s"
+ " long _x_align;\n"
+ " long *_xp_align;\n"
+ " } u;\n"
+ "} gpgrt_lock_t;\n"
+ "\n"
+ "#define GPGRT_LOCK_INITIALIZER {%d,{{",
+ SIZEOF_PTHREAD_MUTEX_T,
+# if USE_16BYTE_ALIGNMENT
+ " int _x16_align __attribute__ ((aligned (16)));\n",
+# elif USE_DOUBLE_FOR_ALIGNMENT
+ " double _xd_align;\n",
+# elif USE_LONG_DOUBLE_FOR_ALIGNMENT
+ " long double _xld_align;\n",
+# else
+ "",
+# endif
+ LOCK_ABI_VERSION);
+ p = (unsigned char *)&mtx;
+ for (i=0; i < sizeof mtx; i++)
+ {
+ if (i && !(i % 8))
+ printf (" \\\n%*s", 36, "");
+ printf ("%u", p[i]);
+ if (i < sizeof mtx - 1)
+ putchar (',');
+ }
+ fputs ("}}}\n", stdout);
+
+#else /*!USE_POSIX_THREADS*/
+
+ printf ("/* Dummy object - no locking available. */\n"
+ "typedef struct\n"
+ "{\n"
+ " long _vers;\n"
+ "} gpgrt_lock_t;\n"
+ "\n"
+ "#define GPGRT_LOCK_INITIALIZER {%d}\n",
+ LOCK_ABI_VERSION);
+
+#endif /*!USE_POSIX_THREADS*/
+
+ fputs ("##\n"
+ "## Loc" "al Variables:\n"
+ "## mode: c\n"
+ "## buffer-read-only: t\n"
+ "## End:\n"
+ "##\n", stdout);
+
+ if (ferror (stdout))
+ {
+ fprintf (stderr, PGM ": error writing to stdout: %s\n", strerror (errno));
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/src/gen-w32-lock-obj.c b/src/gen-w32-lock-obj.c
new file mode 100644
index 0000000..f8da67f
--- /dev/null
+++ b/src/gen-w32-lock-obj.c
@@ -0,0 +1,55 @@
+/* gen-w32-lock-obj.c - Build tool to get the size of the lock object.
+ Copyright (C) 2014 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifndef HAVE_W32_SYSTEM
+# error This module may only be build for Windows.
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <windows.h>
+
+#include "w32-lock-obj.h"
+
+
+int
+main (void)
+{
+ _gpgrt_lock_t lk;
+ unsigned char *p;
+ int i;
+
+ printf ("sizeof CRITICAL_SECTION = %u\n", (int)sizeof (CRITICAL_SECTION));
+ printf ("sizeof _gpgrt_lock_t = %u\n", (int)sizeof lk);
+
+ memset (&lk, 0, sizeof lk);
+ lk.vers = LOCK_ABI_VERSION;
+ lk.started = -1;
+ printf ("#define GPGRT_LOCK_INITIALIZER {");
+ p = (unsigned char *)&lk;
+ for (i=0; i < sizeof lk - 1; i++)
+ printf ("%u,", p[i]);
+ printf ("%u}\n", p[sizeof(lk)-1]);
+
+ return 0;
+}
diff --git a/src/gettext.h b/src/gettext.h
new file mode 100644
index 0000000..aba29db
--- /dev/null
+++ b/src/gettext.h
@@ -0,0 +1,76 @@
+/* Convenience header for conditional use of GNU <libintl.h>.
+ Copyright (C) 1995-1998, 2000-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. */
+
+#ifndef _LIBGETTEXT_H
+#define _LIBGETTEXT_H 1
+
+/* NLS can be disabled through the configure --disable-nls option. */
+#if ENABLE_NLS
+
+#if HAVE_W32_SYSTEM
+ /* We have a gettext implementation in gpg-error.h which get
+ included anyway. */
+#else /*!HAVE_W32_SYSTEM*/
+ /* Get declarations of GNU message catalog functions. */
+# include <libintl.h>
+#endif /*!HAVE_W32_SYSTEM*/
+
+#else /*!ENABLE_NLS*/
+
+/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
+ chokes if dcgettext is defined as a macro. So include it now, to make
+ later inclusions of <locale.h> a NOP. We don't include <libintl.h>
+ as well because people using "gettext.h" will not include <libintl.h>,
+ and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
+ is OK. */
+#if defined(__sun)
+# include <locale.h>
+#endif
+
+/* Disabled NLS.
+ The casts to 'const char *' serve the purpose of producing warnings
+ for invalid uses of the value returned from these functions.
+ On pre-ANSI systems without 'const', the config.h file is supposed to
+ contain "#define const". */
+# define gettext(Msgid) ((const char *) (Msgid))
+# define dgettext(Domainname, Msgid) ((const char *) (Msgid))
+# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
+# define ngettext(Msgid1, Msgid2, N) \
+ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
+# define dngettext(Domainname, Msgid1, Msgid2, N) \
+ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
+# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
+ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
+# define textdomain(Domainname) ((const char *) (Domainname))
+# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
+# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
+
+#endif /*!ENABLE_NLS*/
+
+/* A pseudo function call that serves as a marker for the automated
+ extraction of messages, but does not call gettext(). The run-time
+ translation is done at a different place in the code.
+ The argument, String, should be a literal string. Concatenated strings
+ and other string expressions won't work.
+ The macro's expansion is not parenthesized, so that it is suitable as
+ initializer for static 'char[]' or 'const char[]' variables. */
+#define gettext_noop(String) String
+
+
+
+#endif /* _LIBGETTEXT_H */
diff --git a/src/gpg-error-config.in b/src/gpg-error-config.in
new file mode 100644
index 0000000..bc1c583
--- /dev/null
+++ b/src/gpg-error-config.in
@@ -0,0 +1,102 @@
+#!/bin/sh
+# Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This file 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.
+
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+includedir=@includedir@
+libdir=@libdir@
+isubdirafter="@GPG_ERROR_CONFIG_ISUBDIRAFTER@"
+
+output=""
+mt=no
+
+usage()
+{
+ cat <<EOF
+Usage: gpg-error-config [OPTIONS]
+Options:
+ [--mt] (must be the first option)
+ [--prefix]
+ [--exec-prefix]
+ [--version]
+ [--libs]
+ [--cflags]
+EOF
+ exit $1
+}
+
+if test $# -eq 0; then
+ usage 1 1>&2
+fi
+
+while test $# -gt 0; do
+ case "$1" in
+ -*=*)
+ optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
+ ;;
+ *)
+ optarg=
+ ;;
+ esac
+
+ case $1 in
+ --mt)
+ mt=yes
+ ;;
+ --prefix)
+ output="$output $prefix"
+ ;;
+ --exec-prefix)
+ output="$output $exec_prefix"
+ ;;
+ --version)
+ echo "@PACKAGE_VERSION@"
+ exit 0
+ ;;
+ --cflags)
+ if test "x$includedir" != "x/usr/include" -a "x$includedir" != "x/include"; then
+ output="$output -I$includedir"
+ fi
+ # Note: -idirafter is a gcc extension. It is only used on
+ # systems where gcc is the only compiler we support.
+ for i in $isubdirafter; do
+ output="$output -idirafter ${includedir}/${i}"
+ done
+ output="$output @GPG_ERROR_CONFIG_CFLAGS@"
+ if test $mt = yes ; then
+ output="$output @GPG_ERROR_CONFIG_MT_CFLAGS@"
+ fi
+ ;;
+ --libs)
+ case "$libdir" in
+ /usr/lib|/usr/lib64|/lib|/lib64) ;;
+ *)
+ output="$output -L$libdir"
+ ;;
+ esac
+ output="$output @GPG_ERROR_CONFIG_LIBS@"
+ if test $mt = yes ; then
+ output="$output @GPG_ERROR_CONFIG_MT_LIBS@"
+ fi
+ ;;
+ --host)
+ echo "@GPG_ERROR_CONFIG_HOST@"
+ exit 0
+ ;;
+ *)
+ usage 1 1>&2
+ ;;
+ esac
+ shift
+done
+
+echo $output
diff --git a/src/gpg-error.c b/src/gpg-error.c
new file mode 100644
index 0000000..f890883
--- /dev/null
+++ b/src/gpg-error.c
@@ -0,0 +1,639 @@
+/* gpg-error.c - Determining gpg-error error codes.
+ Copyright (C) 2004, 2016 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with libgpg-error; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <limits.h>
+#include <stdio.h>
+
+#ifdef HAVE_LOCALE_H
+# include <locale.h>
+#endif
+#ifdef ENABLE_NLS
+#ifdef HAVE_W32_SYSTEM
+# include "gettext.h"
+#else
+# include <libintl.h>
+#endif
+# define _(a) gettext (a)
+# ifdef gettext_noop
+# define N_(a) gettext_noop (a)
+# else
+# define N_(a) (a)
+# endif
+#else
+# define _(a) (a)
+# define N_(a) (a)
+#endif
+
+#include <gpg-error.h>
+
+
+#if HAVE_W32_SYSTEM
+/* The implementation follows below. */
+static char *get_locale_dir (void);
+static void drop_locale_dir (char *locale_dir);
+#else
+#define get_locale_dir() LOCALEDIR
+#define drop_locale_dir(dir)
+#endif
+
+static void
+i18n_init (void)
+{
+#ifdef ENABLE_NLS
+ char *locale_dir;
+
+#ifdef HAVE_LC_MESSAGES
+ setlocale (LC_TIME, "");
+ setlocale (LC_MESSAGES, "");
+#else
+# ifndef HAVE_W32_SYSTEM
+ setlocale (LC_ALL, "" );
+# endif
+#endif
+
+ /* Note that for this program we would only need the textdomain call
+ because libgpg-error already initializes itself to its locale dir
+ (via gpg_err_init or a constructor). However this is only done
+ for the static standard locale and thus if the above setlocale
+ calls select a different locale the bindtext below will do
+ something else. */
+
+ locale_dir = get_locale_dir ();
+ if (locale_dir)
+ {
+ bindtextdomain (PACKAGE, locale_dir);
+ drop_locale_dir (locale_dir);
+ }
+ textdomain (PACKAGE);
+#endif
+}
+
+
+#ifdef HAVE_W32_SYSTEM
+
+#include <windows.h>
+
+
+static char *
+get_locale_dir (void)
+{
+ static wchar_t moddir[MAX_PATH+5];
+ char *result, *p;
+ int nbytes;
+
+ if (!GetModuleFileNameW (NULL, moddir, MAX_PATH))
+ *moddir = 0;
+
+#define SLDIR "\\share\\locale"
+ if (*moddir)
+ {
+ nbytes = WideCharToMultiByte (CP_UTF8, 0, moddir, -1, NULL, 0, NULL, NULL);
+ if (nbytes < 0)
+ return NULL;
+
+ result = malloc (nbytes + strlen (SLDIR) + 1);
+ if (result)
+ {
+ nbytes = WideCharToMultiByte (CP_UTF8, 0, moddir, -1,
+ result, nbytes, NULL, NULL);
+ if (nbytes < 0)
+ {
+ free (result);
+ result = NULL;
+ }
+ else
+ {
+ p = strrchr (result, '\\');
+ if (p)
+ *p = 0;
+ /* If we are installed below "bin" strip that part and
+ use the top directory instead. */
+ p = strrchr (result, '\\');
+ if (p && !strcmp (p+1, "bin"))
+ *p = 0;
+ /* Append the static part. */
+ strcat (result, SLDIR);
+ }
+ }
+ }
+ else /* Use the old default value. */
+ {
+ result = malloc (10 + strlen (SLDIR) + 1);
+ if (result)
+ {
+ strcpy (result, "c:\\gnupg");
+ strcat (result, SLDIR);
+ }
+ }
+#undef SLDIR
+ return result;
+}
+
+
+static void
+drop_locale_dir (char *locale_dir)
+{
+ free (locale_dir);
+}
+
+#endif /* HAVE_W32_SYSTEM */
+
+
+const char *gpg_strerror_sym (gpg_error_t err);
+const char *gpg_strsource_sym (gpg_error_t err);
+
+
+static int
+get_err_from_number (char *str, gpg_error_t *err)
+{
+ unsigned long nr;
+ char *tail;
+
+ gpg_err_set_errno (0);
+ nr = strtoul (str, &tail, 0);
+ if (errno)
+ return 0;
+
+ if (nr > UINT_MAX)
+ return 0;
+
+ if (*tail)
+ {
+ unsigned long cnr = strtoul (tail + 1, &tail, 0);
+ if (errno || *tail)
+ return 0;
+
+ if (nr >= GPG_ERR_SOURCE_DIM || cnr >= GPG_ERR_CODE_DIM)
+ return 0;
+
+ nr = gpg_err_make (nr, cnr);
+ }
+
+ *err = (unsigned int) nr;
+ return 1;
+}
+
+
+static int
+get_err_from_symbol_one (char *str, gpg_error_t *err,
+ int *have_source, int *have_code)
+{
+ static const char src_prefix[] = "GPG_ERR_SOURCE_";
+ static const char code_prefix[] = "GPG_ERR_";
+
+ if (!strncasecmp (src_prefix, str, sizeof (src_prefix) - 1))
+ {
+ gpg_err_source_t src;
+
+ if (*have_source)
+ return 0;
+ *have_source = 1;
+ str += sizeof (src_prefix) - 1;
+
+ for (src = 0; src < GPG_ERR_SOURCE_DIM; src++)
+ {
+ const char *src_sym;
+
+ src_sym = gpg_strsource_sym (src << GPG_ERR_SOURCE_SHIFT);
+ if (src_sym && !strcasecmp (str, src_sym + sizeof (src_prefix) - 1))
+ {
+ *err |= src << GPG_ERR_SOURCE_SHIFT;
+ return 1;
+ }
+ }
+ }
+ else if (!strncasecmp (code_prefix, str, sizeof (code_prefix) - 1))
+ {
+ gpg_err_code_t code;
+
+ if (*have_code)
+ return 0;
+ *have_code = 1;
+ str += sizeof (code_prefix) - 1;
+
+ for (code = 0; code < GPG_ERR_CODE_DIM; code++)
+ {
+ const char *code_sym = gpg_strerror_sym (code);
+ if (code_sym
+ && !strcasecmp (str, code_sym + sizeof (code_prefix) - 1))
+ {
+ *err |= code;
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+
+static int
+get_err_from_symbol (char *str, gpg_error_t *err)
+{
+ char *str2 = str;
+ int have_source = 0;
+ int have_code = 0;
+ int ret;
+ char *saved_pos = NULL;
+ char saved_char;
+
+ *err = 0;
+ while (*str2 && ((*str2 >= 'A' && *str2 <= 'Z')
+ || (*str2 >= '0' && *str2 <= '9')
+ || *str2 == '_'))
+ str2++;
+ if (*str2)
+ {
+ saved_pos = str2;
+ saved_char = *str2;
+ *str2 = '\0';
+ str2++;
+ }
+ else
+ str2 = NULL;
+
+ ret = get_err_from_symbol_one (str, err, &have_source, &have_code);
+ if (ret && str2)
+ ret = get_err_from_symbol_one (str2, err, &have_source, &have_code);
+
+ if (saved_pos)
+ *saved_pos = saved_char;
+ return ret;
+}
+
+
+static int
+get_err_from_str_one (char *str, gpg_error_t *err,
+ int *have_source, int *have_code)
+{
+ gpg_err_source_t src;
+ gpg_err_code_t code;
+
+ for (src = 0; src < GPG_ERR_SOURCE_DIM; src++)
+ {
+ const char *src_str = gpg_strsource (src << GPG_ERR_SOURCE_SHIFT);
+ if (src_str && !strcasecmp (str, src_str))
+ {
+ if (*have_source)
+ return 0;
+
+ *have_source = 1;
+ *err |= src << GPG_ERR_SOURCE_SHIFT;
+ return 1;
+ }
+ }
+
+ for (code = 0; code < GPG_ERR_CODE_DIM; code++)
+ {
+ const char *code_str = gpg_strerror (code);
+ if (code_str && !strcasecmp (str, code_str))
+ {
+ if (*have_code)
+ return 0;
+
+ *have_code = 1;
+ *err |= code;
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+
+static int
+get_err_from_str (char *str, gpg_error_t *err)
+{
+ char *str2 = str;
+ int have_source = 0;
+ int have_code = 0;
+ int ret;
+ char *saved_pos = NULL;
+ char saved_char = 0; /* (avoid warning) */
+
+ *err = 0;
+ ret = get_err_from_str_one (str, err, &have_source, &have_code);
+ if (ret)
+ return ret;
+
+ while (*str2 && ((*str2 >= 'A' && *str2 <= 'Z')
+ || (*str2 >= 'a' && *str2 <= 'z')
+ || (*str2 >= '0' && *str2 <= '9')
+ || *str2 == '_'))
+ str2++;
+ if (*str2)
+ {
+ saved_pos = str2;
+ saved_char = *str2;
+ *((char *) str2) = '\0';
+ str2++;
+ while (*str2 && !((*str2 >= 'A' && *str2 <= 'Z')
+ || (*str2 >= 'a' && *str2 <= 'z')
+ || (*str2 >= '0' && *str2 <= '9')
+ || *str2 == '_'))
+ str2++;
+ }
+ else
+ str2 = NULL;
+
+ ret = get_err_from_str_one (str, err, &have_source, &have_code);
+ if (ret && str2)
+ ret = get_err_from_str_one (str2, err, &have_source, &have_code);
+
+ if (saved_pos)
+ *saved_pos = saved_char;
+ return ret;
+}
+
+
+static void
+print_desc (const char *symbol)
+{
+ static int initialized;
+ static FILE *fp;
+ char line[512];
+ char *p;
+ int indesc = 0;
+ int blanklines = 0;
+ int last_was_keyword = 0;
+
+ if (!symbol)
+ return;
+
+ if (!initialized)
+ {
+ initialized = 1;
+ fp = fopen (PKGDATADIR "/errorref.txt", "r");
+ }
+ if (!fp)
+ return;
+ rewind (fp);
+ while (fgets (line, sizeof line, fp))
+ {
+ if (*line == '#')
+ continue;
+ if (*line && line[strlen(line)-1] == '\n')
+ line[strlen(line)-1] = 0;
+
+ if (!strncmp (line, "GPG_ERR_", 8))
+ {
+ if (indesc == 1 && last_was_keyword)
+ continue; /* Skip keywords immediately following a matched
+ * keyword. */
+ last_was_keyword = 1;
+
+ indesc = 0;
+ p = strchr (line, ' ');
+ if (!p)
+ continue;
+ *p = 0;
+ if (!strcmp (line, symbol))
+ {
+ indesc = 1;
+ continue; /* Skip this line. */
+ }
+ }
+ else
+ last_was_keyword = 0;
+ if (!indesc)
+ continue;
+ if (indesc == 1 && !*line)
+ continue; /* Skip leading empty lines in a description. */
+ if (indesc == 1)
+ putchar ('\n'); /* One leading empty line. */
+ indesc = 2;
+ if (!*line)
+ {
+ blanklines++;
+ continue;
+ }
+ for (; blanklines; blanklines--)
+ putchar ('\n');
+ printf ("%s\n", line);
+ }
+ putchar ('\n'); /* One trailing blank line. */
+}
+
+
+
+
+
+static int
+show_usage (const char *name)
+{
+ if (name)
+ {
+ fprintf (stderr, _("Usage: %s GPG-ERROR [...]\n"),
+ strrchr (name,'/')? (strrchr (name, '/')+1): name);
+ exit (1);
+ }
+
+ fputs ("gpg-error (" PACKAGE_NAME ") " PACKAGE_VERSION "\n", stdout);
+ fputs ("Options:\n"
+ " --version Print version\n"
+ " --lib-version Print library version\n"
+ " --help Print this help\n"
+ " --list Print all error codes\n"
+ " --defines Print all error codes as #define lines\n"
+ " --desc Print with error description\n"
+ , stdout);
+ exit (0);
+}
+
+
+
+int
+main (int argc, char *argv[])
+{
+ const char *pgmname = argv[0];
+ int last_argc = -1;
+ int i;
+ int listmode = 0;
+ int desc = 0;
+ const char *source_sym;
+ const char *error_sym;
+ gpg_error_t err;
+
+ gpgrt_init ();
+ i18n_init ();
+
+
+ if (argc)
+ {
+ argc--; argv++;
+ }
+ while (argc && last_argc != argc )
+ {
+ last_argc = argc;
+ if (!strcmp (*argv, "--"))
+ {
+ argc--; argv++;
+ break;
+ }
+ else if (!strcmp (*argv, "--version"))
+ {
+ fputs ("gpg-error (" PACKAGE_NAME ") " PACKAGE_VERSION "\n", stdout);
+ exit (0);
+ }
+ else if (!strcmp (*argv, "--help"))
+ {
+ show_usage (NULL);
+ }
+ else if (!strcmp (*argv, "--lib-version"))
+ {
+ argc--; argv++;
+ printf ("Version from header: %s (0x%06x)\n",
+ GPG_ERROR_VERSION, GPG_ERROR_VERSION_NUMBER);
+ printf ("Version from binary: %s\n", gpg_error_check_version (NULL));
+ printf ("Copyright blurb ...:%s\n",
+ gpg_error_check_version ("\x01\x01"));
+ exit (0);
+ }
+ else if (!strcmp (*argv, "--list"))
+ {
+ listmode = 1;
+ argc--; argv++;
+ }
+ else if (!strcmp (*argv, "--defines"))
+ {
+ listmode = 2;
+ argc--; argv++;
+ }
+ else if (!strcmp (*argv, "--desc"))
+ {
+ desc = 1;
+ argc--; argv++;
+ }
+ else if (!strncmp (*argv, "--", 2))
+ show_usage (pgmname);
+ }
+
+ if ((argc && listmode) || (!argc && !listmode))
+ show_usage (pgmname);
+
+
+ if (listmode == 1)
+ {
+ for (i=0; i < GPG_ERR_SOURCE_DIM; i++)
+ {
+ /* We use error code 1 because gpg_err_make requires a
+ non-zero error code. */
+ err = gpg_err_make (i, 1);
+ err -= 1;
+ source_sym = gpg_strsource_sym (err);
+ if (source_sym)
+ {
+ printf ("%u = (%u, -) = (%s, -) = (%s, -)\n",
+ err, gpg_err_source (err),
+ source_sym, gpg_strsource (err));
+ if (desc)
+ print_desc (source_sym);
+ }
+ }
+ for (i=0; i < GPG_ERR_CODE_DIM; i++)
+ {
+ err = gpg_err_make (GPG_ERR_SOURCE_UNKNOWN, i);
+ error_sym = gpg_strerror_sym (err);
+ if (error_sym)
+ {
+ printf ("%u = (-, %u) = (-, %s) = (-, %s)\n",
+ err, gpg_err_code (err),
+ error_sym, gpg_strerror (err));
+ if (desc)
+ print_desc (error_sym);
+ }
+ }
+ }
+ else if (listmode == 2)
+ {
+ int n, nmax;
+
+ for (i=0, nmax=0; i < GPG_ERR_SOURCE_DIM; i++)
+ {
+ err = gpg_err_make (i, 1);
+ source_sym = gpg_strsource_sym (err);
+ if (source_sym)
+ {
+ n = strlen (source_sym);
+ if (n > nmax)
+ nmax = n;
+ }
+ }
+ for (i=0; i < GPG_ERR_SOURCE_DIM; i++)
+ {
+ err = gpg_err_make (i, 1);
+ source_sym = gpg_strsource_sym (err);
+ if (source_sym)
+ printf ("#define %-*s %3u\n", nmax,source_sym,gpg_err_source (err));
+ }
+
+
+ for (i=0, nmax = 0; i < GPG_ERR_CODE_DIM; i++)
+ {
+ err = gpg_err_make (GPG_ERR_SOURCE_UNKNOWN, i);
+ error_sym = gpg_strerror_sym (err);
+ if (error_sym)
+ {
+ n = strlen (error_sym);
+ if (n > nmax)
+ nmax = n;
+ }
+ }
+ for (i=0; i < GPG_ERR_CODE_DIM; i++)
+ {
+ err = gpg_err_make (GPG_ERR_SOURCE_UNKNOWN, i);
+ error_sym = gpg_strerror_sym (err);
+ if (error_sym)
+ printf ("#define %-*s %5u\n", nmax, error_sym, gpg_err_code (err));
+ }
+ }
+ else /* Standard mode. */
+ {
+ for (i=0; i < argc; i++)
+ {
+ if (get_err_from_number (argv[i], &err)
+ || get_err_from_symbol (argv[i], &err)
+ || get_err_from_str (argv[i], &err))
+ {
+ source_sym = gpg_strsource_sym (err);
+ error_sym = gpg_strerror_sym (err);
+
+ printf ("%u = (%u, %u) = (%s, %s) = (%s, %s)\n",
+ err, gpg_err_source (err), gpg_err_code (err),
+ source_sym ? source_sym : "-", error_sym ? error_sym:"-",
+ gpg_strsource (err), gpg_strerror (err));
+ if (desc)
+ print_desc (error_sym);
+ }
+ else
+ fprintf (stderr, _("%s: warning: could not recognize %s\n"),
+ argv[0], argv[i]);
+ }
+ }
+
+ exit (0);
+}
diff --git a/src/gpg-error.def.in b/src/gpg-error.def.in
new file mode 100644
index 0000000..ad65f8c
--- /dev/null
+++ b/src/gpg-error.def.in
@@ -0,0 +1,159 @@
+/* libgpg-error.def - Exported symbols for W32
+ * Copyright (C) 2014 g10 Code GmbH
+ *
+ * This file is part of libgpg-error.
+ *
+ * libgpg-error is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * libgpg-error is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ *
+ * Note: This file should be updated manually and the ordinals shall
+ * never be changed. Also check gpg-error.vers and visibility.h.
+ *
+ * This file needs to be pre-processed.
+ */
+
+#include <config.h>
+
+EXPORTS
+ gpg_strerror @1
+ gpg_strerror_r @2
+ gpg_strsource @3
+ gpg_err_code_from_errno @4
+ gpg_err_code_to_errno @5
+ /* @6 - Not anymore used. */
+ gpg_err_code_from_syserror @7
+ gpg_err_set_errno @8
+#ifdef HAVE_W32CE_SYSTEM
+ _gpg_w32ce_get_errno @9
+ _gpg_w32ce_strerror @10
+#endif
+#ifdef HAVE_W32_SYSTEM
+ _gpg_w32_bindtextdomain @11
+ _gpg_w32_textdomain @12
+ _gpg_w32_gettext @13
+ _gpg_w32_dgettext @14
+ _gpg_w32_dngettext @15
+ _gpg_w32_gettext_localename @16
+ _gpg_w32_gettext_use_utf8 @17
+#endif
+ /* @18 - Not anymore used. */
+ gpg_error_check_version @19
+
+ gpgrt_lock_init @20
+ gpgrt_lock_lock @21
+ gpgrt_lock_unlock @22
+ gpgrt_lock_destroy @23
+ gpgrt_yield @24
+ gpgrt_lock_trylock @25
+
+ gpgrt_set_syscall_clamp @26
+
+ gpgrt_fopen @27
+ gpgrt_mopen @28
+ gpgrt_fopenmem @29
+ gpgrt_fopenmem_init @30
+ gpgrt_fdopen @31
+ gpgrt_fdopen_nc @32
+ gpgrt_sysopen @33
+ gpgrt_sysopen_nc @34
+ gpgrt_fpopen @35
+ gpgrt_fpopen_nc @36
+ gpgrt_freopen @37
+ gpgrt_fopencookie @38
+ gpgrt_fclose @39
+ gpgrt_fclose_snatch @40
+ gpgrt_onclose @41
+ gpgrt_fileno @42
+ gpgrt_fileno_unlocked @43
+ gpgrt_syshd @44
+ gpgrt_syshd_unlocked @45
+ _gpgrt_set_std_fd @46
+ _gpgrt_get_std_stream @47
+ gpgrt_flockfile @48
+ gpgrt_ftrylockfile @49
+ gpgrt_funlockfile @50
+ gpgrt_feof @51
+ gpgrt_feof_unlocked @52
+ gpgrt_ferror @53
+ gpgrt_ferror_unlocked @54
+ gpgrt_clearerr @55
+ gpgrt_clearerr_unlocked @56
+ gpgrt_fflush @57
+ gpgrt_fseek @58
+ gpgrt_fseeko @59
+ gpgrt_ftell @60
+ gpgrt_ftello @61
+ gpgrt_rewind @62
+ gpgrt_fgetc @63
+ _gpgrt_getc_underflow @64
+ gpgrt_fputc @65
+ _gpgrt_putc_overflow @66
+ gpgrt_ungetc @67
+ gpgrt_read @68
+ gpgrt_write @69
+ gpgrt_write_sanitized @70
+ gpgrt_write_hexstring @71
+ gpgrt_fread @72
+ gpgrt_fwrite @73
+ gpgrt_fgets @74
+ gpgrt_fputs @75
+ gpgrt_fputs_unlocked @76
+ gpgrt_getline @77
+ gpgrt_read_line @78
+ gpgrt_free @79
+ gpgrt_fprintf @80
+ gpgrt_fprintf_unlocked @81
+ gpgrt_printf @82
+ gpgrt_printf_unlocked @83
+ gpgrt_vfprintf @84
+ gpgrt_vfprintf_unlocked @85
+ gpgrt_setvbuf @86
+ gpgrt_setbuf @87
+ gpgrt_set_binary @88
+ gpgrt_tmpfile @89
+ gpgrt_opaque_set @90
+ gpgrt_opaque_get @91
+ gpgrt_fname_set @92
+ gpgrt_fname_get @93
+ gpgrt_asprintf @94
+ gpgrt_vasprintf @95
+ gpgrt_bsprintf @96
+ gpgrt_vbsprintf @97
+ gpgrt_snprintf @98
+ gpgrt_vsnprintf @99
+
+ gpgrt_check_version @100
+ gpg_err_init @101
+ gpg_err_deinit @102
+ gpgrt_set_alloc_func @103
+
+ _gpgrt_pending @104
+ _gpgrt_pending_unlocked @105
+
+ gpgrt_set_nonblock @106
+ gpgrt_get_nonblock @107
+ gpgrt_poll @108
+
+#ifdef HAVE_W32_SYSTEM
+ gpgrt_w32_iconv_open @109
+ gpgrt_w32_iconv_close @110
+ gpgrt_w32_iconv @111
+#endif
+
+ gpgrt_get_syscall_clamp @112
+
+ gpgrt_b64dec_start @113
+ gpgrt_b64dec_proc @114
+ gpgrt_b64dec_finish @115
+
+;; end of file with public symbols for Windows.
diff --git a/src/gpg-error.h.in b/src/gpg-error.h.in
new file mode 100644
index 0000000..988898e
--- /dev/null
+++ b/src/gpg-error.h.in
@@ -0,0 +1,873 @@
+/* gpg-error.h or gpgrt.h - Public interface to libgpg-error. -*- c -*-
+ * Copyright (C) 2003-2004, 2010, 2013-2017 g10 Code GmbH
+ *
+ * This file is part of libgpg-error.
+ *
+ * libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * libgpg-error is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ *
+ * @configure_input@
+ */
+
+#ifndef GPG_ERROR_H
+#define GPG_ERROR_H 1
+#ifndef GPGRT_H
+#define GPGRT_H 1
+
+#include <stddef.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+/* The version string of this header. */
+#define GPG_ERROR_VERSION @version@
+#define GPGRT_VERSION @version@
+
+/* The version number of this header. */
+#define GPG_ERROR_VERSION_NUMBER @version-number@
+#define GPGRT_VERSION_NUMBER @version-number@
+
+
+#ifdef __GNUC__
+# define GPG_ERR_INLINE __inline__
+#elif defined(_MSC_VER) && _MSC_VER >= 1300
+# define GPG_ERR_INLINE __inline
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+# define GPG_ERR_INLINE inline
+#else
+# ifndef GPG_ERR_INLINE
+# define GPG_ERR_INLINE
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#if 0 /* just to make Emacs auto-indent happy */
+}
+#endif
+#endif /* __cplusplus */
+
+/* The GnuPG project consists of many components. Error codes are
+ exchanged between all components. The common error codes and their
+ user-presentable descriptions are kept into a shared library to
+ allow adding new error codes and components without recompiling any
+ of the other components. The interface will not change in a
+ backward incompatible way.
+
+ An error code together with an error source build up an error
+ value. As the error value is been passed from one component to
+ another, it preserver the information about the source and nature
+ of the error.
+
+ A component of the GnuPG project can define the following macros to
+ tune the behaviour of the library:
+
+ GPG_ERR_SOURCE_DEFAULT: Define to an error source of type
+ gpg_err_source_t to make that source the default for gpg_error().
+ Otherwise GPG_ERR_SOURCE_UNKNOWN is used as default.
+
+ GPG_ERR_ENABLE_GETTEXT_MACROS: Define to provide macros to map the
+ internal gettext API to standard names. This has only an effect on
+ Windows platforms.
+
+ GPGRT_ENABLE_ES_MACROS: Define to provide "es_" macros for the
+ estream functions.
+
+ In addition to the error codes, Libgpg-error also provides a set of
+ functions used by most GnuPG components. */
+
+
+/* The error source type gpg_err_source_t.
+
+ Where as the Poo out of a welle small
+ Taketh his firste springing and his sours.
+ --Chaucer. */
+
+/* Only use free slots, never change or reorder the existing
+ entries. */
+typedef enum
+ {
+@include:err-sources@
+ /* This is one more than the largest allowed entry. */
+ GPG_ERR_SOURCE_DIM = 128
+ } gpg_err_source_t;
+
+
+/* The error code type gpg_err_code_t. */
+
+/* Only use free slots, never change or reorder the existing
+ entries. */
+typedef enum
+ {
+@include:err-codes@
+ /* The following error codes are used to map system errors. */
+#define GPG_ERR_SYSTEM_ERROR (1 << 15)
+@include:errnos@
+ /* This is one more than the largest allowed entry. */
+ GPG_ERR_CODE_DIM = 65536
+ } gpg_err_code_t;
+
+
+/* The error value type gpg_error_t. */
+
+/* We would really like to use bit-fields in a struct, but using
+ structs as return values can cause binary compatibility issues, in
+ particular if you want to do it efficiently (also see
+ -freg-struct-return option to GCC). */
+typedef unsigned int gpg_error_t;
+
+/* We use the lowest 16 bits of gpg_error_t for error codes. The 16th
+ bit indicates system errors. */
+#define GPG_ERR_CODE_MASK (GPG_ERR_CODE_DIM - 1)
+
+/* Bits 17 to 24 are reserved. */
+
+/* We use the upper 7 bits of gpg_error_t for error sources. */
+#define GPG_ERR_SOURCE_MASK (GPG_ERR_SOURCE_DIM - 1)
+#define GPG_ERR_SOURCE_SHIFT 24
+
+/* The highest bit is reserved. It shouldn't be used to prevent
+ potential negative numbers when transmitting error values as
+ text. */
+
+
+/* GCC feature test. */
+#if __GNUC__
+# define _GPG_ERR_GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
+#else
+# define _GPG_ERR_GCC_VERSION 0
+#endif
+
+#undef _GPG_ERR_HAVE_CONSTRUCTOR
+#if _GPG_ERR_GCC_VERSION > 30100
+# define _GPG_ERR_CONSTRUCTOR __attribute__ ((__constructor__))
+# define _GPG_ERR_HAVE_CONSTRUCTOR
+#else
+# define _GPG_ERR_CONSTRUCTOR
+#endif
+
+#define GPGRT_GCC_VERSION _GPG_ERR_GCC_VERSION
+
+#if _GPG_ERR_GCC_VERSION >= 29200
+# define _GPGRT__RESTRICT __restrict__
+#else
+# define _GPGRT__RESTRICT
+#endif
+
+/* The noreturn attribute. */
+#if _GPG_ERR_GCC_VERSION >= 20500
+# define GPGRT_ATTR_NORETURN __attribute__ ((noreturn))
+#else
+# define GPGRT_ATTR_NORETURN
+#endif
+
+/* The printf attributes. */
+#if _GPG_ERR_GCC_VERSION >= 40400
+# define GPGRT_ATTR_PRINTF(f, a) \
+ __attribute__ ((format(__gnu_printf__,f,a)))
+# define GPGRT_ATTR_NR_PRINTF(f, a) \
+ __attribute__ ((noreturn, format(__gnu_printf__,f,a)))
+#elif _GPG_ERR_GCC_VERSION >= 20500
+# define GPGRT_ATTR_PRINTF(f, a) \
+ __attribute__ ((format(printf,f,a)))
+# define GPGRT_ATTR_NR_PRINTF(f, a) \
+ __attribute__ ((noreturn, format(printf,f,a)))
+#else
+# define GPGRT_ATTR_PRINTF(f, a)
+# define GPGRT_ATTR_NR_PRINTF(f, a)
+#endif
+#if _GPG_ERR_GCC_VERSION >= 20800
+# define GPGRT_ATTR_FORMAT_ARG(a) __attribute__ ((__format_arg__ (a)))
+#else
+# define GPGRT_ATTR_FORMAT_ARG(a)
+#endif
+
+/* The sentinel attribute. */
+#if _GPG_ERR_GCC_VERSION >= 40000
+# define GPGRT_ATTR_SENTINEL(a) __attribute__ ((sentinel(a)))
+#else
+# define GPGRT_ATTR_SENTINEL(a)
+#endif
+
+/* The used and unused attributes.
+ I am not sure since when the unused attribute is really supported.
+ In any case it it only needed for gcc versions which print a
+ warning. Thus let us require gcc >= 3.5. */
+#if _GPG_ERR_GCC_VERSION >= 40000
+# define GPGRT_ATTR_USED __attribute__ ((used))
+#else
+# define GPGRT_ATTR_USED
+#endif
+#if _GPG_ERR_GCC_VERSION >= 30500
+# define GPGRT_ATTR_UNUSED __attribute__ ((unused))
+#else
+# define GPGRT_ATTR_UNUSED
+#endif
+
+/* The deprecated attribute. */
+#if _GPG_ERR_GCC_VERSION >= 30100
+# define GPGRT_ATTR_DEPRECATED __attribute__ ((__deprecated__))
+#else
+# define GPGRT_ATTR_DEPRECATED
+#endif
+
+/* The pure attribute. */
+#if _GPG_ERR_GCC_VERSION >= 29600
+# define GPGRT_ATTR_PURE __attribute__ ((__pure__))
+#else
+# define GPGRT_ATTR_PURE
+#endif
+
+/* The malloc attribute. */
+#if _GPG_ERR_GCC_VERSION >= 30200
+# define GPGRT_ATTR_MALLOC __attribute__ ((__malloc__))
+#else
+# define GPGRT_ATTR_MALLOC
+#endif
+
+/* A macro defined if a GCC style __FUNCTION__ macro is available. */
+#undef GPGRT_HAVE_MACRO_FUNCTION
+#if _GPG_ERR_GCC_VERSION >= 20500
+# define GPGRT_HAVE_MACRO_FUNCTION 1
+#endif
+
+/* A macro defined if the pragma GCC push_options is available. */
+#undef GPGRT_HAVE_PRAGMA_GCC_PUSH
+#if _GPG_ERR_GCC_VERSION >= 40400
+# define GPGRT_HAVE_PRAGMA_GCC_PUSH 1
+#endif
+
+/* Detect LeakSanitizer (LSan) support for GCC and Clang based on
+ * whether AddressSanitizer (ASAN) is enabled via -fsanitize=address).
+ * Note that -fsanitize=leak just affect the linker options which
+ * cannot be detected here. In that case you have to define the
+ * GPGRT_HAVE_LEAK_SANITIZER macro manually. */
+#ifdef __GNUC__
+# ifdef __SANITIZE_ADDRESS__
+# define GPGRT_HAVE_LEAK_SANITIZER
+# elif defined(__has_feature)
+# if __has_feature(address_sanitizer)
+# define GPGRT_HAVE_LEAK_SANITIZER
+# endif
+# endif
+#endif
+
+
+/* The new name for the inline macro. */
+#define GPGRT_INLINE GPG_ERR_INLINE
+
+#ifdef GPGRT_HAVE_LEAK_SANITIZER
+# include <sanitizer/lsan_interface.h>
+#endif
+
+/* Mark heap objects as non-leaked memory. */
+static GPGRT_INLINE void
+gpgrt_annotate_leaked_object (const void *p)
+{
+#ifdef GPGRT_HAVE_LEAK_SANITIZER
+ __lsan_ignore_object(p);
+#else
+ (void)p;
+#endif
+}
+
+
+/* Initialization function. */
+
+/* Initialize the library. This function should be run early. */
+gpg_error_t gpg_err_init (void) _GPG_ERR_CONSTRUCTOR;
+
+/* If this is defined, the library is already initialized by the
+ constructor and does not need to be initialized explicitely. */
+#undef GPG_ERR_INITIALIZED
+#ifdef _GPG_ERR_HAVE_CONSTRUCTOR
+# define GPG_ERR_INITIALIZED 1
+# define gpgrt_init() do { gpg_err_init (); } while (0)
+#else
+# define gpgrt_init() do { ; } while (0)
+#endif
+
+/* See the source on how to use the deinit function; it is usually not
+ required. */
+void gpg_err_deinit (int mode);
+
+/* Register blocking system I/O clamping functions. */
+void gpgrt_set_syscall_clamp (void (*pre)(void), void (*post)(void));
+
+/* Get current I/O clamping functions. */
+void gpgrt_get_syscall_clamp (void (**r_pre)(void), void (**r_post)(void));
+
+/* Register a custom malloc/realloc/free function. */
+void gpgrt_set_alloc_func (void *(*f)(void *a, size_t n));
+
+
+
+/* Constructor and accessor functions. */
+
+/* Construct an error value from an error code and source. Within a
+ subsystem, use gpg_error. */
+static GPG_ERR_INLINE gpg_error_t
+gpg_err_make (gpg_err_source_t source, gpg_err_code_t code)
+{
+ return code == GPG_ERR_NO_ERROR ? GPG_ERR_NO_ERROR
+ : (((source & GPG_ERR_SOURCE_MASK) << GPG_ERR_SOURCE_SHIFT)
+ | (code & GPG_ERR_CODE_MASK));
+}
+
+
+/* The user should define GPG_ERR_SOURCE_DEFAULT before including this
+ file to specify a default source for gpg_error. */
+#ifndef GPG_ERR_SOURCE_DEFAULT
+#define GPG_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_UNKNOWN
+#endif
+
+static GPG_ERR_INLINE gpg_error_t
+gpg_error (gpg_err_code_t code)
+{
+ return gpg_err_make (GPG_ERR_SOURCE_DEFAULT, code);
+}
+
+
+/* Retrieve the error code from an error value. */
+static GPG_ERR_INLINE gpg_err_code_t
+gpg_err_code (gpg_error_t err)
+{
+ return (gpg_err_code_t) (err & GPG_ERR_CODE_MASK);
+}
+
+
+/* Retrieve the error source from an error value. */
+static GPG_ERR_INLINE gpg_err_source_t
+gpg_err_source (gpg_error_t err)
+{
+ return (gpg_err_source_t) ((err >> GPG_ERR_SOURCE_SHIFT)
+ & GPG_ERR_SOURCE_MASK);
+}
+
+
+/* String functions. */
+
+/* Return a pointer to a string containing a description of the error
+ code in the error value ERR. This function is not thread-safe. */
+const char *gpg_strerror (gpg_error_t err);
+
+/* Return the error string for ERR in the user-supplied buffer BUF of
+ size BUFLEN. This function is, in contrast to gpg_strerror,
+ thread-safe if a thread-safe strerror_r() function is provided by
+ the system. If the function succeeds, 0 is returned and BUF
+ contains the string describing the error. If the buffer was not
+ large enough, ERANGE is returned and BUF contains as much of the
+ beginning of the error string as fits into the buffer. */
+int gpg_strerror_r (gpg_error_t err, char *buf, size_t buflen);
+
+/* Return a pointer to a string containing a description of the error
+ source in the error value ERR. */
+const char *gpg_strsource (gpg_error_t err);
+
+
+/* Mapping of system errors (errno). */
+
+/* Retrieve the error code for the system error ERR. This returns
+ GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped (report
+ this). */
+gpg_err_code_t gpg_err_code_from_errno (int err);
+
+
+/* Retrieve the system error for the error code CODE. This returns 0
+ if CODE is not a system error code. */
+int gpg_err_code_to_errno (gpg_err_code_t code);
+
+
+/* Retrieve the error code directly from the ERRNO variable. This
+ returns GPG_ERR_UNKNOWN_ERRNO if the system error is not mapped
+ (report this) and GPG_ERR_MISSING_ERRNO if ERRNO has the value 0. */
+gpg_err_code_t gpg_err_code_from_syserror (void);
+
+
+/* Set the ERRNO variable. This function is the preferred way to set
+ ERRNO due to peculiarities on WindowsCE. */
+void gpg_err_set_errno (int err);
+
+/* Return or check the version. Both functions are identical. */
+const char *gpgrt_check_version (const char *req_version);
+const char *gpg_error_check_version (const char *req_version);
+
+/* System specific type definitions. */
+@define:gpgrt_ssize_t@
+@define:gpgrt_off_t@
+
+@include:os-add@
+
+/* Self-documenting convenience functions. */
+
+static GPG_ERR_INLINE gpg_error_t
+gpg_err_make_from_errno (gpg_err_source_t source, int err)
+{
+ return gpg_err_make (source, gpg_err_code_from_errno (err));
+}
+
+
+static GPG_ERR_INLINE gpg_error_t
+gpg_error_from_errno (int err)
+{
+ return gpg_error (gpg_err_code_from_errno (err));
+}
+
+static GPG_ERR_INLINE gpg_error_t
+gpg_error_from_syserror (void)
+{
+ return gpg_error (gpg_err_code_from_syserror ());
+}
+
+
+
+/* Lock functions. */
+
+@include:lock-obj@
+
+#define GPGRT_LOCK_DEFINE(name) \
+ static gpgrt_lock_t name = GPGRT_LOCK_INITIALIZER
+
+/* NB: If GPGRT_LOCK_DEFINE is not used, zero out the lock variable
+ before passing it to gpgrt_lock_init. */
+gpg_err_code_t gpgrt_lock_init (gpgrt_lock_t *lockhd);
+gpg_err_code_t gpgrt_lock_lock (gpgrt_lock_t *lockhd);
+gpg_err_code_t gpgrt_lock_trylock (gpgrt_lock_t *lockhd);
+gpg_err_code_t gpgrt_lock_unlock (gpgrt_lock_t *lockhd);
+gpg_err_code_t gpgrt_lock_destroy (gpgrt_lock_t *lockhd);
+
+
+
+/* Thread functions. */
+
+gpg_err_code_t gpgrt_yield (void);
+
+
+
+
+/* Estream */
+
+/* The definition of this struct is entirely private. You must not
+ use it for anything. It is only here so some functions can be
+ implemented as macros. */
+struct _gpgrt_stream_internal;
+struct _gpgrt__stream
+{
+ /* The layout of this struct must never change. It may be grown,
+ but only if all functions which access the new members are
+ versioned. */
+
+ /* Various flags. */
+ struct {
+ unsigned int magic: 16;
+ unsigned int writing: 1;
+ unsigned int reserved: 15;
+ } flags;
+
+ /* A pointer to the stream buffer. */
+ unsigned char *buffer;
+
+ /* The size of the buffer in bytes. */
+ size_t buffer_size;
+
+ /* The length of the usable data in the buffer, only valid when in
+ read mode (see flags). */
+ size_t data_len;
+
+ /* The current position of the offset pointer, valid in read and
+ write mode. */
+ size_t data_offset;
+
+ size_t data_flushed;
+ unsigned char *unread_buffer;
+ size_t unread_buffer_size;
+
+ /* The number of unread bytes. */
+ size_t unread_data_len;
+
+ /* A pointer to our internal data for this stream. */
+ struct _gpgrt_stream_internal *intern;
+};
+
+/* The opaque type for an estream. */
+typedef struct _gpgrt__stream *gpgrt_stream_t;
+#ifdef GPGRT_ENABLE_ES_MACROS
+typedef struct _gpgrt__stream *estream_t;
+#endif
+
+typedef @api_ssize_t@ (*gpgrt_cookie_read_function_t) (void *cookie,
+ void *buffer, size_t size);
+typedef @api_ssize_t@ (*gpgrt_cookie_write_function_t) (void *cookie,
+ const void *buffer,
+ size_t size);
+typedef int (*gpgrt_cookie_seek_function_t) (void *cookie,
+ gpgrt_off_t *pos, int whence);
+typedef int (*gpgrt_cookie_close_function_t) (void *cookie);
+
+struct _gpgrt_cookie_io_functions
+{
+ gpgrt_cookie_read_function_t func_read;
+ gpgrt_cookie_write_function_t func_write;
+ gpgrt_cookie_seek_function_t func_seek;
+ gpgrt_cookie_close_function_t func_close;
+};
+typedef struct _gpgrt_cookie_io_functions gpgrt_cookie_io_functions_t;
+#ifdef GPGRT_ENABLE_ES_MACROS
+typedef struct _gpgrt_cookie_io_functions es_cookie_io_functions_t;
+#define es_cookie_read_function_t gpgrt_cookie_read_function_t
+#define es_cookie_write_function_t gpgrt_cookie_read_function_t
+#define es_cookie_seek_function_t gpgrt_cookie_read_function_t
+#define es_cookie_close_function_t gpgrt_cookie_read_function_t
+#endif
+
+enum gpgrt_syshd_types
+ {
+ GPGRT_SYSHD_NONE = 0, /* No system handle available. */
+ GPGRT_SYSHD_FD = 1, /* A file descriptor as returned by open(). */
+ GPGRT_SYSHD_SOCK = 2, /* A socket as returned by socket(). */
+ GPGRT_SYSHD_RVID = 3, /* A rendezvous id (see libassuan's gpgcedev.c). */
+ GPGRT_SYSHD_HANDLE = 4 /* A HANDLE object (Windows). */
+ };
+
+struct _gpgrt_syshd
+{
+ enum gpgrt_syshd_types type;
+ union {
+ int fd;
+ int sock;
+ int rvid;
+ void *handle;
+ } u;
+};
+typedef struct _gpgrt_syshd gpgrt_syshd_t;
+#ifdef GPGRT_ENABLE_ES_MACROS
+typedef struct _gpgrt_syshd es_syshd_t;
+#define ES_SYSHD_NONE GPGRT_SYSHD_NONE
+#define ES_SYSHD_FD GPGRT_SYSHD_FD
+#define ES_SYSHD_SOCK GPGRT_SYSHD_SOCK
+#define ES_SYSHD_RVID GPGRT_SYSHD_RVID
+#define ES_SYSHD_HANDLE GPGRT_SYSHD_HANDLE
+#endif
+
+/* The object used with gpgrt_poll. */
+struct _gpgrt_poll_s
+{
+ gpgrt_stream_t stream;
+ unsigned int want_read:1;
+ unsigned int want_write:1;
+ unsigned int want_oob:1;
+ unsigned int want_rdhup:1;
+ unsigned int _reserv1:4;
+ unsigned int got_read:1;
+ unsigned int got_write:1;
+ unsigned int got_oob:1;
+ unsigned int got_rdhup:1;
+ unsigned int _reserv2:4;
+ unsigned int got_err:1;
+ unsigned int got_hup:1;
+ unsigned int got_nval:1;
+ unsigned int _reserv3:4;
+ unsigned int ignore:1;
+ unsigned int user:8; /* For application use. */
+};
+typedef struct _gpgrt_poll_s gpgrt_poll_t;
+#ifdef GPGRT_ENABLE_ES_MACROS
+typedef struct _gpgrt_poll_s es_poll_t;
+#endif
+
+gpgrt_stream_t gpgrt_fopen (const char *_GPGRT__RESTRICT path,
+ const char *_GPGRT__RESTRICT mode);
+gpgrt_stream_t gpgrt_mopen (void *_GPGRT__RESTRICT data,
+ size_t data_n, size_t data_len,
+ unsigned int grow,
+ void *(*func_realloc) (void *mem, size_t size),
+ void (*func_free) (void *mem),
+ const char *_GPGRT__RESTRICT mode);
+gpgrt_stream_t gpgrt_fopenmem (size_t memlimit,
+ const char *_GPGRT__RESTRICT mode);
+gpgrt_stream_t gpgrt_fopenmem_init (size_t memlimit,
+ const char *_GPGRT__RESTRICT mode,
+ const void *data, size_t datalen);
+gpgrt_stream_t gpgrt_fdopen (int filedes, const char *mode);
+gpgrt_stream_t gpgrt_fdopen_nc (int filedes, const char *mode);
+gpgrt_stream_t gpgrt_sysopen (gpgrt_syshd_t *syshd, const char *mode);
+gpgrt_stream_t gpgrt_sysopen_nc (gpgrt_syshd_t *syshd, const char *mode);
+gpgrt_stream_t gpgrt_fpopen (FILE *fp, const char *mode);
+gpgrt_stream_t gpgrt_fpopen_nc (FILE *fp, const char *mode);
+gpgrt_stream_t gpgrt_freopen (const char *_GPGRT__RESTRICT path,
+ const char *_GPGRT__RESTRICT mode,
+ gpgrt_stream_t _GPGRT__RESTRICT stream);
+gpgrt_stream_t gpgrt_fopencookie (void *_GPGRT__RESTRICT cookie,
+ const char *_GPGRT__RESTRICT mode,
+ gpgrt_cookie_io_functions_t functions);
+int gpgrt_fclose (gpgrt_stream_t stream);
+int gpgrt_fclose_snatch (gpgrt_stream_t stream,
+ void **r_buffer, size_t *r_buflen);
+int gpgrt_onclose (gpgrt_stream_t stream, int mode,
+ void (*fnc) (gpgrt_stream_t, void*), void *fnc_value);
+int gpgrt_fileno (gpgrt_stream_t stream);
+int gpgrt_fileno_unlocked (gpgrt_stream_t stream);
+int gpgrt_syshd (gpgrt_stream_t stream, gpgrt_syshd_t *syshd);
+int gpgrt_syshd_unlocked (gpgrt_stream_t stream, gpgrt_syshd_t *syshd);
+
+void _gpgrt_set_std_fd (int no, int fd);
+gpgrt_stream_t _gpgrt_get_std_stream (int fd);
+
+#define gpgrt_stdin _gpgrt_get_std_stream (0)
+#define gpgrt_stdout _gpgrt_get_std_stream (1)
+#define gpgrt_stderr _gpgrt_get_std_stream (2)
+
+
+void gpgrt_flockfile (gpgrt_stream_t stream);
+int gpgrt_ftrylockfile (gpgrt_stream_t stream);
+void gpgrt_funlockfile (gpgrt_stream_t stream);
+
+int gpgrt_feof (gpgrt_stream_t stream);
+int gpgrt_feof_unlocked (gpgrt_stream_t stream);
+int gpgrt_ferror (gpgrt_stream_t stream);
+int gpgrt_ferror_unlocked (gpgrt_stream_t stream);
+void gpgrt_clearerr (gpgrt_stream_t stream);
+void gpgrt_clearerr_unlocked (gpgrt_stream_t stream);
+
+int _gpgrt_pending (gpgrt_stream_t stream); /* (private) */
+int _gpgrt_pending_unlocked (gpgrt_stream_t stream); /* (private) */
+
+#define gpgrt_pending(stream) _gpgrt_pending (stream)
+
+#define gpgrt_pending_unlocked(stream) \
+ (((!(stream)->flags.writing) \
+ && (((stream)->data_offset < (stream)->data_len) \
+ || ((stream)->unread_data_len))) \
+ ? 1 : _gpgrt_pending_unlocked ((stream)))
+
+int gpgrt_fflush (gpgrt_stream_t stream);
+int gpgrt_fseek (gpgrt_stream_t stream, long int offset, int whence);
+int gpgrt_fseeko (gpgrt_stream_t stream, gpgrt_off_t offset, int whence);
+long int gpgrt_ftell (gpgrt_stream_t stream);
+gpgrt_off_t gpgrt_ftello (gpgrt_stream_t stream);
+void gpgrt_rewind (gpgrt_stream_t stream);
+
+int gpgrt_fgetc (gpgrt_stream_t stream);
+int gpgrt_fputc (int c, gpgrt_stream_t stream);
+
+int _gpgrt_getc_underflow (gpgrt_stream_t stream); /* (private) */
+int _gpgrt_putc_overflow (int c, gpgrt_stream_t stream); /* (private) */
+
+#define gpgrt_getc_unlocked(stream) \
+ (((!(stream)->flags.writing) \
+ && ((stream)->data_offset < (stream)->data_len) \
+ && (! (stream)->unread_data_len)) \
+ ? ((int) (stream)->buffer[((stream)->data_offset)++]) \
+ : _gpgrt_getc_underflow ((stream)))
+
+#define gpgrt_putc_unlocked(c, stream) \
+ (((stream)->flags.writing \
+ && ((stream)->data_offset < (stream)->buffer_size) \
+ && (c != '\n')) \
+ ? ((int) ((stream)->buffer[((stream)->data_offset)++] = (c))) \
+ : _gpgrt_putc_overflow ((c), (stream)))
+
+#define gpgrt_getc(stream) gpgrt_fgetc (stream)
+#define gpgrt_putc(c, stream) gpgrt_fputc (c, stream)
+
+int gpgrt_ungetc (int c, gpgrt_stream_t stream);
+
+int gpgrt_read (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ void *_GPGRT__RESTRICT buffer, size_t bytes_to_read,
+ size_t *_GPGRT__RESTRICT bytes_read);
+int gpgrt_write (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const void *_GPGRT__RESTRICT buffer, size_t bytes_to_write,
+ size_t *_GPGRT__RESTRICT bytes_written);
+int gpgrt_write_sanitized (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const void *_GPGRT__RESTRICT buffer, size_t length,
+ const char *delimiters,
+ size_t *_GPGRT__RESTRICT bytes_written);
+int gpgrt_write_hexstring (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const void *_GPGRT__RESTRICT buffer, size_t length,
+ int reserved,
+ size_t *_GPGRT__RESTRICT bytes_written);
+
+size_t gpgrt_fread (void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems,
+ gpgrt_stream_t _GPGRT__RESTRICT stream);
+size_t gpgrt_fwrite (const void *_GPGRT__RESTRICT ptr, size_t size, size_t memb,
+ gpgrt_stream_t _GPGRT__RESTRICT stream);
+
+char *gpgrt_fgets (char *_GPGRT__RESTRICT s, int n,
+ gpgrt_stream_t _GPGRT__RESTRICT stream);
+int gpgrt_fputs (const char *_GPGRT__RESTRICT s,
+ gpgrt_stream_t _GPGRT__RESTRICT stream);
+int gpgrt_fputs_unlocked (const char *_GPGRT__RESTRICT s,
+ gpgrt_stream_t _GPGRT__RESTRICT stream);
+
+@api_ssize_t@ gpgrt_getline (char *_GPGRT__RESTRICT *_GPGRT__RESTRICT lineptr,
+ size_t *_GPGRT__RESTRICT n,
+ gpgrt_stream_t stream);
+@api_ssize_t@ gpgrt_read_line (gpgrt_stream_t stream,
+ char **addr_of_buffer, size_t *length_of_buffer,
+ size_t *max_length);
+void gpgrt_free (void *a);
+
+int gpgrt_fprintf (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format, ...)
+ GPGRT_ATTR_PRINTF(2,3);
+int gpgrt_fprintf_unlocked (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format, ...)
+ GPGRT_ATTR_PRINTF(2,3);
+
+int gpgrt_printf (const char *_GPGRT__RESTRICT format, ...)
+ GPGRT_ATTR_PRINTF(1,2);
+int gpgrt_printf_unlocked (const char *_GPGRT__RESTRICT format, ...)
+ GPGRT_ATTR_PRINTF(1,2);
+
+int gpgrt_vfprintf (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format, va_list ap)
+ GPGRT_ATTR_PRINTF(2,0);
+int gpgrt_vfprintf_unlocked (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format, va_list ap)
+ GPGRT_ATTR_PRINTF(2,0);
+
+int gpgrt_setvbuf (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ char *_GPGRT__RESTRICT buf, int mode, size_t size);
+void gpgrt_setbuf (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ char *_GPGRT__RESTRICT buf);
+
+void gpgrt_set_binary (gpgrt_stream_t stream);
+int gpgrt_set_nonblock (gpgrt_stream_t stream, int onoff);
+int gpgrt_get_nonblock (gpgrt_stream_t stream);
+
+int gpgrt_poll (gpgrt_poll_t *fdlist, unsigned int nfds, int timeout);
+
+gpgrt_stream_t gpgrt_tmpfile (void);
+
+void gpgrt_opaque_set (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ void *_GPGRT__RESTRICT opaque);
+void *gpgrt_opaque_get (gpgrt_stream_t stream);
+
+void gpgrt_fname_set (gpgrt_stream_t stream, const char *fname);
+const char *gpgrt_fname_get (gpgrt_stream_t stream);
+
+int gpgrt_asprintf (char **r_buf, const char * _GPGRT__RESTRICT format, ...)
+ GPGRT_ATTR_PRINTF(2,3);
+int gpgrt_vasprintf (char **r_buf, const char * _GPGRT__RESTRICT format,
+ va_list ap)
+ GPGRT_ATTR_PRINTF(2,0);
+char *gpgrt_bsprintf (const char * _GPGRT__RESTRICT format, ...)
+ GPGRT_ATTR_PRINTF(1,2);
+char *gpgrt_vbsprintf (const char * _GPGRT__RESTRICT format, va_list ap)
+ GPGRT_ATTR_PRINTF(1,0);
+int gpgrt_snprintf (char *buf, size_t bufsize,
+ const char * _GPGRT__RESTRICT format, ...)
+ GPGRT_ATTR_PRINTF(3,4);
+int gpgrt_vsnprintf (char *buf,size_t bufsize,
+ const char * _GPGRT__RESTRICT format, va_list arg_ptr)
+ GPGRT_ATTR_PRINTF(3,0);
+
+
+#ifdef GPGRT_ENABLE_ES_MACROS
+# define es_fopen gpgrt_fopen
+# define es_mopen gpgrt_mopen
+# define es_fopenmem gpgrt_fopenmem
+# define es_fopenmem_init gpgrt_fopenmem_init
+# define es_fdopen gpgrt_fdopen
+# define es_fdopen_nc gpgrt_fdopen_nc
+# define es_sysopen gpgrt_sysopen
+# define es_sysopen_nc gpgrt_sysopen_nc
+# define es_fpopen gpgrt_fpopen
+# define es_fpopen_nc gpgrt_fpopen_nc
+# define es_freopen gpgrt_freopen
+# define es_fopencookie gpgrt_fopencookie
+# define es_fclose gpgrt_fclose
+# define es_fclose_snatch gpgrt_fclose_snatch
+# define es_onclose gpgrt_onclose
+# define es_fileno gpgrt_fileno
+# define es_fileno_unlocked gpgrt_fileno_unlocked
+# define es_syshd gpgrt_syshd
+# define es_syshd_unlocked gpgrt_syshd_unlocked
+# define es_stdin _gpgrt_get_std_stream (0)
+# define es_stdout _gpgrt_get_std_stream (1)
+# define es_stderr _gpgrt_get_std_stream (2)
+# define es_flockfile gpgrt_flockfile
+# define es_ftrylockfile gpgrt_ftrylockfile
+# define es_funlockfile gpgrt_funlockfile
+# define es_feof gpgrt_feof
+# define es_feof_unlocked gpgrt_feof_unlocked
+# define es_ferror gpgrt_ferror
+# define es_ferror_unlocked gpgrt_ferror_unlocked
+# define es_clearerr gpgrt_clearerr
+# define es_clearerr_unlocked gpgrt_clearerr_unlocked
+# define es_pending gpgrt_pending
+# define es_pending_unlocked gpgrt_pending_unlocked
+# define es_fflush gpgrt_fflush
+# define es_fseek gpgrt_fseek
+# define es_fseeko gpgrt_fseeko
+# define es_ftell gpgrt_ftell
+# define es_ftello gpgrt_ftello
+# define es_rewind gpgrt_rewind
+# define es_fgetc gpgrt_fgetc
+# define es_fputc gpgrt_fputc
+# define es_getc_unlocked gpgrt_getc_unlocked
+# define es_putc_unlocked gpgrt_putc_unlocked
+# define es_getc gpgrt_getc
+# define es_putc gpgrt_putc
+# define es_ungetc gpgrt_ungetc
+# define es_read gpgrt_read
+# define es_write gpgrt_write
+# define es_write_sanitized gpgrt_write_sanitized
+# define es_write_hexstring gpgrt_write_hexstring
+# define es_fread gpgrt_fread
+# define es_fwrite gpgrt_fwrite
+# define es_fgets gpgrt_fgets
+# define es_fputs gpgrt_fputs
+# define es_fputs_unlocked gpgrt_fputs_unlocked
+# define es_getline gpgrt_getline
+# define es_read_line gpgrt_read_line
+# define es_free gpgrt_free
+# define es_fprintf gpgrt_fprintf
+# define es_fprintf_unlocked gpgrt_fprintf_unlocked
+# define es_printf gpgrt_printf
+# define es_printf_unlocked gpgrt_printf_unlocked
+# define es_vfprintf gpgrt_vfprintf
+# define es_vfprintf_unlocked gpgrt_vfprintf_unlocked
+# define es_setvbuf gpgrt_setvbuf
+# define es_setbuf gpgrt_setbuf
+# define es_set_binary gpgrt_set_binary
+# define es_set_nonblock gpgrt_set_nonblock
+# define es_get_nonblock gpgrt_get_nonblock
+# define es_poll gpgrt_poll
+# define es_tmpfile gpgrt_tmpfile
+# define es_opaque_set gpgrt_opaque_set
+# define es_opaque_get gpgrt_opaque_get
+# define es_fname_set gpgrt_fname_set
+# define es_fname_get gpgrt_fname_get
+# define es_asprintf gpgrt_asprintf
+# define es_vasprintf gpgrt_vasprintf
+# define es_bsprintf gpgrt_bsprintf
+# define es_vbsprintf gpgrt_vbsprintf
+#endif /*GPGRT_ENABLE_ES_MACROS*/
+
+/* Base64 decode functions. */
+
+struct _gpgrt_b64state;
+typedef struct _gpgrt_b64state *gpgrt_b64state_t;
+
+gpgrt_b64state_t gpgrt_b64dec_start (const char *title);
+gpg_error_t gpgrt_b64dec_proc (gpgrt_b64state_t state,
+ void *buffer, size_t length, size_t *r_nbytes);
+gpg_error_t gpgrt_b64dec_finish (gpgrt_b64state_t state);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* GPGRT_H */
+#endif /* GPG_ERROR_H */
diff --git a/src/gpg-error.m4 b/src/gpg-error.m4
new file mode 100644
index 0000000..60c88d8
--- /dev/null
+++ b/src/gpg-error.m4
@@ -0,0 +1,121 @@
+# gpg-error.m4 - autoconf macro to detect libgpg-error.
+# Copyright (C) 2002, 2003, 2004, 2011, 2014 g10 Code GmbH
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This file 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.
+#
+# Last-changed: 2014-10-02
+
+
+dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION,
+dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
+dnl
+dnl Test for libgpg-error and define GPG_ERROR_CFLAGS, GPG_ERROR_LIBS,
+dnl GPG_ERROR_MT_CFLAGS, and GPG_ERROR_MT_LIBS. The _MT_ variants are
+dnl used for programs requireing real multi thread support.
+dnl
+dnl If a prefix option is not used, the config script is first
+dnl searched in $SYSROOT/bin and then along $PATH. If the used
+dnl config script does not match the host specification the script
+dnl is added to the gpg_config_script_warn variable.
+dnl
+AC_DEFUN([AM_PATH_GPG_ERROR],
+[ AC_REQUIRE([AC_CANONICAL_HOST])
+ gpg_error_config_prefix=""
+ dnl --with-libgpg-error-prefix=PFX is the preferred name for this option,
+ dnl since that is consistent with how our three siblings use the directory/
+ dnl package name in --with-$dir_name-prefix=PFX.
+ AC_ARG_WITH(libgpg-error-prefix,
+ AC_HELP_STRING([--with-libgpg-error-prefix=PFX],
+ [prefix where GPG Error is installed (optional)]),
+ [gpg_error_config_prefix="$withval"])
+
+ dnl Accept --with-gpg-error-prefix and make it work the same as
+ dnl --with-libgpg-error-prefix above, for backwards compatibility,
+ dnl but do not document this old, inconsistently-named option.
+ AC_ARG_WITH(gpg-error-prefix,,
+ [gpg_error_config_prefix="$withval"])
+
+ if test x"${GPG_ERROR_CONFIG}" = x ; then
+ if test x"${gpg_error_config_prefix}" != x ; then
+ GPG_ERROR_CONFIG="${gpg_error_config_prefix}/bin/gpg-error-config"
+ else
+ case "${SYSROOT}" in
+ /*)
+ if test -x "${SYSROOT}/bin/gpg-error-config" ; then
+ GPG_ERROR_CONFIG="${SYSROOT}/bin/gpg-error-config"
+ fi
+ ;;
+ '')
+ ;;
+ *)
+ AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.])
+ ;;
+ esac
+ fi
+ fi
+
+ AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no)
+ min_gpg_error_version=ifelse([$1], ,0.0,$1)
+ AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version)
+ ok=no
+ if test "$GPG_ERROR_CONFIG" != "no" \
+ && test -f "$GPG_ERROR_CONFIG" ; then
+ req_major=`echo $min_gpg_error_version | \
+ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+ req_minor=`echo $min_gpg_error_version | \
+ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+ gpg_error_config_version=`$GPG_ERROR_CONFIG $gpg_error_config_args --version`
+ major=`echo $gpg_error_config_version | \
+ sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+ minor=`echo $gpg_error_config_version | \
+ sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
+ if test "$major" -gt "$req_major"; then
+ ok=yes
+ else
+ if test "$major" -eq "$req_major"; then
+ if test "$minor" -ge "$req_minor"; then
+ ok=yes
+ fi
+ fi
+ fi
+ fi
+ if test $ok = yes; then
+ GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --cflags`
+ GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --libs`
+ GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --cflags 2>/dev/null`
+ GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --libs 2>/dev/null`
+ AC_MSG_RESULT([yes ($gpg_error_config_version)])
+ ifelse([$2], , :, [$2])
+ gpg_error_config_host=`$GPG_ERROR_CONFIG $gpg_error_config_args --host 2>/dev/null || echo none`
+ if test x"$gpg_error_config_host" != xnone ; then
+ if test x"$gpg_error_config_host" != x"$host" ; then
+ AC_MSG_WARN([[
+***
+*** The config script $GPG_ERROR_CONFIG was
+*** built for $gpg_error_config_host and thus may not match the
+*** used host $host.
+*** You may want to use the configure option --with-libgpg-error-prefix
+*** to specify a matching config script or use \$SYSROOT.
+***]])
+ gpg_config_script_warn="$gpg_config_script_warn libgpg-error"
+ fi
+ fi
+ else
+ GPG_ERROR_CFLAGS=""
+ GPG_ERROR_LIBS=""
+ GPG_ERROR_MT_CFLAGS=""
+ GPG_ERROR_MT_LIBS=""
+ AC_MSG_RESULT(no)
+ ifelse([$3], , :, [$3])
+ fi
+ AC_SUBST(GPG_ERROR_CFLAGS)
+ AC_SUBST(GPG_ERROR_LIBS)
+ AC_SUBST(GPG_ERROR_MT_CFLAGS)
+ AC_SUBST(GPG_ERROR_MT_LIBS)
+])
diff --git a/src/gpg-error.vers b/src/gpg-error.vers
new file mode 100644
index 0000000..e44128c
--- /dev/null
+++ b/src/gpg-error.vers
@@ -0,0 +1,135 @@
+# libgpg-error.vers - What symbols to export -*- std -*-
+# Copyright (C) 2014 g10 Code GmbH
+#
+# This file is part of libgpg-error.
+#
+# libgpg-error is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of the
+# License, or (at your option) any later version.
+#
+# libgpg-error is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, see <https://www.gnu.org/licenses/>.
+#
+# NOTE: When adding new functions, please make sure to add them to
+# visibility.h and gpg-error.def.in as well.
+
+
+GPG_ERROR_1.0 {
+ global:
+ gpg_strerror;
+ gpg_strerror_r;
+ gpg_strsource;
+ gpg_err_code_from_errno;
+ gpg_err_code_to_errno;
+ gpg_err_code_from_syserror;
+ gpg_err_set_errno;
+ gpg_error_check_version;
+
+ gpgrt_lock_init;
+ gpgrt_lock_lock;
+ gpgrt_lock_unlock;
+ gpgrt_lock_destroy;
+ gpgrt_yield;
+ gpgrt_lock_trylock;
+
+ gpgrt_set_syscall_clamp;
+ gpgrt_get_syscall_clamp;
+
+ gpgrt_fopen;
+ gpgrt_mopen;
+ gpgrt_fopenmem;
+ gpgrt_fopenmem_init;
+ gpgrt_fdopen;
+ gpgrt_fdopen_nc;
+ gpgrt_sysopen;
+ gpgrt_sysopen_nc;
+ gpgrt_fpopen;
+ gpgrt_fpopen_nc;
+ gpgrt_freopen;
+ gpgrt_fopencookie;
+ gpgrt_fclose;
+ gpgrt_fclose_snatch;
+ gpgrt_onclose;
+ gpgrt_fileno;
+ gpgrt_fileno_unlocked;
+ gpgrt_syshd;
+ gpgrt_syshd_unlocked;
+ _gpgrt_set_std_fd;
+ _gpgrt_get_std_stream;
+ gpgrt_flockfile;
+ gpgrt_ftrylockfile;
+ gpgrt_funlockfile;
+ _gpgrt_pending;
+ _gpgrt_pending_unlocked;
+ gpgrt_feof;
+ gpgrt_feof_unlocked;
+ gpgrt_ferror;
+ gpgrt_ferror_unlocked;
+ gpgrt_clearerr;
+ gpgrt_clearerr_unlocked;
+ gpgrt_fflush;
+ gpgrt_fseek;
+ gpgrt_fseeko;
+ gpgrt_ftell;
+ gpgrt_ftello;
+ gpgrt_rewind;
+ gpgrt_fgetc;
+ _gpgrt_getc_underflow;
+ gpgrt_fputc;
+ _gpgrt_putc_overflow;
+ gpgrt_ungetc;
+ gpgrt_read;
+ gpgrt_write;
+ gpgrt_write_sanitized;
+ gpgrt_write_hexstring;
+ gpgrt_fread;
+ gpgrt_fwrite;
+ gpgrt_fgets;
+ gpgrt_fputs;
+ gpgrt_fputs_unlocked;
+ gpgrt_getline;
+ gpgrt_read_line;
+ gpgrt_free;
+ gpgrt_fprintf;
+ gpgrt_fprintf_unlocked;
+ gpgrt_printf;
+ gpgrt_printf_unlocked;
+ gpgrt_vfprintf;
+ gpgrt_vfprintf_unlocked;
+ gpgrt_setvbuf;
+ gpgrt_setbuf;
+ gpgrt_set_binary;
+ gpgrt_set_nonblock;
+ gpgrt_get_nonblock;
+ gpgrt_poll;
+ gpgrt_tmpfile;
+ gpgrt_opaque_set;
+ gpgrt_opaque_get;
+ gpgrt_fname_set;
+ gpgrt_fname_get;
+
+ gpgrt_asprintf;
+ gpgrt_vasprintf;
+ gpgrt_bsprintf;
+ gpgrt_vbsprintf;
+ gpgrt_snprintf;
+ gpgrt_vsnprintf;
+
+ gpgrt_check_version;
+ gpg_err_init;
+ gpg_err_deinit;
+ gpgrt_set_alloc_func;
+
+ gpgrt_b64dec_start;
+ gpgrt_b64dec_proc;
+ gpgrt_b64dec_finish;
+
+ local:
+ *;
+};
diff --git a/src/gpg-error.w32-manifest.in b/src/gpg-error.w32-manifest.in
new file mode 100644
index 0000000..07f6891
--- /dev/null
+++ b/src/gpg-error.w32-manifest.in
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<description>Error codes and shared functions for GnuPG and others</description>
+<assemblyIdentity
+ type="win32"
+ name="GnuPG.libgpg-error"
+ version="@BUILD_VERSION@"
+ />
+<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/><!-- Vista -->
+ <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/><!-- 7 -->
+ <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/><!-- 8 -->
+ <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/><!-- 8.1 -->
+ </application>
+</compatibility>
+</assembly>
diff --git a/src/gpgrt-int.h b/src/gpgrt-int.h
new file mode 100644
index 0000000..701e1d4
--- /dev/null
+++ b/src/gpgrt-int.h
@@ -0,0 +1,376 @@
+/* gpgrt-int.h - Internal definitions
+ * Copyright (C) 2014 g10 Code GmbH
+ *
+ * This file is part of libgpg-error.
+ *
+ * libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * libgpg-error is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef _GPGRT_GPGRT_INT_H
+#define _GPGRT_GPGRT_INT_H
+
+#include "gpg-error.h"
+#include "visibility.h"
+
+/* Local error function prototypes. */
+const char *_gpg_strerror (gpg_error_t err);
+int _gpg_strerror_r (gpg_error_t err, char *buf, size_t buflen);
+const char *_gpg_strsource (gpg_error_t err);
+gpg_err_code_t _gpg_err_code_from_errno (int err);
+int _gpg_err_code_to_errno (gpg_err_code_t code);
+gpg_err_code_t _gpg_err_code_from_syserror (void);
+void _gpg_err_set_errno (int err);
+
+gpg_error_t _gpg_err_init (void);
+void _gpg_err_deinit (int mode);
+void _gpgrt_set_alloc_func (void *(*f)(void *a, size_t n));
+
+void *_gpgrt_realloc (void *a, size_t n);
+void *_gpgrt_malloc (size_t n);
+void _gpgrt_free (void *a);
+
+const char *_gpg_error_check_version (const char *req_version);
+
+gpg_err_code_t _gpgrt_lock_init (gpgrt_lock_t *lockhd);
+gpg_err_code_t _gpgrt_lock_lock (gpgrt_lock_t *lockhd);
+gpg_err_code_t _gpgrt_lock_trylock (gpgrt_lock_t *lockhd);
+gpg_err_code_t _gpgrt_lock_unlock (gpgrt_lock_t *lockhd);
+gpg_err_code_t _gpgrt_lock_destroy (gpgrt_lock_t *lockhd);
+gpg_err_code_t _gpgrt_yield (void);
+
+/* Trace support. */
+
+/* The trace macro is used this way:
+ * trace (("enter - foo=%d bar=%s", foo, bar));
+ * Note the double parenthesis, they are important.
+ * To append the current errno to the output, use
+ * trace_errno (EXTPR,("leave - baz=%d", faz));
+ * If EXPR evaluates to true the output of strerror (errno)
+ * is appended to the output. Note that the trace function does
+ * not modify ERRNO. To enable tracing you need to have this
+ * #define ENABLE_TRACING "modulename"
+ * before you include gpgrt-int.h.
+ */
+#ifdef ENABLE_TRACING
+# define trace(X) do { \
+ _gpgrt_internal_trace_begin \
+ (ENABLE_TRACING, __func__, __LINE__, 0); \
+ _gpgrt_internal_trace X; \
+ _gpgrt_internal_trace_end (); \
+ } while (0)
+# define trace_errno(C,X) do { \
+ _gpgrt_internal_trace_begin \
+ (ENABLE_TRACING, __func__, __LINE__, (C)); \
+ _gpgrt_internal_trace X; \
+ _gpgrt_internal_trace_end (); \
+ } while (0)
+# define trace_start(X) do { \
+ _gpgrt_internal_trace_begin \
+ (ENABLE_TRACING, __func__, __LINE__, 0); \
+ _gpgrt_internal_trace_printf X; \
+ } while (0)
+# define trace_append(X) do { \
+ _gpgrt_internal_trace_printf X; \
+ } while (0)
+# define trace_finish(X) do { \
+ _gpgrt_internal_trace_printf X; \
+ _gpgrt_internal_trace_end (); \
+ } while (0)
+#else
+# define trace(X) do { } while (0)
+# define trace_errno(C,X) do { } while (0)
+# define trace_start(X) do { } while (0)
+# define trace_append(X) do { } while (0)
+# define trace_finish(X) do { } while (0)
+#endif /*!ENABLE_TRACING*/
+
+void _gpgrt_internal_trace_begin (const char *mod, const char *file, int line,
+ int with_errno);
+void _gpgrt_internal_trace (const char *format,
+ ...) GPGRT_ATTR_PRINTF(1,2);
+void _gpgrt_internal_trace_printf (const char *format,
+ ...) GPGRT_ATTR_PRINTF(1,2);
+void _gpgrt_internal_trace_end (void);
+
+
+
+/* Local definitions for estream. */
+
+#if HAVE_W32_SYSTEM
+# ifndef O_NONBLOCK
+# define O_NONBLOCK 0x40000000 /* FIXME: Is that safe? */
+# endif
+#endif
+
+/*
+ * A private cookie function to implement an internal IOCTL service.
+ * and ist IOCTL numbers.
+ */
+typedef int (*cookie_ioctl_function_t) (void *cookie, int cmd,
+ void *ptr, size_t *len);
+#define COOKIE_IOCTL_SNATCH_BUFFER 1
+#define COOKIE_IOCTL_NONBLOCK 2
+
+/* An internal variant of gpgrt_cookie_close_function_t with a slot
+ for the ioctl function. */
+struct cookie_io_functions_s
+{
+ struct _gpgrt_cookie_io_functions public;
+ cookie_ioctl_function_t func_ioctl;
+};
+
+typedef enum
+ {
+ BACKEND_MEM,
+ BACKEND_FD,
+ BACKEND_W32,
+ BACKEND_FP,
+ BACKEND_USER,
+ BACKEND_W32_POLLABLE
+ } gpgrt_stream_backend_kind_t;
+
+
+/*
+ * A type to hold notification functions.
+ */
+struct notify_list_s
+{
+ struct notify_list_s *next;
+ void (*fnc) (estream_t, void*); /* The notification function. */
+ void *fnc_value; /* The value to be passed to FNC. */
+};
+typedef struct notify_list_s *notify_list_t;
+
+
+/*
+ * Buffer management layer.
+ */
+
+#define BUFFER_BLOCK_SIZE BUFSIZ
+#define BUFFER_UNREAD_SIZE 16
+
+
+/*
+ * The private object describing a stream.
+ */
+struct _gpgrt_stream_internal
+{
+ unsigned char buffer[BUFFER_BLOCK_SIZE];
+ unsigned char unread_buffer[BUFFER_UNREAD_SIZE];
+
+ gpgrt_lock_t lock; /* Lock. Used by *_stream_lock(). */
+
+ gpgrt_stream_backend_kind_t kind;
+ void *cookie; /* Cookie. */
+ void *opaque; /* Opaque data. */
+ unsigned int modeflags; /* Flags for the backend. */
+ char *printable_fname; /* Malloced filename for es_fname_get. */
+ gpgrt_off_t offset;
+ gpgrt_cookie_read_function_t func_read;
+ gpgrt_cookie_write_function_t func_write;
+ gpgrt_cookie_seek_function_t func_seek;
+ gpgrt_cookie_close_function_t func_close;
+ cookie_ioctl_function_t func_ioctl;
+ int strategy;
+ es_syshd_t syshd; /* A copy of the system handle. */
+ struct
+ {
+ unsigned int err: 1;
+ unsigned int eof: 1;
+ unsigned int hup: 1;
+ } indicators;
+ unsigned int deallocate_buffer: 1;
+ unsigned int is_stdstream:1; /* This is a standard stream. */
+ unsigned int stdstream_fd:2; /* 0, 1 or 2 for a standard stream. */
+ unsigned int printable_fname_inuse: 1; /* es_fname_get has been used. */
+ unsigned int samethread: 1; /* The "samethread" mode keyword. */
+ size_t print_ntotal; /* Bytes written from in print_writer. */
+ notify_list_t onclose; /* On close notify function list. */
+};
+typedef struct _gpgrt_stream_internal *estream_internal_t;
+
+
+/* Local prototypes for estream. */
+int _gpgrt_estream_init (void);
+void _gpgrt_set_syscall_clamp (void (*pre)(void), void (*post)(void));
+void _gpgrt_get_syscall_clamp (void (**r_pre)(void), void (**r_post)(void));
+
+gpgrt_stream_t _gpgrt_fopen (const char *_GPGRT__RESTRICT path,
+ const char *_GPGRT__RESTRICT mode);
+gpgrt_stream_t _gpgrt_mopen (void *_GPGRT__RESTRICT data,
+ size_t data_n, size_t data_len,
+ unsigned int grow,
+ void *(*func_realloc) (void *mem, size_t size),
+ void (*func_free) (void *mem),
+ const char *_GPGRT__RESTRICT mode);
+gpgrt_stream_t _gpgrt_fopenmem (size_t memlimit,
+ const char *_GPGRT__RESTRICT mode);
+gpgrt_stream_t _gpgrt_fopenmem_init (size_t memlimit,
+ const char *_GPGRT__RESTRICT mode,
+ const void *data, size_t datalen);
+gpgrt_stream_t _gpgrt_fdopen (int filedes, const char *mode);
+gpgrt_stream_t _gpgrt_fdopen_nc (int filedes, const char *mode);
+gpgrt_stream_t _gpgrt_sysopen (gpgrt_syshd_t *syshd, const char *mode);
+gpgrt_stream_t _gpgrt_sysopen_nc (gpgrt_syshd_t *syshd, const char *mode);
+gpgrt_stream_t _gpgrt_fpopen (FILE *fp, const char *mode);
+gpgrt_stream_t _gpgrt_fpopen_nc (FILE *fp, const char *mode);
+gpgrt_stream_t _gpgrt_freopen (const char *_GPGRT__RESTRICT path,
+ const char *_GPGRT__RESTRICT mode,
+ gpgrt_stream_t _GPGRT__RESTRICT stream);
+gpgrt_stream_t _gpgrt_fopencookie (void *_GPGRT__RESTRICT cookie,
+ const char *_GPGRT__RESTRICT mode,
+ gpgrt_cookie_io_functions_t functions);
+int _gpgrt_fclose (gpgrt_stream_t stream);
+int _gpgrt_fclose_snatch (gpgrt_stream_t stream,
+ void **r_buffer, size_t *r_buflen);
+int _gpgrt_onclose (gpgrt_stream_t stream, int mode,
+ void (*fnc) (gpgrt_stream_t, void*), void *fnc_value);
+int _gpgrt_fileno (gpgrt_stream_t stream);
+int _gpgrt_fileno_unlocked (gpgrt_stream_t stream);
+int _gpgrt_syshd (gpgrt_stream_t stream, gpgrt_syshd_t *syshd);
+int _gpgrt_syshd_unlocked (gpgrt_stream_t stream, gpgrt_syshd_t *syshd);
+
+void _gpgrt__set_std_fd (int no, int fd);
+gpgrt_stream_t _gpgrt__get_std_stream (int fd);
+
+void _gpgrt_flockfile (gpgrt_stream_t stream);
+int _gpgrt_ftrylockfile (gpgrt_stream_t stream);
+void _gpgrt_funlockfile (gpgrt_stream_t stream);
+
+int _gpgrt_feof (gpgrt_stream_t stream);
+int _gpgrt_feof_unlocked (gpgrt_stream_t stream);
+int _gpgrt_ferror (gpgrt_stream_t stream);
+int _gpgrt_ferror_unlocked (gpgrt_stream_t stream);
+void _gpgrt_clearerr (gpgrt_stream_t stream);
+void _gpgrt_clearerr_unlocked (gpgrt_stream_t stream);
+int _gpgrt__pending (gpgrt_stream_t stream);
+int _gpgrt__pending_unlocked (gpgrt_stream_t stream);
+
+int _gpgrt_fflush (gpgrt_stream_t stream);
+int _gpgrt_fseek (gpgrt_stream_t stream, long int offset, int whence);
+int _gpgrt_fseeko (gpgrt_stream_t stream, gpgrt_off_t offset, int whence);
+long int _gpgrt_ftell (gpgrt_stream_t stream);
+gpgrt_off_t _gpgrt_ftello (gpgrt_stream_t stream);
+void _gpgrt_rewind (gpgrt_stream_t stream);
+
+int _gpgrt_fgetc (gpgrt_stream_t stream);
+int _gpgrt_fputc (int c, gpgrt_stream_t stream);
+
+int _gpgrt__getc_underflow (gpgrt_stream_t stream);
+int _gpgrt__putc_overflow (int c, gpgrt_stream_t stream);
+
+/* Note: Keeps the next two macros in sync
+ with their counterparts in gpg-error.h. */
+#define _gpgrt_getc_unlocked(stream) \
+ (((!(stream)->flags.writing) \
+ && ((stream)->data_offset < (stream)->data_len) \
+ && (! (stream)->unread_data_len)) \
+ ? ((int) (stream)->buffer[((stream)->data_offset)++]) \
+ : _gpgrt__getc_underflow ((stream)))
+
+#define _gpgrt_putc_unlocked(c, stream) \
+ (((stream)->flags.writing \
+ && ((stream)->data_offset < (stream)->buffer_size) \
+ && (c != '\n')) \
+ ? ((int) ((stream)->buffer[((stream)->data_offset)++] = (c))) \
+ : _gpgrt__putc_overflow ((c), (stream)))
+
+int _gpgrt_ungetc (int c, gpgrt_stream_t stream);
+
+int _gpgrt_read (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ void *_GPGRT__RESTRICT buffer, size_t bytes_to_read,
+ size_t *_GPGRT__RESTRICT bytes_read);
+int _gpgrt_write (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const void *_GPGRT__RESTRICT buffer, size_t bytes_to_write,
+ size_t *_GPGRT__RESTRICT bytes_written);
+int _gpgrt_write_sanitized (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const void *_GPGRT__RESTRICT buffer, size_t length,
+ const char *delimiters,
+ size_t *_GPGRT__RESTRICT bytes_written);
+int _gpgrt_write_hexstring (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const void *_GPGRT__RESTRICT buffer, size_t length,
+ int reserved,
+ size_t *_GPGRT__RESTRICT bytes_written);
+
+size_t _gpgrt_fread (void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems,
+ gpgrt_stream_t _GPGRT__RESTRICT stream);
+size_t _gpgrt_fwrite (const void *_GPGRT__RESTRICT ptr,
+ size_t size, size_t memb,
+ gpgrt_stream_t _GPGRT__RESTRICT stream);
+
+char *_gpgrt_fgets (char *_GPGRT__RESTRICT s, int n,
+ gpgrt_stream_t _GPGRT__RESTRICT stream);
+int _gpgrt_fputs (const char *_GPGRT__RESTRICT s,
+ gpgrt_stream_t _GPGRT__RESTRICT stream);
+int _gpgrt_fputs_unlocked (const char *_GPGRT__RESTRICT s,
+ gpgrt_stream_t _GPGRT__RESTRICT stream);
+
+gpgrt_ssize_t _gpgrt_getline (char *_GPGRT__RESTRICT *_GPGRT__RESTRICT lineptr,
+ size_t *_GPGRT__RESTRICT n,
+ gpgrt_stream_t stream);
+gpgrt_ssize_t _gpgrt_read_line (gpgrt_stream_t stream,
+ char **addr_of_buffer, size_t *length_of_buffer,
+ size_t *max_length);
+
+int _gpgrt_fprintf (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format, ...)
+ GPGRT_ATTR_PRINTF(2,3);
+int _gpgrt_fprintf_unlocked (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format, ...)
+ GPGRT_ATTR_PRINTF(2,3);
+
+int _gpgrt_vfprintf (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format, va_list ap)
+ GPGRT_ATTR_PRINTF(2,0);
+int _gpgrt_vfprintf_unlocked (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format, va_list ap)
+ GPGRT_ATTR_PRINTF(2,0);
+
+int _gpgrt_setvbuf (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ char *_GPGRT__RESTRICT buf, int mode, size_t size);
+
+void _gpgrt_set_binary (gpgrt_stream_t stream);
+int _gpgrt_set_nonblock (gpgrt_stream_t stream, int onoff);
+int _gpgrt_get_nonblock (gpgrt_stream_t stream);
+
+int _gpgrt_poll (gpgrt_poll_t *fds, unsigned int nfds, int timeout);
+
+gpgrt_stream_t _gpgrt_tmpfile (void);
+
+void _gpgrt_opaque_set (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ void *_GPGRT__RESTRICT opaque);
+void *_gpgrt_opaque_get (gpgrt_stream_t stream);
+
+void _gpgrt_fname_set (gpgrt_stream_t stream, const char *fname);
+const char *_gpgrt_fname_get (gpgrt_stream_t stream);
+
+#include "estream-printf.h"
+
+#if _WIN32
+/* Prototypes for w32-estream.c. */
+struct cookie_io_functions_s _gpgrt_functions_w32_pollable;
+int _gpgrt_w32_pollable_create (void *_GPGRT__RESTRICT *_GPGRT__RESTRICT cookie,
+ unsigned int modeflags,
+ struct cookie_io_functions_s next_functions,
+ void *next_cookie);
+int _gpgrt_w32_poll (gpgrt_poll_t *fds, size_t nfds, int timeout);
+#endif
+
+gpgrt_b64state_t _gpgrt_b64dec_start (const char *title);
+gpg_error_t _gpgrt_b64dec_proc (gpgrt_b64state_t state, void *buffer,
+ size_t length, size_t *r_nbytes);
+gpg_error_t _gpgrt_b64dec_finish (gpgrt_b64state_t state);
+
+
+#endif /*_GPGRT_GPGRT_INT_H*/
diff --git a/src/init.c b/src/init.c
new file mode 100644
index 0000000..b01e089
--- /dev/null
+++ b/src/init.c
@@ -0,0 +1,528 @@
+/* init.c - Initialize the GnuPG error library.
+ Copyright (C) 2005, 2010 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include "gpgrt-int.h"
+#include "gettext.h"
+#include "init.h"
+
+#ifdef HAVE_W32CE_SYSTEM
+# include "mkw32errmap.map.c" /* Generated map_w32codes () */
+# ifndef TLS_OUT_OF_INDEXES
+# define TLS_OUT_OF_INDEXES 0xFFFFFFFF
+# endif
+# ifndef __MINGW32CE__
+# /* Replace the Mingw32CE provided abort function. */
+# define abort() do { TerminateProcess (GetCurrentProcess(), 8); } while (0)
+# endif
+#endif
+
+
+/* Locale directory support. */
+
+#if HAVE_W32_SYSTEM
+
+#include <windows.h>
+
+static int tls_index = TLS_OUT_OF_INDEXES; /* Index for the TLS functions. */
+
+static char *get_locale_dir (void);
+static void drop_locale_dir (char *locale_dir);
+
+#else /*!HAVE_W32_SYSTEM*/
+
+#define get_locale_dir() LOCALEDIR
+#define drop_locale_dir(dir)
+
+#endif /*!HAVE_W32_SYSTEM*/
+
+
+/* The realloc function as set by gpgrt_set_alloc_func. */
+static void *(*custom_realloc)(void *a, size_t n);
+
+
+
+static void
+real_init (void)
+{
+#ifdef ENABLE_NLS
+ char *locale_dir;
+
+ /* We only have to bind our locale directory to our text domain. */
+ locale_dir = get_locale_dir ();
+ if (locale_dir)
+ {
+ bindtextdomain (PACKAGE, locale_dir);
+ drop_locale_dir (locale_dir);
+ }
+#endif
+ _gpgrt_estream_init ();
+}
+
+/* Initialize the library. This function should be run early. */
+gpg_error_t
+_gpg_err_init (void)
+{
+#ifdef HAVE_W32_SYSTEM
+# ifdef DLL_EXPORT
+ /* We always have a constructor and thus this function is called
+ automatically. Due to the way the C init code of mingw works,
+ the constructors are called before our DllMain function is
+ called. The problem with that is that the TLS has not been setup
+ and w32-gettext.c requires TLS. To solve this we do nothing here
+ but call the actual init code from our DllMain. */
+# else /*!DLL_EXPORT*/
+ /* Note that if the TLS is actually used, we can't release the TLS
+ as there is no way to know when a thread terminates (i.e. no
+ thread-specific-atexit). You are really better off to use the
+ DLL! */
+ if (tls_index == TLS_OUT_OF_INDEXES)
+ {
+ tls_index = TlsAlloc ();
+ if (tls_index == TLS_OUT_OF_INDEXES)
+ {
+ /* No way to continue - commit suicide. */
+ abort ();
+ }
+ _gpg_w32__init_gettext_module ();
+ real_init ();
+ }
+# endif /*!DLL_EXPORT*/
+#else
+ real_init ();
+#endif
+ return 0;
+}
+
+
+/* Deinitialize libgpg-error. This function is only used in special
+ circumstances. No gpg-error function should be used after this
+ function has been called. A value of 0 passed for MODE
+ deinitializes the entire libgpg-error, a value of 1 releases
+ resources allocated for the current thread and only that thread may
+ not anymore access libgpg-error after such a call. Under Windows
+ this function may be called from the DllMain function of a DLL
+ which statically links to libgpg-error. */
+void
+_gpg_err_deinit (int mode)
+{
+#if defined (HAVE_W32_SYSTEM) && !defined(DLL_EXPORT)
+ struct tls_space_s *tls;
+
+ tls = TlsGetValue (tls_index);
+ if (tls)
+ {
+ TlsSetValue (tls_index, NULL);
+ LocalFree (tls);
+ }
+
+ if (mode == 0)
+ {
+ TlsFree (tls_index);
+ tls_index = TLS_OUT_OF_INDEXES;
+ }
+#else
+ (void)mode;
+#endif
+}
+
+
+
+
+/* Register F as allocation function. This function is used for all
+ APIs which return an allocated buffer. F needs to have standard
+ realloc semantics. It should be called as early as possible and
+ not changed later. */
+void
+_gpgrt_set_alloc_func (void *(*f)(void *a, size_t n))
+{
+ custom_realloc = f;
+}
+
+
+/* The realloc to be used for data returned by the public API. */
+void *
+_gpgrt_realloc (void *a, size_t n)
+{
+ if (custom_realloc)
+ return custom_realloc (a, n);
+
+ if (!n)
+ {
+ free (a);
+ return NULL;
+ }
+
+ if (!a)
+ return malloc (n);
+
+ return realloc (a, n);
+}
+
+
+/* The malloc to be used for data returned by the public API. */
+void *
+_gpgrt_malloc (size_t n)
+{
+ if (!n)
+ n++;
+ return _gpgrt_realloc (NULL, n);
+}
+
+
+/* The free to be used for data returned by the public API. */
+void
+_gpgrt_free (void *a)
+{
+ _gpgrt_realloc (a, 0);
+}
+
+
+void
+_gpg_err_set_errno (int err)
+{
+#ifdef HAVE_W32CE_SYSTEM
+ SetLastError (err);
+#else /*!HAVE_W32CE_SYSTEM*/
+ errno = err;
+#endif /*!HAVE_W32CE_SYSTEM*/
+}
+
+
+
+/* Internal tracing functions. Except for TRACE_FP we use flockfile
+ * and funlockfile to protect their use. */
+static FILE *trace_fp;
+static int trace_save_errno;
+static int trace_with_errno;
+static const char *trace_arg_module;
+static const char *trace_arg_file;
+static int trace_arg_line;
+static int trace_missing_lf;
+static int trace_prefix_done;
+
+void
+_gpgrt_internal_trace_begin (const char *module, const char *file, int line,
+ int with_errno)
+{
+ int save_errno = errno;
+
+ if (!trace_fp)
+ {
+ FILE *fp;
+ const char *s = getenv ("GPGRT_TRACE_FILE");
+
+ if (!s || !(fp = fopen (s, "wb")))
+ fp = stderr;
+ trace_fp = fp;
+ }
+
+#ifdef HAVE_FLOCKFILE
+ flockfile (trace_fp);
+#endif
+ trace_save_errno = save_errno;
+ trace_with_errno = with_errno;
+ trace_arg_module = module;
+ trace_arg_file = file;
+ trace_arg_line = line;
+ trace_missing_lf = 0;
+ trace_prefix_done = 0;
+}
+
+static void
+print_internal_trace_prefix (void)
+{
+ if (!trace_prefix_done)
+ {
+ trace_prefix_done = 1;
+ fprintf (trace_fp, "%s:%s:%d: ",
+ trace_arg_module,/* npth_is_protected ()?"":"^",*/
+ trace_arg_file, trace_arg_line);
+ }
+}
+
+static void
+do_internal_trace (const char *format, va_list arg_ptr)
+{
+ print_internal_trace_prefix ();
+ vfprintf (trace_fp, format, arg_ptr);
+ if (trace_with_errno)
+ fprintf (trace_fp, " errno=%s", strerror (trace_save_errno));
+ if (*format && format[strlen(format)-1] != '\n')
+ fputc ('\n', trace_fp);
+}
+
+void
+_gpgrt_internal_trace_printf (const char *format, ...)
+{
+ va_list arg_ptr;
+
+ print_internal_trace_prefix ();
+ va_start (arg_ptr, format) ;
+ vfprintf (trace_fp, format, arg_ptr);
+ va_end (arg_ptr);
+ trace_missing_lf = (*format && format[strlen(format)-1] != '\n');
+}
+
+
+void
+_gpgrt_internal_trace (const char *format, ...)
+{
+ va_list arg_ptr;
+
+ va_start (arg_ptr, format) ;
+ do_internal_trace (format, arg_ptr);
+ va_end (arg_ptr);
+}
+
+
+void
+_gpgrt_internal_trace_end (void)
+{
+ int save_errno = trace_save_errno;
+
+ if (trace_missing_lf)
+ fputc ('\n', trace_fp);
+#ifdef HAVE_FLOCKFILE
+ funlockfile (trace_fp);
+#endif
+ errno = save_errno;
+}
+
+
+
+#ifdef HAVE_W32_SYSTEM
+/*****************************************
+ ******** Below is only Windows code. ****
+ *****************************************/
+
+static char *
+get_locale_dir (void)
+{
+ static wchar_t moddir[MAX_PATH+5];
+ char *result, *p;
+ int nbytes;
+
+ if (!GetModuleFileNameW (NULL, moddir, MAX_PATH))
+ *moddir = 0;
+
+#define SLDIR "\\share\\locale"
+ if (*moddir)
+ {
+ nbytes = WideCharToMultiByte (CP_UTF8, 0, moddir, -1, NULL, 0, NULL, NULL);
+ if (nbytes < 0)
+ return NULL;
+
+ result = malloc (nbytes + strlen (SLDIR) + 1);
+ if (result)
+ {
+ nbytes = WideCharToMultiByte (CP_UTF8, 0, moddir, -1,
+ result, nbytes, NULL, NULL);
+ if (nbytes < 0)
+ {
+ free (result);
+ result = NULL;
+ }
+ else
+ {
+ p = strrchr (result, '\\');
+ if (p)
+ *p = 0;
+ /* If we are installed below "bin" strip that part and
+ use the top directory instead.
+
+ Background: Under Windows we don't install GnuPG
+ below bin/ but in the top directory with only share/,
+ lib/, and etc/ below it. One of the reasons is to
+ keep the the length of the filenames at bay so not to
+ increase the limited length of the PATH envvar.
+ Another and more important reason, however, is that
+ the very first GPG versions on W32 were installed
+ into a flat directory structure and for best
+ compatibility with these versions we didn't changed
+ that later. For WindowsCE we can right away install
+ it under bin, though. The hack with detection of the
+ bin directory part allows us to eventually migrate to
+ such a directory layout under plain Windows without
+ the need to change libgpg-error. */
+ p = strrchr (result, '\\');
+ if (p && !strcmp (p+1, "bin"))
+ *p = 0;
+ /* Append the static part. */
+ strcat (result, SLDIR);
+ }
+ }
+ }
+ else /* Use the old default value. */
+ {
+ result = malloc (10 + strlen (SLDIR) + 1);
+ if (result)
+ {
+ strcpy (result, "c:\\gnupg");
+ strcat (result, SLDIR);
+ }
+ }
+#undef SLDIR
+ return result;
+}
+
+
+static void
+drop_locale_dir (char *locale_dir)
+{
+ free (locale_dir);
+}
+
+
+/* Return the tls object. This function is guaranteed to return a
+ valid non-NULL object. */
+struct tls_space_s *
+get_tls (void)
+{
+ struct tls_space_s *tls;
+
+ tls = TlsGetValue (tls_index);
+ if (!tls)
+ {
+ /* Called by a thread which existed before this DLL was loaded.
+ Allocate the space. */
+ tls = LocalAlloc (LPTR, sizeof *tls);
+ if (!tls)
+ {
+ /* No way to continue - commit suicide. */
+ abort ();
+ }
+ tls->gt_use_utf8 = 0;
+ TlsSetValue (tls_index, tls);
+ }
+
+ return tls;
+}
+
+
+/* Return the value of the ERRNO variable. This needs to be a
+ function so that we can have a per-thread ERRNO. This is used only
+ on WindowsCE because that OS misses an errno. */
+#ifdef HAVE_W32CE_SYSTEM
+int
+_gpg_w32ce_get_errno (void)
+{
+ return map_w32codes ( GetLastError () );
+}
+#endif /*HAVE_W32CE_SYSTEM*/
+
+
+/* Replacement strerror function for WindowsCE. */
+#ifdef HAVE_W32CE_SYSTEM
+char *
+_gpg_w32ce_strerror (int err)
+{
+ struct tls_space_s *tls = get_tls ();
+ wchar_t tmpbuf[STRBUFFER_SIZE];
+ int n;
+
+ if (err == -1)
+ err = _gpg_w32ce_get_errno ();
+
+ /* Note: On a German HTC Touch Pro2 device I also tried
+ LOCALE_USER_DEFAULT and LOCALE_SYSTEM_DEFAULT - both returned
+ English messages. */
+ if (FormatMessageW (FORMAT_MESSAGE_FROM_SYSTEM, NULL, err,
+ MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
+ tmpbuf, STRBUFFER_SIZE -1,
+ NULL))
+ {
+ n = WideCharToMultiByte (CP_UTF8, 0, tmpbuf, -1,
+ tls->strerror_buffer,
+ sizeof tls->strerror_buffer -1,
+ NULL, NULL);
+ }
+ else
+ n = -1;
+
+ if (n < 0)
+ snprintf (tls->strerror_buffer, sizeof tls->strerror_buffer -1,
+ "[w32err=%d]", err);
+ return tls->strerror_buffer;
+}
+#endif /*HAVE_W32CE_SYSTEM*/
+
+
+/* Entry point called by the DLL loader. */
+#ifdef DLL_EXPORT
+int WINAPI
+DllMain (HINSTANCE hinst, DWORD reason, LPVOID reserved)
+{
+ struct tls_space_s *tls;
+ (void)reserved;
+ (void)hinst;
+
+ switch (reason)
+ {
+ case DLL_PROCESS_ATTACH:
+ tls_index = TlsAlloc ();
+ if (tls_index == TLS_OUT_OF_INDEXES)
+ return FALSE;
+#ifndef _GPG_ERR_HAVE_CONSTRUCTOR
+ /* If we have not constructors (e.g. MSC) we call it here. */
+ _gpg_w32__init_gettext_module ();
+#endif
+ /* falltru. */
+ case DLL_THREAD_ATTACH:
+ tls = LocalAlloc (LPTR, sizeof *tls);
+ if (!tls)
+ return FALSE;
+ tls->gt_use_utf8 = 0;
+ TlsSetValue (tls_index, tls);
+ if (reason == DLL_PROCESS_ATTACH)
+ {
+ real_init ();
+ }
+ break;
+
+ case DLL_THREAD_DETACH:
+ tls = TlsGetValue (tls_index);
+ if (tls)
+ LocalFree (tls);
+ break;
+
+ case DLL_PROCESS_DETACH:
+ tls = TlsGetValue (tls_index);
+ if (tls)
+ LocalFree (tls);
+ TlsFree (tls_index);
+ break;
+
+ default:
+ break;
+ }
+
+ return TRUE;
+}
+#endif /*DLL_EXPORT*/
+
+#endif /*HAVE_W32_SYSTEM*/
diff --git a/src/init.h b/src/init.h
new file mode 100644
index 0000000..90a716a
--- /dev/null
+++ b/src/init.h
@@ -0,0 +1,70 @@
+/* init.h - Declarations for init.c
+ Copyright (C) 2010 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef INIT_H
+#define INIT_H
+
+#if HAVE_W32_SYSTEM
+
+/* Forward declaration - defined in w32-gettext.c. */
+struct loaded_domain;
+
+/* An item for a linked list of loaded domains. */
+struct domainlist_s
+{
+ struct domainlist_s *next;
+ char *dname; /* Directory name for the mo file. */
+ char *fname; /* File name for the MO file. */
+ int load_failed; /* True if loading the domain failed. */
+ struct loaded_domain *domain; /* NULL if not loaded. Never changed
+ once set to non-NULL. */
+ char name[1]; /* Name of the domain. Never changed
+ once set. */
+};
+
+
+
+/* 119 bytes for an error message should be enough. With this size we
+ can assume that the allocation does not take up more than 128 bytes
+ per thread. Note that this is only used for W32CE. */
+#define STRBUFFER_SIZE 120
+
+/* The TLS space definition. */
+struct tls_space_s
+{
+ /* Flag used by w32-gettext. */
+ int gt_use_utf8;
+
+#ifdef HAVE_W32CE_SYSTEM
+ char strerror_buffer[STRBUFFER_SIZE];
+#endif
+};
+
+/* Return the TLS. */
+struct tls_space_s *get_tls (void);
+
+
+/* Explicit constructor for w32-gettext.c */
+#ifndef DLL_EXPORT
+void _gpg_w32__init_gettext_module (void);
+#endif
+
+#endif /*HAVE_W32_SYSTEM*/
+
+#endif /*INIT_H*/
diff --git a/src/lock.h b/src/lock.h
new file mode 100644
index 0000000..b7395db
--- /dev/null
+++ b/src/lock.h
@@ -0,0 +1,26 @@
+/* lock.h - Declarations for *-lock.c
+ Copyright (C) 2014 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef LOCK_H
+#define LOCK_H
+
+void _gpgrt_lock_set_lock_clamp (void (*pre)(void), void (*post)(void));
+
+
+#endif /*LOCK_H*/
diff --git a/src/mkerrcodes.awk b/src/mkerrcodes.awk
new file mode 100644
index 0000000..46d436c
--- /dev/null
+++ b/src/mkerrcodes.awk
@@ -0,0 +1,99 @@
+# mkerrcodes.awk
+# Copyright (C) 2004, 2005 g10 Code GmbH
+#
+# 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, g10 Code GmbH gives unlimited permission to
+# copy, distribute and modify the C source files that are the output
+# of mkerrcodes.awk. You need not follow the terms of the GNU General
+# Public License when using or distributing such scripts, even though
+# portions of the text of mkerrcodes.awk appear in them. The GNU
+# General Public License (GPL) does govern all other use of the material
+# that constitutes the mkerrcodes.awk program.
+#
+# Certain portions of the mkerrcodes.awk source text are designed to be
+# copied (in certain cases, depending on the input) into the output of
+# mkerrcodes.awk. We call these the "data" portions. The rest of the
+# mkerrcodes.awk source text consists of comments plus executable code
+# that decides which of the data portions to output in any given case.
+# We call these comments and executable code the "non-data" portions.
+# mkerrcodes.h never copies any of the non-data portions into its output.
+#
+# This special exception to the GPL applies to versions of mkerrcodes.awk
+# released by g10 Code GmbH. When you make and distribute a modified version
+# of mkerrcodes.awk, you may extend this special exception to the GPL to
+# apply to your modified version as well, *unless* your modified version
+# has the potential to copy into its output some of the text that was the
+# non-data portion of the version that you started with. (In other words,
+# unless your change moves or copies text from the non-data portions to the
+# data portions.) If your modification has such potential, you must delete
+# any notice of this special exception to the GPL from your modified version.
+
+# This script outputs an intermediate file that contains the following output:
+# static struct
+# {
+# int err;
+# const char *err_sym;
+# } err_table[] =
+# {
+# { 7, "GPG_ERR_E2BIG" },
+# [...]
+# };
+#
+# The input file is a list of possible system errors, followed by a GPG_ERR_* name:
+#
+# 7 GPG_ERR_E2BIG
+#
+# Comments (starting with # and ending at the end of the line) are removed,
+# as is trailing whitespace.
+
+BEGIN {
+ FS="[ \t]+GPG_ERR_";
+ print "/* Output of mkerrcodes.awk. DO NOT EDIT. */";
+ print "";
+ header = 1;
+}
+
+/^#/ { next; }
+
+header {
+ if (! /^[ \t]*$/)
+ {
+ header = 0;
+
+ print "static struct";
+ print " {";
+ print " int err;";
+ print " const char *err_sym;";
+ print " } err_table[] = ";
+ print "{";
+ }
+ else
+ print;
+}
+
+!header {
+ sub (/\#.+/, "");
+ sub (/[ ]+$/, ""); # Strip trailing space and tab characters.
+
+ if (/^$/)
+ next;
+
+ print " { " $1 ", \"GPG_ERR_" $2 "\" },";
+}
+
+END {
+ print "};";
+}
diff --git a/src/mkerrcodes.c b/src/mkerrcodes.c
new file mode 100644
index 0000000..29c1cc2
--- /dev/null
+++ b/src/mkerrcodes.c
@@ -0,0 +1,78 @@
+/* mkerrcodes.c - Generate list of system error values.
+ Copyright (C) 2004 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with libgpg-error; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+/* This file must not include config.h, as that is for the host
+ system, while this file will be run on the build system. */
+
+#include <stdio.h>
+
+#include "mkerrcodes.h"
+
+static const char header[] =
+"/* errnos.h - List of system error values.\n"
+" Copyright (C) 2004 g10 Code GmbH\n"
+" This file is part of libgpg-error.\n"
+"\n"
+" libgpg-error is free software; you can redistribute it and/or\n"
+" modify it under the terms of the GNU Lesser General Public License\n"
+" as published by the Free Software Foundation; either version 2.1 of\n"
+" the License, or (at your option) any later version.\n"
+"\n"
+" libgpg-error is distributed in the hope that it will be useful, but\n"
+" WITHOUT ANY WARRANTY; without even the implied warranty of\n"
+" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
+" Lesser General Public License for more details.\n"
+"\n"
+" You should have received a copy of the GNU Lesser General Public\n"
+" License along with libgpg-error; if not, write to the Free\n"
+" Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\n"
+" 02111-1307, USA. */\n"
+"\n";
+
+int
+main (int argc, char **argv)
+{
+ int sorted;
+ int i;
+
+ printf ("%s", header);
+ do
+ {
+ sorted = 1;
+ for (i = 0; i < sizeof (err_table) / sizeof (err_table[0]) - 1; i++)
+ if (err_table[i].err > err_table[i + 1].err)
+ {
+ int err = err_table[i].err;
+ const char *err_sym = err_table[i].err_sym;
+
+ err_table[i].err = err_table[i + 1].err;
+ err_table[i].err_sym = err_table[i + 1].err_sym;
+ err_table[i + 1].err = err;
+ err_table[i + 1].err_sym = err_sym;
+ sorted = 0;
+ }
+ }
+ while (!sorted);
+
+ for (i = 0; i < sizeof (err_table) / sizeof (err_table[0]); i++)
+ printf ("%i\t%s\n", err_table[i].err, err_table[i].err_sym);
+
+ return 0;
+}
diff --git a/src/mkerrcodes1.awk b/src/mkerrcodes1.awk
new file mode 100644
index 0000000..a771a73
--- /dev/null
+++ b/src/mkerrcodes1.awk
@@ -0,0 +1,96 @@
+# mkerrcodes.awk
+# Copyright (C) 2003, 2004 g10 Code GmbH
+#
+# 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, g10 Code GmbH gives unlimited permission to
+# copy, distribute and modify the C source files that are the output
+# of mkerrcodes.awk. You need not follow the terms of the GNU General
+# Public License when using or distributing such scripts, even though
+# portions of the text of mkerrcodes.awk appear in them. The GNU
+# General Public License (GPL) does govern all other use of the material
+# that constitutes the mkerrcodes.awk program.
+#
+# Certain portions of the mkerrcodes.awk source text are designed to be
+# copied (in certain cases, depending on the input) into the output of
+# mkerrcodes.awk. We call these the "data" portions. The rest of the
+# mkerrcodes.awk source text consists of comments plus executable code
+# that decides which of the data portions to output in any given case.
+# We call these comments and executable code the "non-data" portions.
+# mkerrcodes.h never copies any of the non-data portions into its output.
+#
+# This special exception to the GPL applies to versions of mkerrcodes.awk
+# released by g10 Code GmbH. When you make and distribute a modified version
+# of mkerrcodes.awk, you may extend this special exception to the GPL to
+# apply to your modified version as well, *unless* your modified version
+# has the potential to copy into its output some of the text that was the
+# non-data portion of the version that you started with. (In other words,
+# unless your change moves or copies text from the non-data portions to the
+# data portions.) If your modification has such potential, you must delete
+# any notice of this special exception to the GPL from your modified version.
+
+# This script outputs an intermediate file that contains the following block
+# for each error value symbol in the input file (example for EINVAL):
+#
+# #ifdef EINVAL
+# EINVAL GPG_ERR_EINVAL
+# #endif
+#
+# The input file is a list of possible system errors in the column errnoidx
+# (defaults to 2).
+#
+# Comments (starting with # and ending at the end of the line) are removed,
+# as is trailing whitespace.
+
+BEGIN {
+ FS="[\t]+";
+ header = 1;
+ if (errnoidx == 0)
+ errnoidx = 2;
+
+ print "/* Output of mkerrcodes.awk. DO NOT EDIT. */";
+ print "";
+}
+
+/^#/ { next; }
+
+header {
+ if ($1 ~ /^[0-9]/)
+ {
+ print "#include <errno.h>";
+ print "#ifdef _WIN32";
+ print "#include <winsock2.h>";
+ print "#endif";
+ print "";
+ header = 0;
+ }
+ else
+ print;
+}
+
+!header {
+ sub (/\#.+/, "");
+ sub (/[ ]+$/, ""); # Strip trailing space and tab characters.
+
+ if (/^$/)
+ next;
+
+ print "#ifdef " $errnoidx;
+ print $errnoidx "\tGPG_ERR_" $errnoidx;
+ print "#endif";
+ print "#ifdef WSA" $errnoidx;
+ print "WSA" $errnoidx "\tGPG_ERR_" $errnoidx;
+ print "#endif";
+}
diff --git a/src/mkerrcodes2.awk b/src/mkerrcodes2.awk
new file mode 100644
index 0000000..ea58503
--- /dev/null
+++ b/src/mkerrcodes2.awk
@@ -0,0 +1,134 @@
+# mkstrtable.awk
+# Copyright (C) 2003 g10 Code GmbH
+#
+# 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, g10 Code GmbH gives unlimited permission to
+# copy, distribute and modify the C source files that are the output
+# of mkerrcodes2.awk. You need not follow the terms of the GNU General
+# Public License when using or distributing such scripts, even though
+# portions of the text of mkerrcodes2.awk appear in them. The GNU
+# General Public License (GPL) does govern all other use of the material
+# that constitutes the mkerrcodes2.awk program.
+#
+# Certain portions of the mkerrcodes2.awk source text are designed to be
+# copied (in certain cases, depending on the input) into the output of
+# mkerrcodes2.awk. We call these the "data" portions. The rest of the
+# mkerrcodes2.awk source text consists of comments plus executable code
+# that decides which of the data portions to output in any given case.
+# We call these comments and executable code the "non-data" portions.
+# mkstrtable.h never copies any of the non-data portions into its output.
+#
+# This special exception to the GPL applies to versions of mkerrcodes2.awk
+# released by g10 Code GmbH. When you make and distribute a modified version
+# of mkerrcodes2.awk, you may extend this special exception to the GPL to
+# apply to your modified version as well, *unless* your modified version
+# has the potential to copy into its output some of the text that was the
+# non-data portion of the version that you started with. (In other words,
+# unless your change moves or copies text from the non-data portions to the
+# data portions.) If your modification has such potential, you must delete
+# any notice of this special exception to the GPL from your modified version.
+
+# This script outputs a source file that does define the following
+# symbols:
+#
+# static const char msgstr[];
+# A string containing all messages in the list.
+#
+# static const int msgidx[];
+# A list of index numbers, one for each message, that points to the
+# beginning of the string in msgstr.
+#
+# msgidxof (code);
+# A macro that maps code numbers to idx numbers. If a DEFAULT MESSAGE
+# is provided (see below), its index will be returned for unknown codes.
+# Otherwise -1 is returned for codes that do not appear in the list.
+# You can lookup the message with code CODE with:
+# msgstr + msgidx[msgidxof (code)].
+#
+# The input file has the following format:
+# CODE1 MESSAGE1 (Code number, <tab>, message string)
+# CODE2 MESSAGE2 (Code number, <tab>, message string)
+# ...
+# CODEn MESSAGEn (Code number, <tab>, message string)
+# DEFAULT MESSAGE (<tab>, fall-back message string)
+#
+# Comments (starting with # and ending at the end of the line) are removed,
+# as is trailing whitespace. The last line is optional; if no DEFAULT
+# MESSAGE is given, msgidxof will return the number -1 for unknown
+# index numbers.
+
+BEGIN {
+# msg holds the number of messages.
+ msg = 0;
+ print "/* Output of mkerrcodes2.awk. DO NOT EDIT. */";
+ print "";
+ header = 1;
+}
+
+/^#/ { next; }
+
+header {
+ if ($1 ~ /^[0123456789]+$/)
+ {
+ print "static const int err_code_from_index[] = {";
+ header = 0;
+ }
+ else
+ print;
+}
+
+!header {
+ sub (/\#.+/, "");
+ sub (/[ ]+$/, ""); # Strip trailing space and tab characters.
+
+ if (/^$/)
+ next;
+
+# Print the string msgstr line by line. We delay output by one line to be able
+# to treat the last line differently (see END).
+ print " " $2 ",";
+
+# Remember the error value and index of each error code.
+ code[msg] = $1;
+ pos[msg] = $2;
+ msg++;
+}
+END {
+ print "};";
+ print "";
+ print "#define errno_to_idx(code) (0 ? -1 \\";
+
+# Gather the ranges.
+ skip = code[0];
+ start = code[0];
+ stop = code[0];
+ for (i = 1; i < msg; i++)
+ {
+ if (code[i] == stop + 1)
+ stop++;
+ else
+ {
+ print " : ((code >= " start ") && (code <= " stop ")) ? (code - " \
+ skip ") \\";
+ skip += code[i] - stop - 1;
+ start = code[i];
+ stop = code[i];
+ }
+ }
+ print " : ((code >= " start ") && (code <= " stop ")) ? (code - " \
+ skip ") \\";
+ print " : -1)";
+}
diff --git a/src/mkerrnos.awk b/src/mkerrnos.awk
new file mode 100644
index 0000000..f79df66
--- /dev/null
+++ b/src/mkerrnos.awk
@@ -0,0 +1,104 @@
+# mkerrnos.awk
+# Copyright (C) 2003, 2004 g10 Code GmbH
+#
+# 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, g10 Code GmbH gives unlimited permission to
+# copy, distribute and modify the C source files that are the output
+# of mkerrnos.awk. You need not follow the terms of the GNU General
+# Public License when using or distributing such scripts, even though
+# portions of the text of mkerrnos.awk appear in them. The GNU
+# General Public License (GPL) does govern all other use of the material
+# that constitutes the mkerrnos.awk program.
+#
+# Certain portions of the mkerrnos.awk source text are designed to be
+# copied (in certain cases, depending on the input) into the output of
+# mkerrnos.awk. We call these the "data" portions. The rest of the
+# mkerrnos.awk source text consists of comments plus executable code
+# that decides which of the data portions to output in any given case.
+# We call these comments and executable code the "non-data" portions.
+# mkerrnos.h never copies any of the non-data portions into its output.
+#
+# This special exception to the GPL applies to versions of mkerrnos.awk
+# released by g10 Code GmbH. When you make and distribute a modified version
+# of mkerrnos.awk, you may extend this special exception to the GPL to
+# apply to your modified version as well, *unless* your modified version
+# has the potential to copy into its output some of the text that was the
+# non-data portion of the version that you started with. (In other words,
+# unless your change moves or copies text from the non-data portions to the
+# data portions.) If your modification has such potential, you must delete
+# any notice of this special exception to the GPL from your modified version.
+
+# This script outputs a source file that does define the following
+# symbols:
+#
+# static const int err_code_to_errno[];
+# A mapping of gpg_err_code_t numbers to system errno. The index of an
+# error code in the table can be obtained after removing the system error
+# code indication bit.
+#
+# The input file is a list of possible system errors in the column errnoidx
+# (defaults to 2).
+#
+# Comments (starting with # and ending at the end of the line) are removed,
+# as is trailing whitespace.
+
+BEGIN {
+ FS="[\t]+";
+ header = 1;
+ if (errnoidx == 0)
+ errnoidx = 2;
+
+ print "/* Output of mkerrnos.awk. DO NOT EDIT. */";
+ print "";
+}
+
+/^#/ { next; }
+
+header {
+ if ($1 ~ /^[0-9]/)
+ {
+ print "#include <errno.h>";
+ print "#ifdef _WIN32";
+ print "#include <winsock2.h>";
+ print "#endif";
+ print "";
+ print "static const int err_code_to_errno [] = {";
+ header = 0;
+ }
+ else
+ print;
+}
+
+!header {
+ sub (/\#.+/, "");
+ sub (/[ ]+$/, ""); # Strip trailing space and tab characters.
+
+ if (/^$/)
+ next;
+
+ print "#ifdef " $errnoidx;
+ print " " $errnoidx ",";
+ print "#else";
+ print "#ifdef WSA" $errnoidx;
+ print " WSA" $errnoidx ",";
+ print "#else";
+ print " 0,";
+ print "#endif";
+ print "#endif";
+}
+END {
+ print "};";
+}
diff --git a/src/mkheader.c b/src/mkheader.c
new file mode 100644
index 0000000..997cab5
--- /dev/null
+++ b/src/mkheader.c
@@ -0,0 +1,658 @@
+/* mkheader.c - Create a header file for libgpg-error
+ * Copyright (C) 2010 Free Software Foundation, Inc.
+ * Copyright (C) 2014 g10 Code GmbH
+ *
+ * This file is free software; as a special exception the author gives
+ * unlimited permission to copy and/or distribute it, with or without
+ * modifications, as long as this notice is preserved.
+ *
+ * This file 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.
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+
+#define PGM "mkheader"
+
+#define LINESIZE 1024
+
+static const char *host_os;
+static char *host_triplet;
+static char *srcdir;
+static const char *hdr_version;
+static const char *hdr_version_number;
+
+/* Values take from the supplied config.h. */
+static int have_stdint_h;
+static int have_w32_system;
+static int have_w64_system;
+static char *replacement_for_off_type;
+static int use_posix_threads;
+
+/* Various state flags. */
+static int stdint_h_included;
+
+
+/* The usual free wrapper. */
+static void
+xfree (void *a)
+{
+ if (a)
+ free (a);
+}
+
+
+static char *
+xstrdup (const char *string)
+{
+ char *p;
+ size_t len = strlen (string) + 1;
+
+ p = malloc (len);
+ if (!p)
+ {
+ fputs (PGM ": out of core\n", stderr);
+ exit (1);
+ }
+ memcpy (p, string, len);
+ return p;
+}
+
+
+/* Return a malloced string with TRIPLET. If TRIPLET has an alias
+ return that instead. In general build-aux/config.sub should do the
+ aliasing but some returned triplets are anyway identical and thus we
+ use this function to map it to the canonical form. */
+static char *
+canon_host_triplet (const char *triplet)
+{
+ struct {
+ const char *name;
+ const char *alias;
+ } tbl[] = {
+ {"i486-pc-linux-gnu", "i686-pc-linux-gnu" },
+ {"i586-pc-linux-gnu" },
+ {"i486-pc-gnu", "i686-pc-gnu"},
+ {"i586-pc-gnu"},
+ {"i486-pc-kfreebsd-gnu", "i686-pc-kfreebsd-gnu"},
+ {"i586-pc-kfreebsd-gnu"},
+
+ {"x86_64-pc-linux-gnuhardened1", "x86_64-pc-linux-gnu" },
+
+ {"powerpc-unknown-linux-gnuspe", "powerpc-unknown-linux-gnu" },
+
+ {"arm-unknown-linux-gnueabihf", "arm-unknown-linux-gnueabi" },
+ {"armv7-unknown-linux-gnueabihf" },
+ {"armv5-unknown-linux-musleabi" },
+ {"armv6-unknown-linux-musleabihf" },
+
+ { NULL }
+ };
+ int i;
+ const char *lastalias = NULL;
+
+ for (i=0; tbl[i].name; i++)
+ {
+ if (tbl[i].alias)
+ lastalias = tbl[i].alias;
+ if (!strcmp (tbl[i].name, triplet))
+ {
+ if (!lastalias)
+ break; /* Ooops: first entry has no alias. */
+ return xstrdup (lastalias);
+ }
+ }
+ return xstrdup (triplet);
+}
+
+
+/* Parse the supplied config.h file and extract required info.
+ Returns 0 on success. */
+static int
+parse_config_h (const char *fname)
+{
+ FILE *fp;
+ char line[LINESIZE];
+ int lnr = 0;
+ char *p1;
+
+ fp = fopen (fname, "r");
+ if (!fp)
+ {
+ fprintf (stderr, "%s:%d: can't open file: %s",
+ fname, lnr, strerror (errno));
+ return 1;
+ }
+
+ while (fgets (line, LINESIZE, fp))
+ {
+ size_t n = strlen (line);
+
+ lnr++;
+ if (!n || line[n-1] != '\n')
+ {
+ fprintf (stderr,
+ "%s:%d: trailing linefeed missing, line too long or "
+ "embedded nul character\n", fname, lnr);
+ break;
+ }
+ line[--n] = 0;
+
+ if (strncmp (line, "#define ", 8))
+ continue; /* We are only interested in define lines. */
+ p1 = strtok (line + 8, " \t");
+ if (!*p1)
+ continue; /* oops */
+ if (!strcmp (p1, "HAVE_STDINT_H"))
+ have_stdint_h = 1;
+ else if (!strcmp (p1, "HAVE_W32_SYSTEM"))
+ have_w32_system = 1;
+ else if (!strcmp (p1, "HAVE_W64_SYSTEM"))
+ have_w64_system = 1;
+ else if (!strcmp (p1, "REPLACEMENT_FOR_OFF_T"))
+ {
+ p1 = strtok (NULL, "\"");
+ if (!*p1)
+ continue; /* oops */
+ xfree (replacement_for_off_type);
+ replacement_for_off_type = xstrdup (p1);
+ }
+ else if (!strcmp (p1, "USE_POSIX_THREADS"))
+ use_posix_threads = 1;
+ }
+
+ if (ferror (fp))
+ {
+ fprintf (stderr, "%s:%d: error reading file: %s\n",
+ fname, lnr, strerror (errno));
+ return 1;
+ }
+
+ fclose (fp);
+ return 0;
+}
+
+
+/* Write LINE to stdout. The function is allowed to modify LINE. */
+static void
+write_str (char *line)
+{
+ if (fputs (line, stdout) == EOF)
+ {
+ fprintf (stderr, PGM ": error writing to stdout: %s\n", strerror (errno));
+ exit (1);
+ }
+}
+
+static void
+write_line (char *line)
+{
+ if (puts (line) == EOF)
+ {
+ fprintf (stderr, PGM ": error writing to stdout: %s\n", strerror (errno));
+ exit (1);
+ }
+}
+
+
+/* Write SOURCE or CODES line to stdout. The function is allowed to
+ modify LINE. Trailing white space is already removed. Passing
+ NULL resets the internal state. */
+static void
+write_sources_or_codes (char *line)
+{
+ static int in_intro;
+ char *p1, *p2;
+
+ if (!line)
+ {
+ in_intro = 1;
+ return;
+ }
+
+ if (!*line)
+ return;
+
+ if (in_intro)
+ {
+ if (!strchr ("0123456789", *line))
+ return;
+ in_intro = 0;
+ }
+
+ p1 = strtok (line, " \t");
+ p2 = p1? strtok (NULL, " \t") : NULL;
+
+ if (p1 && p2 && strchr ("0123456789", *p1) && *p2)
+ {
+ write_str (" ");
+ write_str (p2);
+ write_str (" = ");
+ write_str (p1);
+ write_str (",\n");
+ }
+}
+
+
+/* Write system errnos to stdout. The function is allowed to
+ modify LINE. Trailing white space is already removed. Passing
+ NULL resets the internal state. */
+static void
+write_errnos_in (char *line)
+{
+ static int state;
+ char *p1, *p2;
+
+ if (!line)
+ {
+ state = 0;
+ return;
+ }
+
+ if (!*line)
+ return;
+
+ if (!state && strchr ("0123456789", *line))
+ state = 1;
+ else if (state == 1 && !strchr ("0123456789", *line))
+ state = 2;
+
+ if (state != 1)
+ return;
+
+ p1 = strtok (line, " \t");
+ p2 = p1? strtok (NULL, " \t") : NULL;
+
+ if (p1 && p2 && strchr ("0123456789", *p1) && *p2)
+ {
+ write_str (" GPG_ERR_");
+ write_str (p2);
+ write_str (" = GPG_ERR_SYSTEM_ERROR | ");
+ write_str (p1);
+ write_str (",\n");
+ }
+}
+
+
+/* Create the full file name for NAME and return a newly allocated
+ string with it. If name contains a '&' and REPL is not NULL
+ replace '&' with REPL. */
+static char *
+mk_include_name (const char *name, const char *repl)
+{
+ FILE *fp;
+ char *incfname, *p;
+ const char *s;
+
+ incfname = malloc (strlen (srcdir) + strlen (name)
+ + (repl?strlen (repl):0) + 1);
+ if (!incfname)
+ {
+ fputs (PGM ": out of core\n", stderr);
+ exit (1);
+ }
+
+ if (*name == '.' && name[1] == '/')
+ *incfname = 0;
+ else
+ strcpy (incfname, srcdir);
+ p = incfname + strlen (incfname);
+ for (s=name; *s; s++)
+ {
+ if (*s == '&' && repl)
+ {
+ while (*repl)
+ *p++ = *repl++;
+ repl = NULL; /* Replace only once. */
+ }
+ else
+ *p++ = *s;
+ }
+ *p = 0;
+ return incfname;
+}
+
+
+/* Include the file NAME from the source directory. The included file
+ is not further expanded. It may have comments indicated by a
+ double hash mark at the begin of a line. OUTF is called for each
+ read line and passed a buffer with the content of line sans line
+ line endings. If NAME is prefixed with "./" it is included from
+ the current directory and not from the source directory. */
+static void
+include_file (const char *fname, int lnr, const char *name, void (*outf)(char*))
+{
+ FILE *fp;
+ char *incfname;
+ int inclnr;
+ char line[LINESIZE];
+ int repl_flag;
+
+ repl_flag = !!strchr (name, '&');
+ incfname = mk_include_name (name, repl_flag? host_triplet : NULL);
+ fp = fopen (incfname, "r");
+ if (!fp && repl_flag)
+ {
+ /* Try again using the OS string. */
+ free (incfname);
+ incfname = mk_include_name (name, host_os);
+ fp = fopen (incfname, "r");
+ }
+ if (!fp)
+ {
+ fprintf (stderr, "%s:%d: error including `%s': %s\n",
+ fname, lnr, incfname, strerror (errno));
+ exit (1);
+ }
+
+ if (repl_flag)
+ fprintf (stderr,"%s:%d: note: including '%s'\n",
+ fname, lnr, incfname);
+
+ inclnr = 0;
+ while (fgets (line, LINESIZE, fp))
+ {
+ size_t n = strlen (line);
+
+ inclnr++;
+ if (!n || line[n-1] != '\n')
+ {
+ fprintf (stderr,
+ "%s:%d: trailing linefeed missing, line too long or "
+ "embedded nul character\n", incfname, inclnr);
+ fprintf (stderr,"%s:%d: note: file '%s' included from here\n",
+ fname, lnr, incfname);
+ exit (1);
+ }
+ line[--n] = 0;
+ while (line[n] == ' ' || line[n] == '\t' || line[n] == '\r')
+ {
+ line[n] = 0;
+ if (!n)
+ break;
+ n--;
+ }
+
+ if (line[0] == '#' && line[1] == '#')
+ {
+ if (!strncmp (line+2, "EOF##", 5))
+ break; /* Forced EOF. */
+ }
+ else
+ outf (line);
+ }
+ if (ferror (fp))
+ {
+ fprintf (stderr, "%s:%d: error reading `%s': %s\n",
+ fname, lnr, incfname, strerror (errno));
+ exit (1);
+ }
+ fclose (fp);
+ free (incfname);
+}
+
+
+/* Try to include the file NAME. Returns true if it does not
+ exist. */
+static int
+try_include_file (const char *fname, int lnr, const char *name,
+ void (*outf)(char*))
+{
+ int rc;
+ char *incfname;
+ int repl_flag;
+
+ repl_flag = !!strchr (name, '&');
+ incfname = mk_include_name (name, repl_flag? host_triplet : NULL);
+ rc = access (incfname, R_OK);
+ if (rc && repl_flag)
+ {
+ free (incfname);
+ incfname = mk_include_name (name, host_os);
+ rc = access (incfname, R_OK);
+ }
+ if (!rc)
+ include_file (fname, lnr, name, outf);
+
+ free (incfname);
+ return rc;
+}
+
+
+static int
+write_special (const char *fname, int lnr, const char *tag)
+{
+ if (!strcmp (tag, "version"))
+ {
+ putchar ('\"');
+ fputs (hdr_version, stdout);
+ putchar ('\"');
+ }
+ else if (!strcmp (tag, "version-number"))
+ {
+ fputs (hdr_version_number, stdout);
+ }
+ else if (!strcmp (tag, "define:gpgrt_off_t"))
+ {
+ if (!replacement_for_off_type)
+ {
+ fprintf (stderr, "%s:%d: replacement for off_t not defined\n",
+ fname, lnr);
+ exit (1);
+ }
+ else
+ {
+ if (!strcmp (replacement_for_off_type, "int64_t")
+ && !stdint_h_included && have_stdint_h)
+ {
+ fputs ("#include <stdint.h>\n\n", stdout);
+ stdint_h_included = 1;
+ }
+ printf ("typedef %s gpgrt_off_t;\n", replacement_for_off_type);
+ }
+ }
+ else if (!strcmp (tag, "define:gpgrt_ssize_t"))
+ {
+ if (have_w64_system)
+ {
+ if (!stdint_h_included && have_stdint_h)
+ {
+ fputs ("# include <stdint.h>\n", stdout);
+ stdint_h_included = 1;
+ }
+ fputs ("typedef int64_t gpgrt_ssize_t;\n", stdout);
+ }
+ else if (have_w32_system)
+ {
+ fputs ("typedef long gpgrt_ssize_t;\n", stdout);
+ }
+ else
+ {
+ fputs ("#include <sys/types.h>\n"
+ "typedef ssize_t gpgrt_ssize_t;\n", stdout);
+ }
+ }
+ else if (!strcmp (tag, "api_ssize_t"))
+ {
+ if (have_w32_system)
+ fputs ("gpgrt_ssize_t", stdout);
+ else
+ fputs ("ssize_t", stdout);
+ }
+ else if (!strcmp (tag, "include:err-sources"))
+ {
+ write_sources_or_codes (NULL);
+ include_file (fname, lnr, "err-sources.h.in", write_sources_or_codes);
+ }
+ else if (!strcmp (tag, "include:err-codes"))
+ {
+ write_sources_or_codes (NULL);
+ include_file (fname, lnr, "err-codes.h.in", write_sources_or_codes);
+ }
+ else if (!strcmp (tag, "include:errnos"))
+ {
+ include_file (fname, lnr, "errnos.in", write_errnos_in);
+ }
+ else if (!strcmp (tag, "include:os-add"))
+ {
+ if (!strcmp (host_os, "mingw32"))
+ {
+ include_file (fname, lnr, "w32-add.h", write_line);
+ }
+ else if (!strcmp (host_os, "mingw32ce"))
+ {
+ include_file (fname, lnr, "w32-add.h", write_line);
+ include_file (fname, lnr, "w32ce-add.h", write_line);
+ }
+ }
+ else if (!strcmp (tag, "include:lock-obj"))
+ {
+ if (try_include_file (fname, lnr, "./lock-obj-pub.native.h", write_line))
+ include_file (fname, lnr, "syscfg/lock-obj-pub.&.h", write_line);
+ }
+ else
+ return 0; /* Unknown tag. */
+
+ return 1; /* Tag processed. */
+}
+
+
+int
+main (int argc, char **argv)
+{
+ FILE *fp;
+ char line[LINESIZE];
+ int lnr = 0;
+ const char *fname, *s;
+ char *p1, *p2;
+ const char *config_h;
+ const char *host_triplet_raw;
+
+ if (argc)
+ {
+ argc--; argv++;
+ }
+
+ if (argc != 6)
+ {
+ fputs ("usage: " PGM
+ " host_os host_triplet template.h config.h"
+ " version version_number\n",
+ stderr);
+ return 1;
+ }
+ host_os = argv[0];
+ host_triplet_raw = argv[1];
+ fname = argv[2];
+ config_h = argv[3];
+ hdr_version = argv[4];
+ hdr_version_number = argv[5];
+
+ host_triplet = canon_host_triplet (host_triplet_raw);
+
+ srcdir = malloc (strlen (fname) + 2 + 1);
+ if (!srcdir)
+ {
+ fputs (PGM ": out of core\n", stderr);
+ return 1;
+ }
+ strcpy (srcdir, fname);
+ p1 = strrchr (srcdir, '/');
+ if (p1)
+ p1[1] = 0;
+ else
+ strcpy (srcdir, "./");
+
+ if (parse_config_h (config_h))
+ return 1;
+
+ fp = fopen (fname, "r");
+ if (!fp)
+ {
+ fprintf (stderr, "%s:%d: can't open file: %s",
+ fname, lnr, strerror (errno));
+ return 1;
+ }
+
+ while (fgets (line, LINESIZE, fp))
+ {
+ size_t n = strlen (line);
+
+ lnr++;
+ if (!n || line[n-1] != '\n')
+ {
+ fprintf (stderr,
+ "%s:%d: trailing linefeed missing, line too long or "
+ "embedded nul character\n", fname, lnr);
+ break;
+ }
+ line[--n] = 0;
+
+ p1 = strchr (line, '@');
+ p2 = p1? strchr (p1+1, '@') : NULL;
+ if (!p1 || !p2 || p2-p1 == 1)
+ {
+ puts (line);
+ continue;
+ }
+ *p1++ = 0;
+ *p2++ = 0;
+ fputs (line, stdout);
+
+ if (!strcmp (p1, "configure_input"))
+ {
+ s = strrchr (fname, '/');
+ printf ("Do not edit. Generated from %s for:\n%*s",
+ s? s+1 : fname, (int)(p1 - line) + 13, "");
+ if (!strcmp (host_triplet, host_triplet_raw))
+ printf ("%s", host_triplet);
+ else
+ printf ("%s (%s)", host_triplet, host_triplet_raw);
+ if (!use_posix_threads && !have_w32_system && !have_w64_system)
+ fputs (" NO-THREADS", stdout);
+ fputs (p2, stdout);
+ }
+ else if (!write_special (fname, lnr, p1))
+ {
+ putchar ('@');
+ fputs (p1, stdout);
+ putchar ('@');
+ fputs (p2, stdout);
+ }
+ else if (*p2)
+ {
+ fputs (p2, stdout);
+ }
+ putchar ('\n');
+ }
+
+ if (ferror (fp))
+ {
+ fprintf (stderr, "%s:%d: error reading file: %s\n",
+ fname, lnr, strerror (errno));
+ return 1;
+ }
+
+ fputs ("/*\n"
+ "Loc" "al Variables:\n"
+ "buffer-read-only: t\n"
+ "End:\n"
+ "*/\n", stdout);
+
+ if (ferror (stdout))
+ {
+ fprintf (stderr, PGM ": error writing to stdout: %s\n", strerror (errno));
+ return 1;
+ }
+
+ fclose (fp);
+
+ xfree (host_triplet);
+ return 0;
+}
diff --git a/src/mkstrtable.awk b/src/mkstrtable.awk
new file mode 100644
index 0000000..c9de9c1
--- /dev/null
+++ b/src/mkstrtable.awk
@@ -0,0 +1,189 @@
+# mkstrtable.awk
+# Copyright (C) 2003, 2004, 2008 g10 Code GmbH
+#
+# 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, g10 Code GmbH gives unlimited permission to
+# copy, distribute and modify the C source files that are the output
+# of mkstrtable.awk. You need not follow the terms of the GNU General
+# Public License when using or distributing such scripts, even though
+# portions of the text of mkstrtable.awk appear in them. The GNU
+# General Public License (GPL) does govern all other use of the material
+# that constitutes the mkstrtable.awk program.
+#
+# Certain portions of the mkstrtable.awk source text are designed to be
+# copied (in certain cases, depending on the input) into the output of
+# mkstrtable.awk. We call these the "data" portions. The rest of the
+# mkstrtable.awk source text consists of comments plus executable code
+# that decides which of the data portions to output in any given case.
+# We call these comments and executable code the "non-data" portions.
+# mkstrtable.h never copies any of the non-data portions into its output.
+#
+# This special exception to the GPL applies to versions of mkstrtable.awk
+# released by g10 Code GmbH. When you make and distribute a modified version
+# of mkstrtable.awk, you may extend this special exception to the GPL to
+# apply to your modified version as well, *unless* your modified version
+# has the potential to copy into its output some of the text that was the
+# non-data portion of the version that you started with. (In other words,
+# unless your change moves or copies text from the non-data portions to the
+# data portions.) If your modification has such potential, you must delete
+# any notice of this special exception to the GPL from your modified version.
+
+# This script outputs a source file that does define the following
+# symbols:
+#
+# static const char msgstr[];
+# A string containing all messages in the list.
+#
+# static const int msgidx[];
+# A list of index numbers, one for each message, that points to the
+# beginning of the string in msgstr.
+#
+# msgidxof (code);
+# A macro that maps code numbers to idx numbers. If a DEFAULT MESSAGE
+# is provided (see below), its index will be returned for unknown codes.
+# Otherwise -1 is returned for codes that do not appear in the list.
+# You can lookup the message with code CODE with:
+# msgstr + msgidx[msgidxof (code)].
+#
+# The input file has the following format:
+# CODE1 ... MESSAGE1 (code nr, <tab>, something, <tab>, msg)
+# CODE2 ... MESSAGE2 (code nr, <tab>, something, <tab>, msg)
+# ...
+# CODEn ... MESSAGEn (code nr, <tab>, something, <tab>, msg)
+# ... DEFAULT-MESSAGE (<tab>, something, <tab>, fall-back msg)
+#
+# Comments (starting with # and ending at the end of the line) are removed,
+# as is trailing whitespace. The last line is optional; if no DEFAULT
+# MESSAGE is given, msgidxof will return the number -1 for unknown
+# index numbers.
+#
+# The field to be used is specified with the variable "textidx" on
+# the command line. It defaults to 2.
+#
+# The variable nogettext can be set to 1 to suppress gettext markers.
+#
+# The variable prefix can be used to prepend a string to each message.
+#
+# The variable namespace can be used to prepend a string to each
+# variable and macro name.
+
+BEGIN {
+ FS = "[\t]+";
+# cpos holds the current position in the message string.
+ cpos = 0;
+# msg holds the number of messages.
+ msg = 0;
+ print "/* Output of mkstrtable.awk. DO NOT EDIT. */";
+ print "";
+ header = 1;
+ if (textidx == 0)
+ textidx = 2;
+# nogettext can be set to 1 to suppress gettext noop markers.
+}
+
+/^#/ { next; }
+
+header {
+ if ($1 ~ /^[0123456789]+$/)
+ {
+ print "/* The purpose of this complex string table is to produce";
+ print " optimal code with a minimum of relocations. */";
+ print "";
+ print "static const char " namespace "msgstr[] = ";
+ header = 0;
+ }
+ else
+ print;
+}
+
+!header {
+ sub (/\#.+/, "");
+ sub (/[ ]+$/, ""); # Strip trailing space and tab characters.
+
+ if (/^$/)
+ next;
+
+# Print the string msgstr line by line. We delay output by one line to be able
+# to treat the last line differently (see END).
+ if (last_msgstr)
+ {
+ if (nogettext)
+ print " \"" last_msgstr "\" \"\\0\"";
+ else
+ print " gettext_noop (\"" last_msgstr "\") \"\\0\"";
+ }
+ last_msgstr = prefix $textidx;
+
+# Remember the error code and msgidx of each error message.
+ code[msg] = $1;
+ pos[msg] = cpos;
+ cpos += length (last_msgstr) + 1;
+ msg++;
+
+ if ($1 == "")
+ {
+ has_default = 1;
+ exit;
+ }
+}
+END {
+ if (has_default)
+ coded_msgs = msg - 1;
+ else
+ coded_msgs = msg;
+
+ if (nogettext)
+ print " \"" last_msgstr "\";";
+ else
+ print " gettext_noop (\"" last_msgstr "\");";
+ print "";
+ print "static const int " namespace "msgidx[] =";
+ print " {";
+ for (i = 0; i < coded_msgs; i++)
+ print " " pos[i] ",";
+ print " " pos[coded_msgs];
+ print " };";
+ print "";
+ print "static GPG_ERR_INLINE int";
+ print namespace "msgidxof (int code)";
+ print "{";
+ print " return (0 ? 0";
+
+# Gather the ranges.
+ skip = code[0];
+ start = code[0];
+ stop = code[0];
+ for (i = 1; i < coded_msgs; i++)
+ {
+ if (code[i] == stop + 1)
+ stop++;
+ else
+ {
+ print " : ((code >= " start ") && (code <= " stop ")) ? (code - " \
+ skip ")";
+ skip += code[i] - stop - 1;
+ start = code[i];
+ stop = code[i];
+ }
+ }
+ print " : ((code >= " start ") && (code <= " stop ")) ? (code - " \
+ skip ")";
+ if (has_default)
+ print " : " stop + 1 " - " skip ");";
+ else
+ print " : -1);";
+ print "}";
+}
diff --git a/src/mkw32errmap.c b/src/mkw32errmap.c
new file mode 100644
index 0000000..508a513
--- /dev/null
+++ b/src/mkw32errmap.c
@@ -0,0 +1,178 @@
+/* mkw32errmap.c - Generate mapping sources for Windows.
+ Copyright (C) 2010 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifdef RESOLVE_MACROS
+# include <winerror.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+
+static const char header_gpg_extra_errno_h[] =
+ "/* errno.h - WindowsCE errno.h substitute\n"
+ " Copyright (C) 2010 g10 Code GmbH\n"
+ "\n"
+ " This file is free software; as a special exception the author gives\n"
+ " unlimited permission to copy and/or distribute it, with or without\n"
+ " modifications, as long as this notice is preserved.\n"
+ "\n"
+ " This file is distributed in the hope that it will be useful, but\n"
+ " WITHOUT ANY WARRANTY, to the extent permitted by law; without even\n"
+ " the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR\n"
+ " PURPOSE.\n"
+ "\n"
+ " +++ Do not edit! File has been generated by mkw32errmap.c +++\n"
+ "\n"
+ " This file is intended to be used with ming32ce-gcc to implement an\n"
+ " errno substitute under WindowsCE. It must be included via gcc's\n"
+ " -idirafter option. The gpg-error-config script emits the\n"
+ " appropriate option snippet. The actual implementation of the errno\n"
+ " related functions are part of libgpg-error. A separate header file\n"
+ " is required because errno.h is often included before gpg-error.h.\n"
+ " */\n"
+ "\n"
+ "#ifndef _GPG_ERROR_EXTRA_ERRNO_H\n"
+ "#define _GPG_ERROR_EXTRA_ERRNO_H\n"
+ "\n"
+ "/* Due to peculiarities in W32 we can't implement ERRNO as an\n"
+ " writable lvalue. This also allows us to easily find places\n"
+ " where ERRNO is being written to. See also gpg_err_set_errno. */\n"
+ "int _gpg_w32ce_get_errno (void);\n"
+ "#define errno (_gpg_w32ce_get_errno ())\n"
+ "\n";
+static const char footer_gpg_extra_errno_h[] =
+ "\n"
+ "#endif /*_GPG_ERROR_EXTRA_ERRNO_H*/\n";
+
+
+/* The table below is used in two modes. First we run the host
+ preprocessor over it to generate a new include file. This include
+ file has the same content but the Windows error macros are
+ resolved. This is so that we don't need to include winerror.h into
+ the generated errno.h. The mkw32errmap_marker variable is only
+ here to have something to grep for after preprocessing. */
+static int mkw32errmap_marker;
+struct table_s
+{
+ int *dummy;
+ const char *name;
+ int w32code;
+ int w32code2;
+};
+
+struct table_s table[] =
+ {
+#ifdef RESOLVE_MACROS
+#define X(a,b,c) \
+ {&mkw32errmap_marker, (a), (b), (c)}
+ X( "EPERM", ERROR_CANNOT_MAKE , 0 ),
+ X( "ENOENT", ERROR_FILE_NOT_FOUND , ERROR_PATH_NOT_FOUND ),
+ X( "EINTR", ERROR_INVALID_AT_INTERRUPT_TIME , 0 ),
+ X( "EIO", ERROR_IO_DEVICE , 0 ),
+ X( "ENXIO", ERROR_FILE_INVALID , 0 ),
+ X( "EBADF", ERROR_INVALID_HANDLE , 0 ),
+ X( "EAGAIN", ERROR_MORE_DATA , WSAEWOULDBLOCK ),
+
+ X( "ENOMEM", ERROR_NOT_ENOUGH_MEMORY , 0 ),
+ X( "EACCES", ERROR_ACCESS_DENIED , 0 ),
+ X( "EFAULT", ERROR_PROCESS_ABORTED , 0 ),
+ X( "EBUSY", ERROR_BUSY , 0 ),
+ X( "EEXIST", ERROR_FILE_EXISTS , WSAEADDRINUSE ),
+
+ X( "EXDEV", ERROR_NOT_SAME_DEVICE , 0 ),
+ X( "ENODEV", ERROR_BAD_DEVICE , ERROR_DEV_NOT_EXIST ),
+
+ X( "ENOTDIR",ERROR_DIRECTORY , 0 ),
+ X( "EINVAL", ERROR_INVALID_PARAMETER , 0 ),
+ X( "ENFILE", ERROR_NO_MORE_FILES , 0 ),
+ X( "EMFILE", ERROR_TOO_MANY_OPEN_FILES , 0 ),
+ X( "ENOSPC", ERROR_DISK_FULL , 0 ),
+ X( "EROFS", ERROR_WRITE_PROTECT , 0 ),
+ X( "EPIPE", ERROR_BROKEN_PIPE , 0 ),
+ X( "ERANGE", ERROR_ARITHMETIC_OVERFLOW , 0 ),
+ X( "EDEADLOCK",ERROR_POSSIBLE_DEADLOCK , 0 ),
+ X( "ENAMETOOLONG", ERROR_FILENAME_EXCED_RANGE, 0 ),
+ X( "ENOLCK", ERROR_SHARING_BUFFER_EXCEEDED , 0 ),
+ X( "ENOSYS", ERROR_NOT_SUPPORTED , 0 ),
+ X( "ENOTEMPTY",ERROR_DIR_NOT_EMPTY , 0 ),
+ X( "ESPIPE", ERROR_SEEK_ON_DEVICE , 0 ),
+#if 0 /* FIXME: Find appropriate mappings. */
+ X( "EILSEQ", ),
+ X( "EDOM", ),
+ X( "EMLINK", ),
+ X( "ESRCH", ), /* No such process */
+ X( "E2BIG", ), /* Arg list too long */
+ X( "ENOEXEC", ), /* Exec format error */
+ X( "ECHILD", ), /* No child processes */
+ X( "EISDIR", ), /* Is a directory */
+ X( "ENOTTY", ), /* Inappropriate I/O control operation */
+ X( "EFBIG", ), /* File too large */
+#endif
+#undef X
+#else /*!RESOLVE_MACROS*/
+# include "mkw32errmap.tab.h"
+#endif /*!RESOLVE_MACROS*/
+ { NULL, 0 }
+ };
+
+
+
+static int
+compare_table (const void *a_v, const void *b_v)
+{
+ const struct table_s *a = a_v;
+ const struct table_s *b = b_v;
+
+ return (a->w32code - b->w32code);
+}
+
+
+int
+main (int argc, char **argv)
+{
+ int idx;
+
+ for (idx=0; table[idx].name; idx++)
+ ;
+ qsort (table, idx, sizeof *table, compare_table);
+
+ if (argc == 2 && !strcmp (argv[1], "--map"))
+ {
+ fputs ("static int\n"
+ "map_w32codes (int err)\n"
+ "{\n"
+ " switch (err)\n"
+ " {\n", stdout );
+ for (idx=0; table[idx].name; idx++)
+ if (table[idx].w32code2)
+ printf (" case %d: return %d;\n",
+ table[idx].w32code2, table[idx].w32code);
+ fputs (" default: return err;\n"
+ " }\n"
+ "}\n", stdout);
+ }
+ else
+ {
+ fputs (header_gpg_extra_errno_h, stdout);
+ for (idx=0; table[idx].name; idx++)
+ printf ("#define %-12s %5d\n", table[idx].name, table[idx].w32code);
+ fputs (footer_gpg_extra_errno_h, stdout);
+ }
+
+ return 0;
+}
diff --git a/src/posix-lock-obj.h b/src/posix-lock-obj.h
new file mode 100644
index 0000000..08e0bac
--- /dev/null
+++ b/src/posix-lock-obj.h
@@ -0,0 +1,42 @@
+/* posic-lock-obj.h - Declaration of the POSIX lock object
+ Copyright (C) 2014 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef POSIX_LOCK_OBJ_H
+#define POSIX_LOCK_OBJ_H
+
+#define LOCK_ABI_NOT_AVAILABLE (-1)
+#if USE_POSIX_THREADS
+# define LOCK_ABI_VERSION 1
+#else
+# define LOCK_ABI_VERSION LOCK_ABI_NOT_AVAILABLE
+#endif
+
+typedef struct
+{
+ long vers;
+#if USE_POSIX_THREADS
+ union {
+ pthread_mutex_t mtx;
+ long *dummy;
+ } u;
+#endif
+} _gpgrt_lock_t;
+
+
+#endif /*POSIX_LOCK_OBJ_H*/
diff --git a/src/posix-lock.c b/src/posix-lock.c
new file mode 100644
index 0000000..d251d2f
--- /dev/null
+++ b/src/posix-lock.c
@@ -0,0 +1,284 @@
+/* posix-lock.c - GPGRT lock functions for POSIX systems
+ Copyright (C) 2005-2009 Free Software Foundation, Inc.
+ Copyright (C) 2014 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
+
+ Parts of the code, in particular use_pthreads_p, are based on code
+ from gettext, written by Bruno Haible <[email protected]>, 2005.
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_W32_SYSTEM
+# error This module may not be build for Windows.
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <assert.h>
+
+#if USE_POSIX_THREADS
+# include <pthread.h>
+#endif
+
+#include "gpg-error.h"
+#include "lock.h"
+#include "posix-lock-obj.h"
+
+
+/*
+ * Functions called before and after blocking syscalls.
+ * gpgrt_set_syscall_clamp is used to set them.
+ */
+static void (*pre_lock_func)(void);
+static void (*post_lock_func)(void);
+
+
+#if USE_POSIX_THREADS
+# if USE_POSIX_THREADS_WEAK
+ /* On ELF systems it is easy to use pthreads using weak
+ references. Take care not to test the address of a weak
+ referenced function we actually use; some GCC versions have a
+ bug were &foo != NULL is always evaluated to true in PIC mode. */
+# pragma weak pthread_cancel
+# pragma weak pthread_mutex_init
+# pragma weak pthread_mutex_lock
+# pragma weak pthread_mutex_trylock
+# pragma weak pthread_mutex_unlock
+# pragma weak pthread_mutex_destroy
+# if ! PTHREAD_IN_USE_DETECTION_HARD
+# define use_pthread_p() (!!pthread_cancel)
+# endif
+# else /*!USE_POSIX_THREADS_WEAK*/
+# if ! PTHREAD_IN_USE_DETECTION_HARD
+# define use_pthread_p() (1)
+# endif
+# endif /*!USE_POSIX_THREADS_WEAK*/
+# if PTHREAD_IN_USE_DETECTION_HARD
+/* The function to be executed by a dummy thread. */
+static void *
+dummy_thread_func (void *arg)
+{
+ return arg;
+}
+
+static int
+use_pthread_p (void)
+{
+ static int tested;
+ static int result; /* 1: linked with -lpthread, 0: only with libc */
+
+ if (!tested)
+ {
+ pthread_t thread;
+
+ if (pthread_create (&thread, NULL, dummy_thread_func, NULL))
+ result = 0; /* Thread creation failed. */
+ else
+ {
+ /* Thread creation works. */
+ void *retval;
+ if (pthread_join (thread, &retval) != 0)
+ {
+ assert (!"pthread_join");
+ abort ();
+ }
+ result = 1;
+ }
+ tested = 1;
+ }
+ return result;
+}
+#endif /*PTHREAD_IN_USE_DETECTION_HARD*/
+#endif /*USE_POSIX_THREADS*/
+
+
+/* Helper to set the clamp functions. This is called as a helper from
+ * _gpgrt_set_syscall_clamp to keep the function pointers local. */
+void
+_gpgrt_lock_set_lock_clamp (void (*pre)(void), void (*post)(void))
+{
+ pre_lock_func = pre;
+ post_lock_func = post;
+}
+
+
+
+static _gpgrt_lock_t *
+get_lock_object (gpgrt_lock_t *lockhd)
+{
+ _gpgrt_lock_t *lock = (_gpgrt_lock_t*)lockhd;
+
+ if (lock->vers != LOCK_ABI_VERSION)
+ {
+ assert (!"lock ABI version");
+ abort ();
+ }
+ if (sizeof (gpgrt_lock_t) < sizeof (_gpgrt_lock_t))
+ {
+ assert (!"sizeof lock obj");
+ abort ();
+ }
+
+ return lock;
+}
+
+
+gpg_err_code_t
+_gpgrt_lock_init (gpgrt_lock_t *lockhd)
+{
+ _gpgrt_lock_t *lock = (_gpgrt_lock_t*)lockhd;
+ int rc;
+
+ /* If VERS is zero we assume that no static initialization has been
+ done, so we setup our ABI version right here. The caller might
+ have called us to test whether lock support is at all available. */
+ if (!lock->vers)
+ {
+ if (sizeof (gpgrt_lock_t) < sizeof (_gpgrt_lock_t))
+ {
+ assert (!"sizeof lock obj");
+ abort ();
+ }
+ lock->vers = LOCK_ABI_VERSION;
+ }
+ else /* Run the usual check. */
+ lock = get_lock_object (lockhd);
+
+#if USE_POSIX_THREADS
+ if (use_pthread_p())
+ {
+ rc = pthread_mutex_init (&lock->u.mtx, NULL);
+ if (rc)
+ rc = gpg_err_code_from_errno (rc);
+ }
+ else
+ rc = 0; /* Threads are not used. */
+#else /* Unknown thread system. */
+ rc = lock->vers == LOCK_ABI_NOT_AVAILABLE? 0 : GPG_ERR_NOT_IMPLEMENTED;
+#endif /* Unknown thread system. */
+
+ return rc;
+}
+
+
+gpg_err_code_t
+_gpgrt_lock_lock (gpgrt_lock_t *lockhd)
+{
+ _gpgrt_lock_t *lock = get_lock_object (lockhd);
+ int rc;
+
+#if USE_POSIX_THREADS
+ if (use_pthread_p())
+ {
+ if (pre_lock_func)
+ pre_lock_func ();
+ rc = pthread_mutex_lock (&lock->u.mtx);
+ if (rc)
+ rc = gpg_err_code_from_errno (rc);
+ if (post_lock_func)
+ post_lock_func ();
+ }
+ else
+ rc = 0; /* Threads are not used. */
+#else /* Unknown thread system. */
+ rc = lock->vers == LOCK_ABI_NOT_AVAILABLE? 0 : GPG_ERR_NOT_IMPLEMENTED;
+#endif /* Unknown thread system. */
+
+ return rc;
+}
+
+
+gpg_err_code_t
+_gpgrt_lock_trylock (gpgrt_lock_t *lockhd)
+{
+ _gpgrt_lock_t *lock = get_lock_object (lockhd);
+ int rc;
+
+#if USE_POSIX_THREADS
+ if (use_pthread_p())
+ {
+ rc = pthread_mutex_trylock (&lock->u.mtx);
+ if (rc)
+ rc = gpg_err_code_from_errno (rc);
+ }
+ else
+ rc = 0; /* Threads are not used. */
+#else /* Unknown thread system. */
+ rc = lock->vers == LOCK_ABI_NOT_AVAILABLE? 0 : GPG_ERR_NOT_IMPLEMENTED;
+#endif /* Unknown thread system. */
+
+ return rc;
+}
+
+
+gpg_err_code_t
+_gpgrt_lock_unlock (gpgrt_lock_t *lockhd)
+{
+ _gpgrt_lock_t *lock = get_lock_object (lockhd);
+ int rc;
+
+#if USE_POSIX_THREADS
+ if (use_pthread_p())
+ {
+ rc = pthread_mutex_unlock (&lock->u.mtx);
+ if (rc)
+ rc = gpg_err_code_from_errno (rc);
+ }
+ else
+ rc = 0; /* Threads are not used. */
+#else /* Unknown thread system. */
+ rc = lock->vers == LOCK_ABI_NOT_AVAILABLE? 0 : GPG_ERR_NOT_IMPLEMENTED;
+#endif /* Unknown thread system. */
+
+ return rc;
+}
+
+
+/* Note: Use this function only if no other thread holds or waits for
+ this lock. */
+gpg_err_code_t
+_gpgrt_lock_destroy (gpgrt_lock_t *lockhd)
+{
+ _gpgrt_lock_t *lock = get_lock_object (lockhd);
+ int rc;
+
+#if USE_POSIX_THREADS
+ if (use_pthread_p())
+ {
+ rc = pthread_mutex_destroy (&lock->u.mtx);
+ if (rc)
+ rc = gpg_err_code_from_errno (rc);
+ else
+ {
+ /* Re-init the mutex so that it can be re-used. */
+ gpgrt_lock_t tmp = GPGRT_LOCK_INITIALIZER;
+ memcpy (lockhd, &tmp, sizeof tmp);
+ }
+ }
+ else
+ rc = 0; /* Threads are not used. */
+#else /* Unknown thread system. */
+ rc = lock->vers == LOCK_ABI_NOT_AVAILABLE? 0 : GPG_ERR_NOT_IMPLEMENTED;
+#endif /* Unknown thread system. */
+
+ return rc;
+}
diff --git a/src/posix-thread.c b/src/posix-thread.c
new file mode 100644
index 0000000..00a43e2
--- /dev/null
+++ b/src/posix-thread.c
@@ -0,0 +1,89 @@
+/* posix-thread.c - GPGRT thread functions for POSIX systems
+ Copyright (C) 2014 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_W32_SYSTEM
+# error This module may not be build for Windows.
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h> /* Get posix option macros. */
+
+#if USE_POSIX_THREADS
+# ifdef _POSIX_PRIORITY_SCHEDULING
+# include <sched.h>
+# endif
+#elif USE_SOLARIS_THREADS
+# include <thread.h>
+#endif
+
+#include "gpg-error.h"
+
+#include "thread.h"
+
+/*
+ * Functions called before and after blocking syscalls.
+ * gpgrt_set_syscall_clamp is used to set them.
+ */
+static void (*pre_syscall_func)(void);
+static void (*post_syscall_func)(void);
+
+
+/* Helper to set the clamp functions. This is called as a helper from
+ * _gpgrt_set_syscall_clamp to keep the function pointers local. */
+void
+_gpgrt_thread_set_syscall_clamp (void (*pre)(void), void (*post)(void))
+{
+ pre_syscall_func = pre;
+ post_syscall_func = post;
+}
+
+
+
+gpg_err_code_t
+_gpgrt_yield (void)
+{
+#if USE_POSIX_THREADS
+# ifdef _POSIX_PRIORITY_SCHEDULING
+ if (pre_syscall_func)
+ pre_syscall_func ();
+ sched_yield ();
+ if (post_syscall_func)
+ post_syscall_func ();
+# else
+ return GPG_ERR_NOT_SUPPORTED;
+# endif
+#elif USE_SOLARIS_THREADS
+ if (pre_syscall_func)
+ pre_syscall_func ();
+ thr_yield ();
+ if (post_syscall_func)
+ post_syscall_func ();
+#else
+ return GPG_ERR_NOT_SUPPORTED;
+#endif
+
+ return 0;
+}
diff --git a/src/strerror-sym.c b/src/strerror-sym.c
new file mode 100644
index 0000000..3d79f40
--- /dev/null
+++ b/src/strerror-sym.c
@@ -0,0 +1,56 @@
+/* strerror-sym.c - Describing an error code with its symbol name.
+ Copyright (C) 2003, 2004 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with libgpg-error; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stddef.h>
+
+#include <gpg-error.h>
+
+#include "err-codes-sym.h"
+#include "errnos-sym.h"
+
+/* Return a pointer to a string containing the name of the symbol of
+ the error code in the error value ERR. Returns NULL if the error
+ code is not known. */
+const char *
+gpg_strerror_sym (gpg_error_t err)
+{
+ gpg_err_code_t code = gpg_err_code (err);
+
+ if (code & GPG_ERR_SYSTEM_ERROR)
+ {
+ int idx;
+
+ code &= ~GPG_ERR_SYSTEM_ERROR;
+ idx = errnos_msgidxof (code);
+ if (idx >= 0)
+ return errnos_msgstr + errnos_msgidx[idx];
+ else
+ return NULL;
+ }
+
+ if (msgidxof (code) == msgidxof (GPG_ERR_CODE_DIM))
+ return NULL;
+
+ return msgstr + msgidx[msgidxof (code)];
+}
diff --git a/src/strerror.c b/src/strerror.c
new file mode 100644
index 0000000..b0efb3d
--- /dev/null
+++ b/src/strerror.c
@@ -0,0 +1,169 @@
+/* strerror.c - Describing an error code.
+ Copyright (C) 2003 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with libgpg-error; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include <gpg-error.h>
+
+#include "gettext.h"
+#include "err-codes.h"
+
+/* Return a pointer to a string containing a description of the error
+ code in the error value ERR. This function is not thread-safe. */
+const char *
+_gpg_strerror (gpg_error_t err)
+{
+ gpg_err_code_t code = gpg_err_code (err);
+
+ if (code & GPG_ERR_SYSTEM_ERROR)
+ {
+ int no = gpg_err_code_to_errno (code);
+ if (no)
+ return strerror (no);
+ else
+ code = GPG_ERR_UNKNOWN_ERRNO;
+ }
+ return dgettext (PACKAGE, msgstr + msgidx[msgidxof (code)]);
+}
+
+
+#ifdef HAVE_STRERROR_R
+#ifdef STRERROR_R_CHAR_P
+/* The GNU C library and probably some other systems have this weird
+ variant of strerror_r. */
+
+/* Return a dynamically allocated string in *STR describing the system
+ error NO. If this call succeeds, return 1. If this call fails due
+ to a resource shortage, set *STR to NULL and return 1. If this
+ call fails because the error number is not valid, don't set *STR
+ and return 0. */
+static int
+system_strerror_r (int no, char *buf, size_t buflen)
+{
+ char *errstr;
+
+ errstr = strerror_r (no, buf, buflen);
+ if (errstr != buf)
+ {
+ size_t errstr_len = strlen (errstr) + 1;
+ size_t cpy_len = errstr_len < buflen ? errstr_len : buflen;
+ memcpy (buf, errstr, cpy_len);
+
+ return cpy_len == errstr_len ? 0 : ERANGE;
+ }
+ else
+ {
+ /* We can not tell if the buffer was large enough, but we can
+ try to make a guess. */
+ if (strlen (buf) + 1 >= buflen)
+ return ERANGE;
+
+ return 0;
+ }
+}
+
+#else /* STRERROR_R_CHAR_P */
+/* Now the POSIX version. */
+
+static int
+system_strerror_r (int no, char *buf, size_t buflen)
+{
+ return strerror_r (no, buf, buflen);
+}
+
+#endif /* STRERROR_R_CHAR_P */
+
+#else /* HAVE_STRERROR_H */
+/* Without strerror_r(), we can still provide a non-thread-safe
+ version. Maybe we are even lucky and the system's strerror() is
+ already thread-safe. */
+
+static int
+system_strerror_r (int no, char *buf, size_t buflen)
+{
+ char *errstr = strerror (no);
+
+ if (!errstr)
+ {
+ int saved_errno = errno;
+
+ if (saved_errno != EINVAL)
+ snprintf (buf, buflen, "strerror failed: %i\n", errno);
+ return saved_errno;
+ }
+ else
+ {
+ size_t errstr_len = strlen (errstr) + 1;
+ size_t cpy_len = errstr_len < buflen ? errstr_len : buflen;
+ memcpy (buf, errstr, cpy_len);
+ return cpy_len == errstr_len ? 0 : ERANGE;
+ }
+}
+#endif
+
+
+/* Return the error string for ERR in the user-supplied buffer BUF of
+ size BUFLEN. This function is, in contrast to gpg_strerror,
+ thread-safe if a thread-safe strerror_r() function is provided by
+ the system. If the function succeeds, 0 is returned and BUF
+ contains the string describing the error. If the buffer was not
+ large enough, ERANGE is returned and BUF contains as much of the
+ beginning of the error string as fits into the buffer. */
+int
+_gpg_strerror_r (gpg_error_t err, char *buf, size_t buflen)
+{
+ gpg_err_code_t code = gpg_err_code (err);
+ const char *errstr;
+ size_t errstr_len;
+ size_t cpy_len;
+
+ if (code & GPG_ERR_SYSTEM_ERROR)
+ {
+ int no = gpg_err_code_to_errno (code);
+ if (no)
+ {
+ int system_err = system_strerror_r (no, buf, buflen);
+
+ if (system_err != EINVAL)
+ {
+ if (buflen)
+ buf[buflen - 1] = '\0';
+ return system_err;
+ }
+ }
+ code = GPG_ERR_UNKNOWN_ERRNO;
+ }
+
+ errstr = dgettext (PACKAGE, msgstr + msgidx[msgidxof (code)]);
+ errstr_len = strlen (errstr) + 1;
+ cpy_len = errstr_len < buflen ? errstr_len : buflen;
+ memcpy (buf, errstr, cpy_len);
+ if (buflen)
+ buf[buflen - 1] = '\0';
+
+ return cpy_len == errstr_len ? 0 : ERANGE;
+}
diff --git a/src/strsource-sym.c b/src/strsource-sym.c
new file mode 100644
index 0000000..a191310
--- /dev/null
+++ b/src/strsource-sym.c
@@ -0,0 +1,43 @@
+/* strsource-sym.c - Describing an error source with its symbol name.
+ Copyright (C) 2003, 2004 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with libgpg-error; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stddef.h>
+
+#include <gpg-error.h>
+
+#include "err-sources-sym.h"
+
+/* Return a pointer to a string containing the name of the symbol of
+ the error source in the error value ERR. Returns NULL if the error
+ code is not known. */
+const char *
+gpg_strsource_sym (gpg_error_t err)
+{
+ gpg_err_source_t source = gpg_err_source (err);
+
+ if (msgidxof (source) == msgidxof (GPG_ERR_SOURCE_DIM))
+ return NULL;
+
+ return msgstr + msgidx[msgidxof (source)];
+}
diff --git a/src/strsource.c b/src/strsource.c
new file mode 100644
index 0000000..6604eb0
--- /dev/null
+++ b/src/strsource.c
@@ -0,0 +1,37 @@
+/* strsource.c - Describing an error source.
+ Copyright (C) 2003 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with libgpg-error; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gpg-error.h>
+
+#include "gettext.h"
+#include "err-sources.h"
+
+/* Return a pointer to a string containing a description of the error
+ source in the error value ERR. */
+const char *
+_gpg_strsource (gpg_error_t err)
+{
+ gpg_err_source_t source = gpg_err_source (err);
+ return dgettext (PACKAGE, msgstr + msgidx[msgidxof (source)]);
+}
diff --git a/src/syscfg/lock-obj-pub.aarch64-apple-darwin.h b/src/syscfg/lock-obj-pub.aarch64-apple-darwin.h
new file mode 100644
index 0000000..3eeadfe
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.aarch64-apple-darwin.h
@@ -0,0 +1,28 @@
+## lock-obj-pub.aarch64-apple-darwin.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[64];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{167,171,170,50,0,0,0,0, \
+0,0,0,0,0,0,0,0, \
+0,0,0,0,0,0,0,0, \
+0,0,0,0,0,0,0,0, \
+0,0,0,0,0,0,0,0, \
+0,0,0,0,0,0,0,0, \
+0,0,0,0,0,0,0,0, \
+0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.aarch64-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.aarch64-unknown-linux-gnu.h
new file mode 100644
index 0000000..adf10fc
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.aarch64-unknown-linux-gnu.h
@@ -0,0 +1,26 @@
+## lock-obj-pub.aarch64-unknown-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[48];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.alpha-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.alpha-unknown-linux-gnu.h
new file mode 100644
index 0000000..80ddf01
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.alpha-unknown-linux-gnu.h
@@ -0,0 +1,25 @@
+## lock-obj-pub.alpha-unknown-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[40];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.arm-apple-darwin.h b/src/syscfg/lock-obj-pub.arm-apple-darwin.h
new file mode 100644
index 0000000..4e9f630
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.arm-apple-darwin.h
@@ -0,0 +1,26 @@
+## lock-obj-pub.arm-apple-darwin.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[44];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{167,171,170,50,0,0,0,0, \
+0,0,0,0,0,0,0,0, \
+0,0,0,0,0,0,0,0, \
+0,0,0,0,0,0,0,0, \
+0,0,0,0,0,0,0,0, \
+0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.arm-unknown-linux-androideabi.h b/src/syscfg/lock-obj-pub.arm-unknown-linux-androideabi.h
new file mode 100644
index 0000000..56319f5
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.arm-unknown-linux-androideabi.h
@@ -0,0 +1,21 @@
+## lock-obj-pub.arm-unknown-linux-androideabi.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[4];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.arm-unknown-linux-gnueabi.h b/src/syscfg/lock-obj-pub.arm-unknown-linux-gnueabi.h
new file mode 100644
index 0000000..7a92276
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.arm-unknown-linux-gnueabi.h
@@ -0,0 +1,23 @@
+## lock-obj-pub.arm-unknown-linux-gnueabi.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[24];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h
new file mode 100644
index 0000000..b57bb76
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h
@@ -0,0 +1,27 @@
+## lock-obj-pub.hppa-unknown-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[48];
+ int _x16_align __attribute__ ((aligned (16)));
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.i386-apple-darwin.h b/src/syscfg/lock-obj-pub.i386-apple-darwin.h
new file mode 100644
index 0000000..a5963c4
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.i386-apple-darwin.h
@@ -0,0 +1,26 @@
+## lock-obj-pub.i386-apple-darwin.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[44];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{167,171,170,50,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.i686-pc-gnu.h b/src/syscfg/lock-obj-pub.i686-pc-gnu.h
new file mode 100644
index 0000000..0522462
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.i686-pc-gnu.h
@@ -0,0 +1,24 @@
+## lock-obj-pub.i686-pc-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[32];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.i686-pc-kfreebsd-gnu.h b/src/syscfg/lock-obj-pub.i686-pc-kfreebsd-gnu.h
new file mode 100644
index 0000000..4cf12fc
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.i686-pc-kfreebsd-gnu.h
@@ -0,0 +1,23 @@
+## lock-obj-pub.i686-pc-kfreebsd-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[24];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.i686-pc-linux-gnu.h b/src/syscfg/lock-obj-pub.i686-pc-linux-gnu.h
new file mode 100644
index 0000000..b97273b
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.i686-pc-linux-gnu.h
@@ -0,0 +1,23 @@
+## lock-obj-pub.i686-pc-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[24];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.ia64-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.ia64-unknown-linux-gnu.h
new file mode 100644
index 0000000..7cf980a
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.ia64-unknown-linux-gnu.h
@@ -0,0 +1,25 @@
+## lock-obj-pub.ia64-unknown-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[40];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.m68k-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.m68k-unknown-linux-gnu.h
new file mode 100644
index 0000000..3788797
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.m68k-unknown-linux-gnu.h
@@ -0,0 +1,23 @@
+## lock-obj-pub.m68k-unknown-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[24];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.mingw32.h b/src/syscfg/lock-obj-pub.mingw32.h
new file mode 100644
index 0000000..f35aee1
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.mingw32.h
@@ -0,0 +1,44 @@
+## w32-lock-obj-pub.in - Include fragment for gpg-error.h -*- c-*-
+## Copyright (C) 2014 g10 Code GmbH
+##
+## This file is free software; as a special exception the author gives
+## unlimited permission to copy and/or distribute it, with or without
+## modifications, as long as this notice is preserved.
+##
+## This file 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.
+##
+##
+## This file defines the public version of the lock object for 32 bit
+## Windows. The actual used version is in w32-lock-obj.h. This file
+## is inserted into gpg-error.h by mkheader.c. The tool
+## gen-w32-lock-obj.c has been used to construct it.
+
+#ifdef _WIN64
+
+#pragma pack(push, 8)
+typedef struct
+{
+ volatile unsigned char priv[56];
+} gpgrt_lock_t;
+#pragma pack(pop)
+
+#define GPGRT_LOCK_INITIALIZER {{1,0,0,0,0,0,0,0,255,255,255,255, \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0,0,0,0,0}}
+
+#else
+
+#pragma pack(push, 8)
+typedef struct
+{
+ volatile unsigned char priv[36];
+} gpgrt_lock_t;
+#pragma pack(pop)
+
+#define GPGRT_LOCK_INITIALIZER {{1,0,0,0,0,0,0,0,255,255,255,255, \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}
+#endif
diff --git a/src/syscfg/lock-obj-pub.mips-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.mips-unknown-linux-gnu.h
new file mode 100644
index 0000000..b31206e
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.mips-unknown-linux-gnu.h
@@ -0,0 +1,23 @@
+## lock-obj-pub.mips-unknown-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[24];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.mips64el-unknown-linux-gnuabi64.h b/src/syscfg/lock-obj-pub.mips64el-unknown-linux-gnuabi64.h
new file mode 100644
index 0000000..8a81e3f
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.mips64el-unknown-linux-gnuabi64.h
@@ -0,0 +1,25 @@
+## lock-obj-pub.mips64el-unknown-linux-gnuabi64.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[40];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.mipsel-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.mipsel-unknown-linux-gnu.h
new file mode 100644
index 0000000..3a24571
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.mipsel-unknown-linux-gnu.h
@@ -0,0 +1,23 @@
+## lock-obj-pub.mipsel-unknown-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[24];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.nios2-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.nios2-unknown-linux-gnu.h
new file mode 100644
index 0000000..dbd46da
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.nios2-unknown-linux-gnu.h
@@ -0,0 +1,23 @@
+## lock-obj-pub.nios2-unknown-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[24];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.or1k-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.or1k-unknown-linux-gnu.h
new file mode 100644
index 0000000..60eadab
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.or1k-unknown-linux-gnu.h
@@ -0,0 +1,24 @@
+## lock-obj-pub.or1k-unknown-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[32];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.powerpc-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.powerpc-unknown-linux-gnu.h
new file mode 100644
index 0000000..6601bc9
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.powerpc-unknown-linux-gnu.h
@@ -0,0 +1,23 @@
+## lock-obj-pub.powerpc-unknown-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[24];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.powerpc-unknown-linux-gnuspe.h b/src/syscfg/lock-obj-pub.powerpc-unknown-linux-gnuspe.h
new file mode 100644
index 0000000..c53413b
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.powerpc-unknown-linux-gnuspe.h
@@ -0,0 +1,23 @@
+## lock-obj-pub.powerpc-unknown-linux-gnuspe.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[24];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.powerpc64-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.powerpc64-unknown-linux-gnu.h
new file mode 100644
index 0000000..635e6eb
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.powerpc64-unknown-linux-gnu.h
@@ -0,0 +1,25 @@
+## lock-obj-pub.powerpc64-unknown-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[40];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.powerpc64le-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.powerpc64le-unknown-linux-gnu.h
new file mode 100644
index 0000000..79073d4
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.powerpc64le-unknown-linux-gnu.h
@@ -0,0 +1,25 @@
+## lock-obj-pub.powerpc64le-unknown-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[40];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.s390x-ibm-linux-gnu.h b/src/syscfg/lock-obj-pub.s390x-ibm-linux-gnu.h
new file mode 100644
index 0000000..70f6e33
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.s390x-ibm-linux-gnu.h
@@ -0,0 +1,25 @@
+## lock-obj-pub.s390x-ibm-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[40];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.sh3-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.sh3-unknown-linux-gnu.h
new file mode 100644
index 0000000..a2ff11f
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.sh3-unknown-linux-gnu.h
@@ -0,0 +1,23 @@
+## lock-obj-pub.sh3-unknown-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[24];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.sh4-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.sh4-unknown-linux-gnu.h
new file mode 100644
index 0000000..eb62ba3
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.sh4-unknown-linux-gnu.h
@@ -0,0 +1,23 @@
+## lock-obj-pub.sh4-unknown-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[24];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.sparc-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.sparc-unknown-linux-gnu.h
new file mode 100644
index 0000000..2748b26
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.sparc-unknown-linux-gnu.h
@@ -0,0 +1,23 @@
+## lock-obj-pub.sparc-unknown-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[24];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.sparc64-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.sparc64-unknown-linux-gnu.h
new file mode 100644
index 0000000..ee309a9
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.sparc64-unknown-linux-gnu.h
@@ -0,0 +1,25 @@
+## lock-obj-pub.sparc64-unknown-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[40];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.tilegx-unknown-linux-gnu.h b/src/syscfg/lock-obj-pub.tilegx-unknown-linux-gnu.h
new file mode 100644
index 0000000..b99ea32
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.tilegx-unknown-linux-gnu.h
@@ -0,0 +1,25 @@
+## lock-obj-pub.tilegx-unknown-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[40];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.x86_64-apple-darwin.h b/src/syscfg/lock-obj-pub.x86_64-apple-darwin.h
new file mode 100644
index 0000000..eaf8689
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.x86_64-apple-darwin.h
@@ -0,0 +1,28 @@
+## lock-obj-pub.x86_64-apple-darwin.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[64];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{167,171,170,50,0,0,0,0, \
+0,0,0,0,0,0,0,0, \
+0,0,0,0,0,0,0,0, \
+0,0,0,0,0,0,0,0, \
+0,0,0,0,0,0,0,0, \
+0,0,0,0,0,0,0,0, \
+0,0,0,0,0,0,0,0, \
+0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.x86_64-pc-kfreebsd-gnu.h b/src/syscfg/lock-obj-pub.x86_64-pc-kfreebsd-gnu.h
new file mode 100644
index 0000000..7fb596c
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.x86_64-pc-kfreebsd-gnu.h
@@ -0,0 +1,25 @@
+## lock-obj-pub.x86_64-pc-kfreebsd-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[40];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.x86_64-pc-linux-gnu.h b/src/syscfg/lock-obj-pub.x86_64-pc-linux-gnu.h
new file mode 100644
index 0000000..0dd6431
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.x86_64-pc-linux-gnu.h
@@ -0,0 +1,25 @@
+## lock-obj-pub.x86_64-pc-linux-gnu.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[40];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.x86_64-pc-linux-gnux32.h b/src/syscfg/lock-obj-pub.x86_64-pc-linux-gnux32.h
new file mode 100644
index 0000000..e85bd30
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.x86_64-pc-linux-gnux32.h
@@ -0,0 +1,24 @@
+## lock-obj-pub.x86_64-pc-linux-gnux32.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[32];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/syscfg/lock-obj-pub.x86_64-pc-linux-musl.h b/src/syscfg/lock-obj-pub.x86_64-pc-linux-musl.h
new file mode 100644
index 0000000..1b059f4
--- /dev/null
+++ b/src/syscfg/lock-obj-pub.x86_64-pc-linux-musl.h
@@ -0,0 +1,25 @@
+## lock-obj-pub.x86_64-pc-linux-musl.h
+## File created by gen-posix-lock-obj - DO NOT EDIT
+## To be included by mkheader into gpg-error.h
+
+typedef struct
+{
+ long _vers;
+ union {
+ volatile char _priv[40];
+ long _x_align;
+ long *_xp_align;
+ } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER {1,{{0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0}}}
+##
+## Local Variables:
+## mode: c
+## buffer-read-only: t
+## End:
+##
diff --git a/src/thread.h b/src/thread.h
new file mode 100644
index 0000000..f064cce
--- /dev/null
+++ b/src/thread.h
@@ -0,0 +1,26 @@
+/* thread.h - Declarations for *-thread.c
+ Copyright (C) 2014 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef THREAD_H
+#define THREAD_H
+
+void _gpgrt_thread_set_syscall_clamp (void (*pre)(void), void (*post)(void));
+
+
+#endif /*THREAD_H*/
diff --git a/src/version.c b/src/version.c
new file mode 100644
index 0000000..eaeedf8
--- /dev/null
+++ b/src/version.c
@@ -0,0 +1,121 @@
+/* version.c - Version checking
+ * Copyright (C) 2001, 2002, 2012, 2013, 2014 g10 Code GmbH
+ *
+ * This file is part of libgpg-error.
+ *
+ * libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * libgpg-error is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <gpg-error.h>
+
+
+#define digitp(a) ((a) >= '0' && (a) <= '9')
+
+
+/* This is actually a dummy function to make sure that is module is
+ not empty. Some compilers barf on empty modules. */
+static const char *
+cright_blurb (void)
+{
+ static const char blurb[] =
+ "\n\n"
+ "This is Libgpg-error " PACKAGE_VERSION " - An error code library\n"
+ "Copyright 2003-2004, 2010, 2013-2017 g10 Code GmbH\n"
+ "\n"
+ "(" BUILD_REVISION " " BUILD_TIMESTAMP ")\n"
+ "\n\n";
+ return blurb;
+}
+
+
+static const char*
+parse_version_number (const char *s, int *number)
+{
+ int val = 0;
+
+ if (*s == '0' && digitp (s[1]))
+ return NULL; /* Leading zeros are not allowed. */
+ for (; digitp (*s); s++)
+ {
+ val *= 10;
+ val += *s - '0';
+ }
+ *number = val;
+ return val < 0 ? NULL : s;
+}
+
+
+static const char *
+parse_version_string (const char *s, int *major, int *minor)
+{
+ s = parse_version_number (s, major);
+ if (!s || *s != '.')
+ return NULL;
+ s++;
+ s = parse_version_number (s, minor);
+ if (!s)
+ return NULL;
+ return s; /* Patchlevel. */
+}
+
+
+static const char *
+compare_versions (const char *my_version, const char *req_version)
+{
+ int my_major, my_minor;
+ int rq_major, rq_minor;
+ const char *my_plvl, *rq_plvl;
+
+ if (!req_version)
+ return my_version;
+ if (!my_version)
+ return NULL;
+
+ my_plvl = parse_version_string (my_version, &my_major, &my_minor);
+ if (!my_plvl)
+ return NULL; /* Very strange: our own version is bogus. */
+ rq_plvl = parse_version_string(req_version, &rq_major, &rq_minor);
+ if (!rq_plvl)
+ return NULL; /* Requested version string is invalid. */
+
+ if (my_major > rq_major
+ || (my_major == rq_major && my_minor >= rq_minor))
+ {
+ return my_version;
+ }
+ return NULL;
+}
+
+
+/*
+ * Check that the the version of the library is at minimum REQ_VERSION
+ * and return the actual version string; return NULL if the condition
+ * is not met. If NULL is passed to this function, no check is done
+ * and the version string is simply returned.
+ */
+const char *
+_gpg_error_check_version (const char *req_version)
+{
+ if (req_version && req_version[0] == 1 && req_version[1] == 1)
+ return cright_blurb ();
+ return compare_versions (PACKAGE_VERSION, req_version);
+}
diff --git a/src/versioninfo.rc.in b/src/versioninfo.rc.in
new file mode 100644
index 0000000..0986a42
--- /dev/null
+++ b/src/versioninfo.rc.in
@@ -0,0 +1,53 @@
+/* versioninfo.rc.in - for libgpg-error
+ * Copyright (C) 2005 g10 Code GmbH
+ *
+ * This file is free software; as a special exception the author 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.
+ */
+
+/* This file is processed by configure to create versioninfo.rc */
+
+#line __LINE__ "versioninfo.rc.in"
+
+#include <afxres.h>
+
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION @BUILD_FILEVERSION@
+ PRODUCTVERSION @BUILD_FILEVERSION@
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x21L
+#else
+ FILEFLAGS 0x20L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", "Provided under the terms of the GNU Lesser General Public License.\0"
+ VALUE "CompanyName", "g10 Code GmbH\0"
+ VALUE "FileDescription", "libgpg-error - Common error codes\0"
+ VALUE "FileVersion", "@LIBGPG_ERROR_LT_CURRENT@.@LIBGPG_ERROR_LT_AGE@.@LIBGPG_ERROR_LT_REVISION@.@BUILD_REVISION@\0"
+ VALUE "InternalName", "libgpg-error\0"
+ VALUE "LegalCopyright", "Copyright � 2017 g10 Code GmbH\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "libgpg-error.dll\0"
+ VALUE "PrivateBuild", "\0"
+ VALUE "ProductName", "libgpg-error\0"
+ VALUE "ProductVersion", "@PACKAGE_VERSION@\0"
+ VALUE "SpecialBuild", "@BUILD_TIMESTAMP@\0"
+ END
+ END
+END
+
+1 RT_MANIFEST "gpg-error.w32-manifest"
diff --git a/src/visibility.c b/src/visibility.c
new file mode 100644
index 0000000..b637e7a
--- /dev/null
+++ b/src/visibility.c
@@ -0,0 +1,732 @@
+/* visibility.c - Wrapper for all public functions.
+ * Copyright (C) 2014 g10 Code GmbH
+ *
+ * This file is part of libgpg-error.
+ *
+ * libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * libgpg-error is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include <config.h>
+#include <stdarg.h>
+
+#define _GPGRT_INCL_BY_VISIBILITY_C 1
+#include "gpgrt-int.h"
+
+const char *
+gpg_strerror (gpg_error_t err)
+{
+ return _gpg_strerror (err);
+}
+
+int
+gpg_strerror_r (gpg_error_t err, char *buf, size_t buflen)
+{
+ return _gpg_strerror_r (err, buf, buflen);
+}
+
+const char *
+gpg_strsource (gpg_error_t err)
+{
+ return _gpg_strsource (err);
+}
+
+gpg_err_code_t
+gpg_err_code_from_errno (int err)
+{
+ return _gpg_err_code_from_errno (err);
+}
+
+int
+gpg_err_code_to_errno (gpg_err_code_t code)
+{
+ return _gpg_err_code_to_errno (code);
+}
+
+gpg_err_code_t
+gpg_err_code_from_syserror (void)
+{
+ return _gpg_err_code_from_syserror ();
+}
+
+void
+gpg_err_set_errno (int err)
+{
+ _gpg_err_set_errno (err);
+}
+
+
+gpg_error_t
+gpg_err_init (void)
+{
+ return _gpg_err_init ();
+}
+
+void
+gpg_err_deinit (int mode)
+{
+ _gpg_err_deinit (mode);
+}
+
+const char *
+gpg_error_check_version (const char *req_version)
+{
+ return _gpg_error_check_version (req_version);
+}
+
+const char *
+gpgrt_check_version (const char *req_version)
+{
+ return _gpg_error_check_version (req_version);
+}
+
+void
+gpgrt_set_syscall_clamp (void (*pre)(void), void (*post)(void))
+{
+ _gpgrt_set_syscall_clamp (pre, post);
+}
+
+void
+gpgrt_get_syscall_clamp (void (**r_pre)(void), void (**r_post)(void))
+{
+ _gpgrt_get_syscall_clamp (r_pre, r_post);
+}
+
+void
+gpgrt_set_alloc_func (void *(*f)(void *a, size_t n))
+{
+ _gpgrt_set_alloc_func (f);
+}
+
+
+gpg_err_code_t
+gpgrt_lock_init (gpgrt_lock_t *lockhd)
+{
+ return _gpgrt_lock_init (lockhd);
+}
+
+gpg_err_code_t
+gpgrt_lock_lock (gpgrt_lock_t *lockhd)
+{
+ return _gpgrt_lock_lock (lockhd);
+}
+
+gpg_err_code_t
+gpgrt_lock_trylock (gpgrt_lock_t *lockhd)
+{
+ return _gpgrt_lock_trylock (lockhd);
+}
+
+gpg_err_code_t
+gpgrt_lock_unlock (gpgrt_lock_t *lockhd)
+{
+ return _gpgrt_lock_unlock (lockhd);
+}
+
+gpg_err_code_t
+gpgrt_lock_destroy (gpgrt_lock_t *lockhd)
+{
+ return _gpgrt_lock_destroy (lockhd);
+}
+
+gpg_err_code_t
+gpgrt_yield (void)
+{
+ return _gpgrt_yield ();
+}
+
+
+
+estream_t
+gpgrt_fopen (const char *_GPGRT__RESTRICT path,
+ const char *_GPGRT__RESTRICT mode)
+{
+ return _gpgrt_fopen (path, mode);
+}
+
+estream_t
+gpgrt_mopen (void *_GPGRT__RESTRICT data, size_t data_n, size_t data_len,
+ unsigned int grow,
+ void *(*func_realloc) (void *mem, size_t size),
+ void (*func_free) (void *mem),
+ const char *_GPGRT__RESTRICT mode)
+{
+ return _gpgrt_mopen (data, data_n, data_len, grow, func_realloc, func_free,
+ mode);
+}
+
+estream_t
+gpgrt_fopenmem (size_t memlimit, const char *_GPGRT__RESTRICT mode)
+{
+ return _gpgrt_fopenmem (memlimit, mode);
+}
+
+estream_t
+gpgrt_fopenmem_init (size_t memlimit, const char *_GPGRT__RESTRICT mode,
+ const void *data, size_t datalen)
+{
+ return _gpgrt_fopenmem_init (memlimit, mode, data, datalen);
+}
+
+estream_t
+gpgrt_fdopen (int filedes, const char *mode)
+{
+ return _gpgrt_fdopen (filedes, mode);
+}
+
+estream_t
+gpgrt_fdopen_nc (int filedes, const char *mode)
+{
+ return _gpgrt_fdopen_nc (filedes, mode);
+}
+
+estream_t
+gpgrt_sysopen (es_syshd_t *syshd, const char *mode)
+{
+ return _gpgrt_sysopen (syshd, mode);
+}
+
+estream_t
+gpgrt_sysopen_nc (es_syshd_t *syshd, const char *mode)
+{
+ return _gpgrt_sysopen_nc (syshd, mode);
+}
+
+estream_t
+gpgrt_fpopen (FILE *fp, const char *mode)
+{
+ return _gpgrt_fpopen (fp, mode);
+}
+
+estream_t
+gpgrt_fpopen_nc (FILE *fp, const char *mode)
+{
+ return _gpgrt_fpopen_nc (fp, mode);
+}
+
+estream_t
+gpgrt_freopen (const char *_GPGRT__RESTRICT path,
+ const char *_GPGRT__RESTRICT mode,
+ estream_t _GPGRT__RESTRICT stream)
+{
+ return _gpgrt_freopen (path, mode, stream);
+}
+
+estream_t
+gpgrt_fopencookie (void *_GPGRT__RESTRICT cookie,
+ const char *_GPGRT__RESTRICT mode,
+ gpgrt_cookie_io_functions_t functions)
+{
+ return _gpgrt_fopencookie (cookie, mode, functions);
+}
+
+int
+gpgrt_fclose (estream_t stream)
+{
+ return _gpgrt_fclose (stream);
+}
+
+int
+gpgrt_fclose_snatch (estream_t stream, void **r_buffer, size_t *r_buflen)
+{
+ return _gpgrt_fclose_snatch (stream, r_buffer, r_buflen);
+}
+
+int
+gpgrt_onclose (estream_t stream, int mode,
+ void (*fnc) (estream_t, void*), void *fnc_value)
+{
+ return _gpgrt_onclose (stream, mode, fnc, fnc_value);
+}
+
+int
+gpgrt_fileno (estream_t stream)
+{
+ return _gpgrt_fileno (stream);
+}
+
+int
+gpgrt_fileno_unlocked (estream_t stream)
+{
+ return _gpgrt_fileno_unlocked (stream);
+}
+
+int
+gpgrt_syshd (estream_t stream, es_syshd_t *syshd)
+{
+ return _gpgrt_syshd (stream, syshd);
+}
+
+int
+gpgrt_syshd_unlocked (estream_t stream, es_syshd_t *syshd)
+{
+ return _gpgrt_syshd_unlocked (stream, syshd);
+}
+
+void
+_gpgrt_set_std_fd (int no, int fd)
+{
+ _gpgrt__set_std_fd (no, fd); /* (double dash in name) */
+}
+
+estream_t
+_gpgrt_get_std_stream (int fd)
+{
+ return _gpgrt__get_std_stream (fd); /* (double dash in name) */
+}
+
+void
+gpgrt_flockfile (estream_t stream)
+{
+ _gpgrt_flockfile (stream);
+}
+
+int
+gpgrt_ftrylockfile (estream_t stream)
+{
+ return _gpgrt_ftrylockfile (stream);
+}
+
+void
+gpgrt_funlockfile (estream_t stream)
+{
+ _gpgrt_funlockfile (stream);
+}
+
+int
+_gpgrt_pending (estream_t stream)
+{
+ return _gpgrt__pending (stream);
+}
+
+int
+_gpgrt_pending_unlocked (estream_t stream)
+{
+ return _gpgrt__pending_unlocked (stream);
+}
+
+int
+gpgrt_feof (estream_t stream)
+{
+ return _gpgrt_feof (stream);
+}
+
+int
+gpgrt_feof_unlocked (estream_t stream)
+{
+ return _gpgrt_feof_unlocked (stream);
+}
+
+int
+gpgrt_ferror (estream_t stream)
+{
+ return _gpgrt_ferror (stream);
+}
+
+int
+gpgrt_ferror_unlocked (estream_t stream)
+{
+ return _gpgrt_ferror_unlocked (stream);
+}
+
+void
+gpgrt_clearerr (estream_t stream)
+{
+ _gpgrt_clearerr (stream);
+}
+
+void
+gpgrt_clearerr_unlocked (estream_t stream)
+{
+ _gpgrt_clearerr_unlocked (stream);
+}
+
+int
+gpgrt_fflush (estream_t stream)
+{
+ return _gpgrt_fflush (stream);
+}
+
+int
+gpgrt_fseek (estream_t stream, long int offset, int whence)
+{
+ return _gpgrt_fseek (stream, offset, whence);
+}
+
+int
+gpgrt_fseeko (estream_t stream, gpgrt_off_t offset, int whence)
+{
+ return _gpgrt_fseeko (stream, offset, whence);
+}
+
+long int
+gpgrt_ftell (estream_t stream)
+{
+ return _gpgrt_ftell (stream);
+}
+
+gpgrt_off_t
+gpgrt_ftello (estream_t stream)
+{
+ return _gpgrt_ftello (stream);
+}
+
+void
+gpgrt_rewind (estream_t stream)
+{
+ _gpgrt_rewind (stream);
+}
+
+int
+gpgrt_fgetc (estream_t stream)
+{
+ return _gpgrt_fgetc (stream);
+}
+
+int
+_gpgrt_getc_underflow (estream_t stream)
+{
+ return _gpgrt__getc_underflow (stream);
+}
+
+int
+gpgrt_fputc (int c, estream_t stream)
+{
+ return _gpgrt_fputc (c, stream);
+}
+
+int
+_gpgrt_putc_overflow (int c, estream_t stream)
+{
+ return _gpgrt__putc_overflow (c, stream);
+}
+
+int
+gpgrt_ungetc (int c, estream_t stream)
+{
+ return _gpgrt_ungetc (c, stream);
+}
+
+int
+gpgrt_read (estream_t _GPGRT__RESTRICT stream,
+ void *_GPGRT__RESTRICT buffer, size_t bytes_to_read,
+ size_t *_GPGRT__RESTRICT bytes_read)
+{
+ return _gpgrt_read (stream, buffer, bytes_to_read, bytes_read);
+}
+
+int
+gpgrt_write (estream_t _GPGRT__RESTRICT stream,
+ const void *_GPGRT__RESTRICT buffer, size_t bytes_to_write,
+ size_t *_GPGRT__RESTRICT bytes_written)
+{
+ return _gpgrt_write (stream, buffer, bytes_to_write, bytes_written);
+}
+
+int
+gpgrt_write_sanitized (estream_t _GPGRT__RESTRICT stream,
+ const void * _GPGRT__RESTRICT buffer, size_t length,
+ const char * delimiters,
+ size_t * _GPGRT__RESTRICT bytes_written)
+{
+ return _gpgrt_write_sanitized (stream, buffer, length, delimiters,
+ bytes_written);
+}
+
+int
+gpgrt_write_hexstring (estream_t _GPGRT__RESTRICT stream,
+ const void *_GPGRT__RESTRICT buffer, size_t length,
+ int reserved, size_t *_GPGRT__RESTRICT bytes_written )
+{
+ return _gpgrt_write_hexstring (stream, buffer, length, reserved,
+ bytes_written);
+}
+
+size_t
+gpgrt_fread (void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems,
+ estream_t _GPGRT__RESTRICT stream)
+{
+ return _gpgrt_fread (ptr, size, nitems, stream);
+}
+
+size_t
+gpgrt_fwrite (const void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems,
+ estream_t _GPGRT__RESTRICT stream)
+{
+ return _gpgrt_fwrite (ptr, size, nitems, stream);
+}
+
+char *
+gpgrt_fgets (char *_GPGRT__RESTRICT buffer, int length,
+ estream_t _GPGRT__RESTRICT stream)
+{
+ return _gpgrt_fgets (buffer, length, stream);
+}
+
+int
+gpgrt_fputs (const char *_GPGRT__RESTRICT s, estream_t _GPGRT__RESTRICT stream)
+{
+ return _gpgrt_fputs (s, stream);
+}
+
+int
+gpgrt_fputs_unlocked (const char *_GPGRT__RESTRICT s,
+ estream_t _GPGRT__RESTRICT stream)
+{
+ return _gpgrt_fputs_unlocked (s, stream);
+}
+
+gpgrt_ssize_t
+gpgrt_getline (char *_GPGRT__RESTRICT *_GPGRT__RESTRICT lineptr,
+ size_t *_GPGRT__RESTRICT n, estream_t _GPGRT__RESTRICT stream)
+{
+ return _gpgrt_getline (lineptr, n, stream);
+}
+
+gpgrt_ssize_t
+gpgrt_read_line (estream_t stream,
+ char **addr_of_buffer, size_t *length_of_buffer,
+ size_t *max_length)
+{
+ return _gpgrt_read_line (stream, addr_of_buffer, length_of_buffer,
+ max_length);
+}
+
+void
+gpgrt_free (void *a)
+{
+ if (a)
+ _gpgrt_free (a);
+}
+
+int
+gpgrt_vfprintf (estream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format,
+ va_list ap)
+{
+ return _gpgrt_vfprintf (stream, format, ap);
+}
+
+int
+gpgrt_vfprintf_unlocked (estream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format,
+ va_list ap)
+{
+ return _gpgrt_vfprintf_unlocked (stream, format, ap);
+}
+
+int
+gpgrt_printf (const char *_GPGRT__RESTRICT format, ...)
+{
+ va_list ap;
+ int rc;
+
+ va_start (ap, format);
+ rc = _gpgrt_vfprintf (es_stdout, format, ap);
+ va_end (ap);
+
+ return rc;
+}
+
+int
+gpgrt_printf_unlocked (const char *_GPGRT__RESTRICT format, ...)
+{
+ va_list ap;
+ int rc;
+
+ va_start (ap, format);
+ rc = _gpgrt_vfprintf_unlocked (es_stdout, format, ap);
+ va_end (ap);
+
+ return rc;
+}
+
+int
+gpgrt_fprintf (estream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format, ...)
+{
+ va_list ap;
+ int rc;
+
+ va_start (ap, format);
+ rc = _gpgrt_vfprintf (stream, format, ap);
+ va_end (ap);
+
+ return rc;
+}
+
+int
+gpgrt_fprintf_unlocked (estream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format, ...)
+{
+ va_list ap;
+ int rc;
+
+ va_start (ap, format);
+ rc = _gpgrt_vfprintf_unlocked (stream, format, ap);
+ va_end (ap);
+
+ return rc;
+}
+
+int
+gpgrt_setvbuf (estream_t _GPGRT__RESTRICT stream,
+ char *_GPGRT__RESTRICT buf, int type, size_t size)
+{
+ return _gpgrt_setvbuf (stream, buf, type, size);
+}
+
+void
+gpgrt_setbuf (estream_t _GPGRT__RESTRICT stream, char *_GPGRT__RESTRICT buf)
+{
+ _gpgrt_setvbuf (stream, buf, buf? _IOFBF : _IONBF, BUFSIZ);
+}
+
+void
+gpgrt_set_binary (estream_t stream)
+{
+ _gpgrt_set_binary (stream);
+}
+
+int
+gpgrt_set_nonblock (estream_t stream, int onoff)
+{
+ return _gpgrt_set_nonblock (stream, onoff);
+}
+
+int
+gpgrt_get_nonblock (estream_t stream)
+{
+ return _gpgrt_get_nonblock (stream);
+}
+
+int
+gpgrt_poll (gpgrt_poll_t *fds, unsigned int nfds, int timeout)
+{
+ return _gpgrt_poll (fds, nfds, timeout);
+}
+
+estream_t
+gpgrt_tmpfile (void)
+{
+ return _gpgrt_tmpfile ();
+}
+
+void
+gpgrt_opaque_set (estream_t stream, void *opaque)
+{
+ _gpgrt_opaque_set (stream, opaque);
+}
+
+void *
+gpgrt_opaque_get (estream_t stream)
+{
+ return _gpgrt_opaque_get (stream);
+}
+
+void
+gpgrt_fname_set (estream_t stream, const char *fname)
+{
+ _gpgrt_fname_set (stream, fname);
+}
+
+const char *
+gpgrt_fname_get (estream_t stream)
+{
+ return _gpgrt_fname_get (stream);
+}
+
+int
+gpgrt_asprintf (char **r_buf, const char *_GPGRT__RESTRICT format, ...)
+{
+ va_list ap;
+ int rc;
+
+ va_start (ap, format);
+ rc = _gpgrt_estream_vasprintf (r_buf, format, ap);
+ va_end (ap);
+
+ return rc;
+}
+
+int
+gpgrt_vasprintf (char **r_buf, const char *_GPGRT__RESTRICT format, va_list ap)
+{
+ return _gpgrt_estream_vasprintf (r_buf, format, ap);
+}
+
+char *
+gpgrt_bsprintf (const char *_GPGRT__RESTRICT format, ...)
+{
+ int rc;
+ va_list ap;
+ char *buf;
+
+ va_start (ap, format);
+ rc = _gpgrt_estream_vasprintf (&buf, format, ap);
+ va_end (ap);
+ if (rc < 0)
+ return NULL;
+ return buf;
+}
+
+char *
+gpgrt_vbsprintf (const char *_GPGRT__RESTRICT format, va_list ap)
+{
+ int rc;
+ char *buf;
+
+ rc = _gpgrt_estream_vasprintf (&buf, format, ap);
+ if (rc < 0)
+ return NULL;
+ return buf;
+}
+
+int
+gpgrt_snprintf (char *buf, size_t bufsize, const char *format, ...)
+{
+ int rc;
+ va_list arg_ptr;
+
+ va_start (arg_ptr, format);
+ rc = _gpgrt_estream_vsnprintf (buf, bufsize, format, arg_ptr);
+ va_end (arg_ptr);
+
+ return rc;
+}
+
+int
+gpgrt_vsnprintf (char *buf, size_t bufsize,
+ const char *format, va_list arg_ptr)
+{
+ return _gpgrt_estream_vsnprintf (buf, bufsize, format, arg_ptr);
+}
+
+gpgrt_b64state_t
+gpgrt_b64dec_start (const char *title)
+{
+ return _gpgrt_b64dec_start (title);
+}
+
+gpg_error_t
+gpgrt_b64dec_proc (gpgrt_b64state_t state, void *buffer,
+ size_t length, size_t *r_nbytes)
+{
+ return _gpgrt_b64dec_proc (state, buffer, length, r_nbytes);
+}
+
+gpg_error_t
+gpgrt_b64dec_finish (gpgrt_b64state_t state)
+{
+ return _gpgrt_b64dec_finish (state);
+}
diff --git a/src/visibility.h b/src/visibility.h
new file mode 100644
index 0000000..da8e228
--- /dev/null
+++ b/src/visibility.h
@@ -0,0 +1,268 @@
+/* visibility.h - Set visibility attribute
+ * Copyright (C) 2014 g10 Code GmbH
+ *
+ * This file is part of libgpg-error.
+ *
+ * libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * libgpg-error is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef _GPGRT_VISIBILITY_H
+#define _GPGRT_VISIBILITY_H
+
+/* Include the main header here so that public symbols are mapped to
+ the internal underscored ones. */
+#ifdef _GPGRT_INCL_BY_VISIBILITY_C
+# include "gpgrt-int.h"
+#endif
+
+
+/* Our use of the ELF visibility feature works by passing
+ -fvisibiliy=hidden on the command line and by explicitly marking
+ all exported functions as visible.
+
+ NOTE: When adding new functions, please make sure to add them to
+ gpg-error.vers and gpg-error.def.in as well. */
+
+#ifdef _GPGRT_INCL_BY_VISIBILITY_C
+
+# ifdef GPGRT_USE_VISIBILITY
+# define MARK_VISIBLE(name) \
+ extern __typeof__ (name) name __attribute__ ((visibility("default")));
+# else
+# define MARK_VISIBLE(name) /* */
+# endif
+
+MARK_VISIBLE (gpg_strerror)
+MARK_VISIBLE (gpg_strerror_r)
+MARK_VISIBLE (gpg_strsource)
+MARK_VISIBLE (gpg_err_code_from_errno)
+MARK_VISIBLE (gpg_err_code_to_errno)
+MARK_VISIBLE (gpg_err_code_from_syserror)
+MARK_VISIBLE (gpg_err_set_errno)
+
+MARK_VISIBLE (gpg_err_init)
+MARK_VISIBLE (gpg_err_deinit)
+MARK_VISIBLE (gpg_error_check_version)
+MARK_VISIBLE (gpgrt_check_version)
+
+MARK_VISIBLE (gpgrt_lock_init)
+MARK_VISIBLE (gpgrt_lock_lock)
+MARK_VISIBLE (gpgrt_lock_unlock)
+MARK_VISIBLE (gpgrt_lock_destroy)
+MARK_VISIBLE (gpgrt_yield)
+MARK_VISIBLE (gpgrt_lock_trylock)
+
+MARK_VISIBLE (gpgrt_fopen)
+MARK_VISIBLE (gpgrt_mopen)
+MARK_VISIBLE (gpgrt_fopenmem)
+MARK_VISIBLE (gpgrt_fopenmem_init)
+MARK_VISIBLE (gpgrt_fdopen)
+MARK_VISIBLE (gpgrt_fdopen_nc)
+MARK_VISIBLE (gpgrt_sysopen)
+MARK_VISIBLE (gpgrt_sysopen_nc)
+MARK_VISIBLE (gpgrt_fpopen)
+MARK_VISIBLE (gpgrt_fpopen_nc)
+MARK_VISIBLE (gpgrt_freopen)
+MARK_VISIBLE (gpgrt_fopencookie)
+MARK_VISIBLE (gpgrt_fclose)
+MARK_VISIBLE (gpgrt_fclose_snatch)
+MARK_VISIBLE (gpgrt_onclose)
+MARK_VISIBLE (gpgrt_fileno)
+MARK_VISIBLE (gpgrt_fileno_unlocked)
+MARK_VISIBLE (gpgrt_syshd)
+MARK_VISIBLE (gpgrt_syshd_unlocked)
+MARK_VISIBLE (_gpgrt_set_std_fd)
+MARK_VISIBLE (_gpgrt_get_std_stream)
+MARK_VISIBLE (gpgrt_flockfile)
+MARK_VISIBLE (gpgrt_ftrylockfile)
+MARK_VISIBLE (gpgrt_funlockfile)
+MARK_VISIBLE (_gpgrt_pending)
+MARK_VISIBLE (_gpgrt_pending_unlocked)
+MARK_VISIBLE (gpgrt_feof)
+MARK_VISIBLE (gpgrt_feof_unlocked)
+MARK_VISIBLE (gpgrt_ferror)
+MARK_VISIBLE (gpgrt_ferror_unlocked)
+MARK_VISIBLE (gpgrt_clearerr)
+MARK_VISIBLE (gpgrt_clearerr_unlocked)
+MARK_VISIBLE (gpgrt_fflush)
+MARK_VISIBLE (gpgrt_fseek)
+MARK_VISIBLE (gpgrt_fseeko)
+MARK_VISIBLE (gpgrt_ftell)
+MARK_VISIBLE (gpgrt_ftello)
+MARK_VISIBLE (gpgrt_rewind)
+MARK_VISIBLE (gpgrt_fgetc)
+MARK_VISIBLE (_gpgrt_getc_underflow)
+MARK_VISIBLE (gpgrt_fputc)
+MARK_VISIBLE (_gpgrt_putc_overflow)
+MARK_VISIBLE (gpgrt_ungetc)
+MARK_VISIBLE (gpgrt_read)
+MARK_VISIBLE (gpgrt_write)
+MARK_VISIBLE (gpgrt_write_sanitized)
+MARK_VISIBLE (gpgrt_write_hexstring)
+MARK_VISIBLE (gpgrt_fread)
+MARK_VISIBLE (gpgrt_fwrite)
+MARK_VISIBLE (gpgrt_fgets)
+MARK_VISIBLE (gpgrt_fputs)
+MARK_VISIBLE (gpgrt_fputs_unlocked)
+MARK_VISIBLE (gpgrt_getline)
+MARK_VISIBLE (gpgrt_read_line)
+MARK_VISIBLE (gpgrt_free)
+MARK_VISIBLE (gpgrt_fprintf)
+MARK_VISIBLE (gpgrt_fprintf_unlocked)
+MARK_VISIBLE (gpgrt_printf)
+MARK_VISIBLE (gpgrt_printf_unlocked)
+MARK_VISIBLE (gpgrt_vfprintf)
+MARK_VISIBLE (gpgrt_vfprintf_unlocked)
+MARK_VISIBLE (gpgrt_setvbuf)
+MARK_VISIBLE (gpgrt_setbuf)
+MARK_VISIBLE (gpgrt_set_binary)
+MARK_VISIBLE (gpgrt_set_nonblock)
+MARK_VISIBLE (gpgrt_get_nonblock)
+MARK_VISIBLE (gpgrt_poll)
+MARK_VISIBLE (gpgrt_tmpfile)
+MARK_VISIBLE (gpgrt_opaque_set)
+MARK_VISIBLE (gpgrt_opaque_get)
+MARK_VISIBLE (gpgrt_fname_set)
+MARK_VISIBLE (gpgrt_fname_get)
+MARK_VISIBLE (gpgrt_asprintf)
+MARK_VISIBLE (gpgrt_vasprintf)
+MARK_VISIBLE (gpgrt_bsprintf)
+MARK_VISIBLE (gpgrt_vbsprintf)
+MARK_VISIBLE (gpgrt_snprintf)
+MARK_VISIBLE (gpgrt_vsnprintf)
+MARK_VISIBLE (gpgrt_set_syscall_clamp)
+MARK_VISIBLE (gpgrt_get_syscall_clamp)
+MARK_VISIBLE (gpgrt_set_alloc_func)
+
+MARK_VISIBLE (gpgrt_b64dec_start)
+MARK_VISIBLE (gpgrt_b64dec_proc)
+MARK_VISIBLE (gpgrt_b64dec_finish)
+
+#undef MARK_VISIBLE
+
+#else /*!_GPGRT_INCL_BY_VISIBILITY_C*/
+
+/* To avoid accidental use of the public functions inside Libgpg-error,
+ we redefine them to catch such errors. */
+
+#define gpg_strerror _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpg_strerror_r _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpg_strsource _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpg_err_code_from_errno _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpg_err_code_to_errno _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpg_err_code_from_syserror _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpg_err_set_errno _gpgrt_USE_UNDERSCORED_FUNCTION
+
+#define gpg_err_init _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpg_err_deinit _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpg_error_check_version _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_check_version _gpgrt_USE_OTHER_FUNCTION
+
+#define gpgrt_lock_init _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_lock_lock _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_lock_unlock _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_lock_destroy _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_yield _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_lock_trylock _gpgrt_USE_UNDERSCORED_FUNCTION
+
+#define gpgrt_fopen _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_mopen _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fopenmem _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fopenmem_init _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fdopen _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fdopen_nc _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_sysopen _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_sysopen_nc _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fpopen _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fpopen_nc _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_freopen _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fopencookie _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fclose _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fclose_snatch _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_onclose _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fileno _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fileno_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_syshd _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_syshd_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION
+#define _gpgrt_set_std_fd _gpgrt_USE_UNDERSCORED_FUNCTION
+#define _gpgrt_get_std_stream _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_flockfile _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_ftrylockfile _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_funlockfile _gpgrt_USE_UNDERSCORED_FUNCTION
+#define _gpgrt_pending _gpgrt_USE_UNDERSCORED_FUNCTION
+#define _gpgrt_pending_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_feof _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_feof_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_ferror _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_ferror_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_clearerr _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_clearerr_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fflush _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fseek _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fseeko _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_ftell _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_ftello _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_rewind _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fgetc _gpgrt_USE_UNDERSCORED_FUNCTION
+#define _gpgrt_getc_underflow _gpgrt_USE_DBLUNDERSCO_FUNCTION
+#define gpgrt_fputc _gpgrt_USE_UNDERSCORED_FUNCTION
+#define _gpgrt_putc_overflow _gpgrt_USE_DBLUNDERSCO_FUNCTION
+#define gpgrt_ungetc _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_read _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_write _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_write_sanitized _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_write_hexstring _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fread _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fwrite _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fgets _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fputs _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fputs_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_getline _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_read_line _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_free _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fprintf _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fprintf_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_printf _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_printf_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_vfprintf _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_vfprintf_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_setvbuf _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_setbuf _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_set_binary _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_set_nonblock _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_get_nonblock _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_poll _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_tmpfile _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_opaque_set _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_opaque_get _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fname_set _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_fname_get _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_asprintf _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_vasprintf _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_bsprintf _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_vbsprintf _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_snprintf _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_vsnprintf _gpgrt_USE_UNDERSCORED_FUNCTION
+
+#define gpgrt_set_syscall_clamp _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_get_syscall_clamp _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_set_alloc_func _gpgrt_USE_UNDERSCORED_FUNCTION
+
+#define gpgrt_b64dec_start _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_b64dec_proc _gpgrt_USE_UNDERSCORED_FUNCTION
+#define gpgrt_b64dec_finish _gpgrt_USE_UNDERSCORED_FUNCTION
+
+#endif /*!_GPGRT_INCL_BY_VISIBILITY_C*/
+
+#endif /*_GPGRT_VISIBILITY_H*/
diff --git a/src/w32-add.h b/src/w32-add.h
new file mode 100644
index 0000000..5db6500
--- /dev/null
+++ b/src/w32-add.h
@@ -0,0 +1,58 @@
+## w32-add.h - Snippet to be be included into gpg-error.h.
+## Comments are indicated by a double hash mark. Due to a
+## peculiarity of the script the first used line must not
+## start with a hash mark.
+
+/* Decide whether to use the format_arg attribute. */
+#if _GPG_ERR_GCC_VERSION > 20800
+# define _GPG_ERR_ATTR_FORMAT_ARG(a) __attribute__ ((__format_arg__ (a)))
+#else
+# define _GPG_ERR_ATTR_FORMAT_ARG(a)
+#endif
+
+/* A lean gettext implementation based on GNU style mo files which are
+ required to be encoded in UTF-8. There is a limit on 65534 entries
+ to save some RAM. Only Germanic plural rules are supported. */
+const char *_gpg_w32_bindtextdomain (const char *domainname,
+ const char *dirname);
+const char *_gpg_w32_textdomain (const char *domainname);
+const char *_gpg_w32_gettext (const char *msgid)
+ _GPG_ERR_ATTR_FORMAT_ARG (1);
+const char *_gpg_w32_dgettext (const char *domainname, const char *msgid)
+ _GPG_ERR_ATTR_FORMAT_ARG (2);
+const char *_gpg_w32_dngettext (const char *domainname, const char *msgid1,
+ const char *msgid2, unsigned long int n)
+ _GPG_ERR_ATTR_FORMAT_ARG (2) _GPG_ERR_ATTR_FORMAT_ARG (3);
+const char *_gpg_w32_gettext_localename (void);
+int _gpg_w32_gettext_use_utf8 (int value);
+
+#ifdef GPG_ERR_ENABLE_GETTEXT_MACROS
+# define bindtextdomain(a,b) _gpg_w32_bindtextdomain ((a), (b))
+# define textdomain(a) _gpg_w32_textdomain ((a))
+# define gettext(a) _gpg_w32_gettext ((a))
+# define dgettext(a,b) _gpg_w32_dgettext ((a), (b))
+# define ngettext(a,b,c) _gpg_w32_dngettext (NULL, (a), (b), (c))
+# define dngettext(a,b,c,d) _gpg_w32_dngettext ((a), (b), (c), (d))
+# define gettext_localename() _gpg_w32_gettext_localename ()
+# define gettext_use_utf8(a) _gpg_w32_gettext_use_utf8 (a)
+#endif /*GPG_ERR_ENABLE_GETTEXT_MACROS*/
+
+
+/* A simple iconv implementation w/o the need for an extra DLL. */
+struct _gpgrt_w32_iconv_s;
+typedef struct _gpgrt_w32_iconv_s *gpgrt_w32_iconv_t;
+
+gpgrt_w32_iconv_t gpgrt_w32_iconv_open (const char *tocode,
+ const char *fromcode);
+int gpgrt_w32_iconv_close (gpgrt_w32_iconv_t cd);
+size_t gpgrt_w32_iconv (gpgrt_w32_iconv_t cd,
+ const char **inbuf, size_t *inbytesleft,
+ char **outbuf, size_t *outbytesleft);
+
+#ifdef GPGRT_ENABLE_W32_ICONV_MACROS
+# define ICONV_CONST const
+# define iconv_t gpgrt_w32_iconv_t
+# define iconv_open(a,b) gpgrt_w32_iconv_open ((a), (b))
+# define iconv_close(a) gpgrt_w32_iconv_close ((a))
+# define iconv(a,b,c,d,e) gpgrt_w32_iconv ((a),(b),(c),(d),(e))
+#endif /*GPGRT_ENABLE_W32_ICONV_MACROS*/
diff --git a/src/w32-estream.c b/src/w32-estream.c
new file mode 100644
index 0000000..d9a4d36
--- /dev/null
+++ b/src/w32-estream.c
@@ -0,0 +1,1075 @@
+/* w32-estream.c - es_poll support on W32.
+ * Copyright (C) 2000 Werner Koch (dd9jn)
+ * Copyright (C) 2001, 2002, 2003, 2004, 2007, 2010, 2016 g10 Code GmbH
+ *
+ * This file is part of libgpg-error.
+ *
+ * libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * libgpg-error is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+/*
+ * This file is based on GPGME's w32-io.c started in 2001.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#include <io.h>
+#include <windows.h>
+
+/* Enable tracing. The value is the module name to be printed. */
+/*#define ENABLE_TRACING "estream" */
+
+#include "gpgrt-int.h"
+
+/*
+ * In order to support es_poll on Windows, we create a proxy shim that
+ * we use as the estream I/O functions. This shim creates reader and
+ * writer threads that use the original I/O functions.
+ */
+
+
+/* Calculate array dimension. */
+#ifndef DIM
+#define DIM(array) (sizeof (array) / sizeof (*array))
+#endif
+
+#define READBUF_SIZE 4096
+#define WRITEBUF_SIZE 4096
+
+
+typedef struct estream_cookie_w32_pollable *estream_cookie_w32_pollable_t;
+
+struct reader_context_s
+{
+ estream_cookie_w32_pollable_t pcookie;
+ HANDLE thread_hd;
+
+ CRITICAL_SECTION mutex;
+
+ int stop_me;
+ int eof;
+ int eof_shortcut;
+ int error;
+ int error_code;
+
+ /* This is manually reset. */
+ HANDLE have_data_ev;
+ /* This is automatically reset. */
+ HANDLE have_space_ev;
+ /* This is manually reset but actually only triggered once. */
+ HANDLE close_ev;
+
+ size_t readpos, writepos;
+ char buffer[READBUF_SIZE];
+};
+
+struct writer_context_s
+{
+ estream_cookie_w32_pollable_t pcookie;
+ HANDLE thread_hd;
+
+ CRITICAL_SECTION mutex;
+
+ int stop_me;
+ int error;
+ int error_code;
+
+ /* This is manually reset. */
+ HANDLE have_data;
+ HANDLE is_empty;
+ HANDLE close_ev;
+ size_t nbytes;
+ char buffer[WRITEBUF_SIZE];
+};
+
+/* Cookie for pollable objects. */
+struct estream_cookie_w32_pollable
+{
+ unsigned int modeflags;
+
+ struct cookie_io_functions_s next_functions;
+ void *next_cookie;
+
+ struct reader_context_s *reader;
+ struct writer_context_s *writer;
+};
+
+
+static HANDLE
+set_synchronize (HANDLE hd)
+{
+#ifdef HAVE_W32CE_SYSTEM
+ return hd;
+#else
+ HANDLE new_hd;
+
+ /* For NT we have to set the sync flag. It seems that the only way
+ to do it is by duplicating the handle. Tsss... */
+ if (!DuplicateHandle (GetCurrentProcess (), hd,
+ GetCurrentProcess (), &new_hd,
+ EVENT_MODIFY_STATE | SYNCHRONIZE, FALSE, 0))
+ {
+ trace_errno (1, ("DuplicateHandle failed: ec=%d", (int)GetLastError ()));
+ /* FIXME: Should translate the error code. */
+ _gpg_err_set_errno (EIO);
+ return INVALID_HANDLE_VALUE;
+ }
+
+ CloseHandle (hd);
+ return new_hd;
+#endif
+}
+
+
+static DWORD CALLBACK
+reader (void *arg)
+{
+ struct reader_context_s *ctx = arg;
+ int nbytes;
+ ssize_t nread;
+
+ trace (("%p: reader starting", ctx));
+
+ for (;;)
+ {
+ EnterCriticalSection (&ctx->mutex);
+ /* Leave a 1 byte gap so that we can see whether it is empty or
+ full. */
+ while ((ctx->writepos + 1) % READBUF_SIZE == ctx->readpos)
+ {
+ /* Wait for space. */
+ if (!ResetEvent (ctx->have_space_ev))
+ trace (("%p: ResetEvent failed: ec=%d", ctx, (int)GetLastError()));
+ LeaveCriticalSection (&ctx->mutex);
+ trace (("%p: waiting for space", ctx));
+ WaitForSingleObject (ctx->have_space_ev, INFINITE);
+ trace (("%p: got space", ctx));
+ EnterCriticalSection (&ctx->mutex);
+ }
+ assert (((ctx->writepos + 1) % READBUF_SIZE != ctx->readpos));
+ if (ctx->stop_me)
+ {
+ LeaveCriticalSection (&ctx->mutex);
+ break;
+ }
+ nbytes = (ctx->readpos + READBUF_SIZE
+ - ctx->writepos - 1) % READBUF_SIZE;
+ assert (nbytes);
+ if (nbytes > READBUF_SIZE - ctx->writepos)
+ nbytes = READBUF_SIZE - ctx->writepos;
+ LeaveCriticalSection (&ctx->mutex);
+
+ trace (("%p: reading up to %d bytes", ctx, nbytes));
+
+ nread = ctx->pcookie->next_functions.public.func_read
+ (ctx->pcookie->next_cookie, ctx->buffer + ctx->writepos, nbytes);
+ trace (("%p: got %d bytes", ctx, nread));
+ if (nread < 0)
+ {
+ ctx->error_code = (int) errno;
+ /* NOTE (W32CE): Do not ignore ERROR_BUSY! Check at
+ least stop_me if that happens. */
+ if (ctx->error_code == ERROR_BROKEN_PIPE)
+ {
+ ctx->eof = 1;
+ trace (("%p: got EOF (broken pipe)", ctx));
+ }
+ else
+ {
+ ctx->error = 1;
+ trace (("%p: read error: ec=%d", ctx, ctx->error_code));
+ }
+ break;
+ }
+
+ EnterCriticalSection (&ctx->mutex);
+ if (ctx->stop_me)
+ {
+ LeaveCriticalSection (&ctx->mutex);
+ break;
+ }
+ if (!nread)
+ {
+ ctx->eof = 1;
+ trace (("%p: got eof", ctx));
+ LeaveCriticalSection (&ctx->mutex);
+ break;
+ }
+
+ ctx->writepos = (ctx->writepos + nread) % READBUF_SIZE;
+ if (!SetEvent (ctx->have_data_ev))
+ trace (("%p: SetEvent (%p) failed: ec=%d",
+ ctx, ctx->have_data_ev, (int)GetLastError ()));
+ LeaveCriticalSection (&ctx->mutex);
+ }
+ /* Indicate that we have an error or EOF. */
+ if (!SetEvent (ctx->have_data_ev))
+ trace (("%p: SetEvent (%p) failed: ec=%d",
+ ctx, ctx->have_data_ev, (int)GetLastError ()));
+
+ trace (("%p: waiting for close", ctx));
+ WaitForSingleObject (ctx->close_ev, INFINITE);
+
+ CloseHandle (ctx->close_ev);
+ CloseHandle (ctx->have_data_ev);
+ CloseHandle (ctx->have_space_ev);
+ CloseHandle (ctx->thread_hd);
+ DeleteCriticalSection (&ctx->mutex);
+ _gpgrt_free (ctx);
+
+ return 0;
+}
+
+
+static struct reader_context_s *
+create_reader (estream_cookie_w32_pollable_t pcookie)
+{
+ struct reader_context_s *ctx;
+ SECURITY_ATTRIBUTES sec_attr;
+ DWORD tid;
+
+ memset (&sec_attr, 0, sizeof sec_attr);
+ sec_attr.nLength = sizeof sec_attr;
+ sec_attr.bInheritHandle = FALSE;
+
+ ctx = calloc (1, sizeof *ctx);
+ if (!ctx)
+ {
+ return NULL;
+ }
+
+ ctx->pcookie = pcookie;
+
+ ctx->have_data_ev = CreateEvent (&sec_attr, TRUE, FALSE, NULL);
+ if (ctx->have_data_ev)
+ ctx->have_space_ev = CreateEvent (&sec_attr, FALSE, TRUE, NULL);
+ if (ctx->have_space_ev)
+ ctx->close_ev = CreateEvent (&sec_attr, TRUE, FALSE, NULL);
+ if (!ctx->have_data_ev || !ctx->have_space_ev || !ctx->close_ev)
+ {
+ trace (("%p: CreateEvent failed: ec=%d", ctx, (int)GetLastError ()));
+ if (ctx->have_data_ev)
+ CloseHandle (ctx->have_data_ev);
+ if (ctx->have_space_ev)
+ CloseHandle (ctx->have_space_ev);
+ if (ctx->close_ev)
+ CloseHandle (ctx->close_ev);
+ _gpgrt_free (ctx);
+ return NULL;
+ }
+
+ ctx->have_data_ev = set_synchronize (ctx->have_data_ev);
+ InitializeCriticalSection (&ctx->mutex);
+
+#ifdef HAVE_W32CE_SYSTEM
+ ctx->thread_hd = CreateThread (&sec_attr, 64 * 1024, reader, ctx,
+ STACK_SIZE_PARAM_IS_A_RESERVATION, &tid);
+#else
+ ctx->thread_hd = CreateThread (&sec_attr, 0, reader, ctx, 0, &tid);
+#endif
+
+ if (!ctx->thread_hd)
+ {
+ trace (("%p: CreateThread failed: ec=%d", ctx, (int)GetLastError ()));
+ DeleteCriticalSection (&ctx->mutex);
+ if (ctx->have_data_ev)
+ CloseHandle (ctx->have_data_ev);
+ if (ctx->have_space_ev)
+ CloseHandle (ctx->have_space_ev);
+ if (ctx->close_ev)
+ CloseHandle (ctx->close_ev);
+ _gpgrt_free (ctx);
+ return NULL;
+ }
+ else
+ {
+#if 0
+ /* We set the priority of the thread higher because we know that
+ it only runs for a short time. This greatly helps to
+ increase the performance of the I/O. */
+ SetThreadPriority (ctx->thread_hd, get_desired_thread_priority ());
+#endif
+ }
+
+ return ctx;
+}
+
+
+/* Prepare destruction of the reader thread for CTX. Returns 0 if a
+ call to this function is sufficient and destroy_reader_finish shall
+ not be called. */
+static void
+destroy_reader (struct reader_context_s *ctx)
+{
+ EnterCriticalSection (&ctx->mutex);
+ ctx->stop_me = 1;
+ if (ctx->have_space_ev)
+ SetEvent (ctx->have_space_ev);
+ LeaveCriticalSection (&ctx->mutex);
+
+#ifdef HAVE_W32CE_SYSTEM
+ /* Scenario: We never create a full pipe, but already started
+ reading. Then we need to unblock the reader in the pipe driver
+ to make our reader thread notice that we want it to go away. */
+
+ if (ctx->file_hd != INVALID_HANDLE_VALUE)
+ {
+ if (!DeviceIoControl (ctx->file_hd, GPGCEDEV_IOCTL_UNBLOCK,
+ NULL, 0, NULL, 0, NULL, NULL))
+ {
+ trace (("%p: unblock control call failed: ec=%d",
+ ctx, (int)GetLastError ()));
+ }
+ }
+#endif
+
+ /* XXX is it feasible to unblock the thread? */
+
+ /* After setting this event CTX is void. */
+ SetEvent (ctx->close_ev);
+}
+
+
+/*
+ * Read function for pollable objects.
+ */
+static gpgrt_ssize_t
+func_w32_pollable_read (void *cookie, void *buffer, size_t count)
+{
+ estream_cookie_w32_pollable_t pcookie = cookie;
+ gpgrt_ssize_t nread;
+ struct reader_context_s *ctx;
+
+ trace (("%p: enter buffer=%p count=%u", cookie, buffer, count));
+
+ /* FIXME: implement pending check if COUNT==0 */
+
+ ctx = pcookie->reader;
+ if (ctx == NULL)
+ {
+ pcookie->reader = ctx = create_reader (pcookie);
+ if (!ctx)
+ {
+ _gpg_err_set_errno (EBADF);
+ nread = -1;
+ goto leave;
+ }
+ trace (("%p: new reader %p", cookie, pcookie->reader));
+ }
+
+ if (ctx->eof_shortcut)
+ {
+ nread = 0;
+ goto leave;
+ }
+
+ EnterCriticalSection (&ctx->mutex);
+ trace (("%p: readpos: %d, writepos %d", cookie, ctx->readpos, ctx->writepos));
+ if (ctx->readpos == ctx->writepos && !ctx->error)
+ {
+ /* No data available. */
+ int eof = ctx->eof;
+
+ LeaveCriticalSection (&ctx->mutex);
+
+ if (pcookie->modeflags & O_NONBLOCK && ! eof)
+ {
+ _gpg_err_set_errno (EAGAIN);
+ nread = -1;
+ goto leave;
+ }
+
+ trace (("%p: waiting for data", cookie));
+ WaitForSingleObject (ctx->have_data_ev, INFINITE);
+ trace (("%p: data available", cookie));
+ EnterCriticalSection (&ctx->mutex);
+ }
+
+ if (ctx->readpos == ctx->writepos || ctx->error)
+ {
+ LeaveCriticalSection (&ctx->mutex);
+ ctx->eof_shortcut = 1;
+ if (ctx->eof)
+ return 0;
+ if (!ctx->error)
+ {
+ trace (("%p: EOF but ctx->eof flag not set", cookie));
+ nread = 0;
+ goto leave;
+ }
+ _gpg_err_set_errno (ctx->error_code);
+ return -1;
+ }
+
+ nread = ctx->readpos < ctx->writepos
+ ? ctx->writepos - ctx->readpos
+ : READBUF_SIZE - ctx->readpos;
+ if (nread > count)
+ nread = count;
+ memcpy (buffer, ctx->buffer + ctx->readpos, nread);
+ ctx->readpos = (ctx->readpos + nread) % READBUF_SIZE;
+ if (ctx->readpos == ctx->writepos && !ctx->eof)
+ {
+ if (!ResetEvent (ctx->have_data_ev))
+ {
+ trace (("%p: ResetEvent failed: ec=%d",
+ cookie, (int)GetLastError ()));
+ LeaveCriticalSection (&ctx->mutex);
+ /* FIXME: Should translate the error code. */
+ _gpg_err_set_errno (EIO);
+ nread = -1;
+ goto leave;
+ }
+ }
+ if (!SetEvent (ctx->have_space_ev))
+ {
+ trace (("%p: SetEvent (%p) failed: ec=%d",
+ cookie, ctx->have_space_ev, (int)GetLastError ()));
+ LeaveCriticalSection (&ctx->mutex);
+ /* FIXME: Should translate the error code. */
+ _gpg_err_set_errno (EIO);
+ nread = -1;
+ goto leave;
+ }
+ LeaveCriticalSection (&ctx->mutex);
+
+ leave:
+ trace_errno (nread==-1,("%p: leave nread=%d", cookie, (int)nread));
+ return nread;
+}
+
+
+/* The writer does use a simple buffering strategy so that we are
+ informed about write errors as soon as possible (i. e. with the the
+ next call to the write function. */
+static DWORD CALLBACK
+writer (void *arg)
+{
+ struct writer_context_s *ctx = arg;
+ ssize_t nwritten;
+
+ trace (("%p: writer starting", ctx));
+
+ for (;;)
+ {
+ EnterCriticalSection (&ctx->mutex);
+ if (ctx->stop_me && !ctx->nbytes)
+ {
+ LeaveCriticalSection (&ctx->mutex);
+ break;
+ }
+ if (!ctx->nbytes)
+ {
+ if (!SetEvent (ctx->is_empty))
+ trace (("%p: SetEvent failed: ec=%d", ctx, (int)GetLastError ()));
+ if (!ResetEvent (ctx->have_data))
+ trace (("%p: ResetEvent failed: ec=%d", ctx, (int)GetLastError ()));
+ LeaveCriticalSection (&ctx->mutex);
+ trace (("%p: idle", ctx));
+ WaitForSingleObject (ctx->have_data, INFINITE);
+ trace (("%p: got data to write", ctx));
+ EnterCriticalSection (&ctx->mutex);
+ }
+ if (ctx->stop_me && !ctx->nbytes)
+ {
+ LeaveCriticalSection (&ctx->mutex);
+ break;
+ }
+ LeaveCriticalSection (&ctx->mutex);
+
+ trace (("%p: writing up to %d bytes", ctx, ctx->nbytes));
+
+ nwritten = ctx->pcookie->next_functions.public.func_write
+ (ctx->pcookie->next_cookie, ctx->buffer, ctx->nbytes);
+ trace (("%p: wrote %d bytes", ctx, nwritten));
+ if (nwritten < 1)
+ {
+ /* XXX */
+ if (errno == ERROR_BUSY)
+ {
+ /* Probably stop_me is set now. */
+ trace (("%p: pipe busy (unblocked?)", ctx));
+ continue;
+ }
+
+ ctx->error_code = errno;
+ ctx->error = 1;
+ trace (("%p: write error: ec=%d", ctx, ctx->error_code));
+ break;
+ }
+
+ EnterCriticalSection (&ctx->mutex);
+ ctx->nbytes -= nwritten;
+ LeaveCriticalSection (&ctx->mutex);
+ }
+ /* Indicate that we have an error. */
+ if (!SetEvent (ctx->is_empty))
+ trace (("%p: SetEvent failed: ec=%d", ctx, (int)GetLastError ()));
+
+ trace (("%p: waiting for close", ctx));
+ WaitForSingleObject (ctx->close_ev, INFINITE);
+
+ if (ctx->nbytes)
+ trace (("%p: still %d bytes in buffer at close time", ctx, ctx->nbytes));
+
+ CloseHandle (ctx->close_ev);
+ CloseHandle (ctx->have_data);
+ CloseHandle (ctx->is_empty);
+ CloseHandle (ctx->thread_hd);
+ DeleteCriticalSection (&ctx->mutex);
+ trace (("%p: writer is destroyed", ctx));
+ _gpgrt_free (ctx);
+
+ return 0;
+}
+
+
+static struct writer_context_s *
+create_writer (estream_cookie_w32_pollable_t pcookie)
+{
+ struct writer_context_s *ctx;
+ SECURITY_ATTRIBUTES sec_attr;
+ DWORD tid;
+
+ memset (&sec_attr, 0, sizeof sec_attr);
+ sec_attr.nLength = sizeof sec_attr;
+ sec_attr.bInheritHandle = FALSE;
+
+ ctx = calloc (1, sizeof *ctx);
+ if (!ctx)
+ {
+ return NULL;
+ }
+
+ ctx->pcookie = pcookie;
+
+ ctx->have_data = CreateEvent (&sec_attr, TRUE, FALSE, NULL);
+ if (ctx->have_data)
+ ctx->is_empty = CreateEvent (&sec_attr, TRUE, TRUE, NULL);
+ if (ctx->is_empty)
+ ctx->close_ev = CreateEvent (&sec_attr, TRUE, FALSE, NULL);
+ if (!ctx->have_data || !ctx->is_empty || !ctx->close_ev)
+ {
+ trace (("%p: CreateEvent failed: ec=%d", ctx, (int)GetLastError ()));
+ if (ctx->have_data)
+ CloseHandle (ctx->have_data);
+ if (ctx->is_empty)
+ CloseHandle (ctx->is_empty);
+ if (ctx->close_ev)
+ CloseHandle (ctx->close_ev);
+ _gpgrt_free (ctx);
+ return NULL;
+ }
+
+ ctx->is_empty = set_synchronize (ctx->is_empty);
+ InitializeCriticalSection (&ctx->mutex);
+
+#ifdef HAVE_W32CE_SYSTEM
+ ctx->thread_hd = CreateThread (&sec_attr, 64 * 1024, writer, ctx,
+ STACK_SIZE_PARAM_IS_A_RESERVATION, &tid);
+#else
+ ctx->thread_hd = CreateThread (&sec_attr, 0, writer, ctx, 0, &tid );
+#endif
+
+ if (!ctx->thread_hd)
+ {
+ trace (("%p: CreateThread failed: ec=%d", ctx, (int)GetLastError ()));
+ DeleteCriticalSection (&ctx->mutex);
+ if (ctx->have_data)
+ CloseHandle (ctx->have_data);
+ if (ctx->is_empty)
+ CloseHandle (ctx->is_empty);
+ if (ctx->close_ev)
+ CloseHandle (ctx->close_ev);
+ _gpgrt_free (ctx);
+ return NULL;
+ }
+ else
+ {
+#if 0
+ /* We set the priority of the thread higher because we know
+ that it only runs for a short time. This greatly helps to
+ increase the performance of the I/O. */
+ SetThreadPriority (ctx->thread_hd, get_desired_thread_priority ());
+#endif
+ }
+
+ return ctx;
+}
+
+
+static void
+destroy_writer (struct writer_context_s *ctx)
+{
+ trace (("%p: enter pollable_destroy_writer", ctx));
+ EnterCriticalSection (&ctx->mutex);
+ trace (("%p: setting stopme", ctx));
+ ctx->stop_me = 1;
+ if (ctx->have_data)
+ SetEvent (ctx->have_data);
+ LeaveCriticalSection (&ctx->mutex);
+
+ trace (("%p: waiting for empty", ctx));
+
+ /* Give the writer a chance to flush the buffer. */
+ WaitForSingleObject (ctx->is_empty, INFINITE);
+
+#ifdef HAVE_W32CE_SYSTEM
+ /* Scenario: We never create a full pipe, but already started
+ writing more than the pipe buffer. Then we need to unblock the
+ writer in the pipe driver to make our writer thread notice that
+ we want it to go away. */
+
+ if (!DeviceIoControl (ctx->file_hd, GPGCEDEV_IOCTL_UNBLOCK,
+ NULL, 0, NULL, 0, NULL, NULL))
+ {
+ trace (("%p: unblock control call failed: ec=%d",
+ ctx, (int)GetLastError ()));
+ }
+#endif
+
+ /* After setting this event CTX is void. */
+ trace (("%p: set close_ev", ctx));
+ SetEvent (ctx->close_ev);
+ trace (("%p: leave pollable_destroy_writer", ctx));
+}
+
+
+/*
+ * Write function for pollable objects.
+ */
+static gpgrt_ssize_t
+func_w32_pollable_write (void *cookie, const void *buffer, size_t count)
+{
+ estream_cookie_w32_pollable_t pcookie = cookie;
+ struct writer_context_s *ctx = pcookie->writer;
+ int nwritten;
+
+ trace (("%p: enter buffer: %p count: %d", cookie, buffer, count));
+ if (count == 0)
+ {
+ nwritten = 0;
+ goto leave;
+ }
+
+ if (ctx == NULL)
+ {
+ pcookie->writer = ctx = create_writer (pcookie);
+ if (!ctx)
+ {
+ nwritten = -1;
+ goto leave;
+ }
+ trace (("%p: new writer %p", cookie, pcookie->writer));
+ }
+
+ EnterCriticalSection (&ctx->mutex);
+ trace (("%p: buffer: %p, count: %d, nbytes: %d",
+ cookie, buffer, count, ctx->nbytes));
+ if (!ctx->error && ctx->nbytes)
+ {
+ /* Bytes are pending for send. */
+
+ /* Reset the is_empty event. Better safe than sorry. */
+ if (!ResetEvent (ctx->is_empty))
+ {
+ trace (("%p: ResetEvent failed: ec=%d",
+ cookie, (int)GetLastError ()));
+ LeaveCriticalSection (&ctx->mutex);
+ /* FIXME: Should translate the error code. */
+ _gpg_err_set_errno (EIO);
+ nwritten = -1;
+ goto leave;
+ }
+ LeaveCriticalSection (&ctx->mutex);
+
+ if (pcookie->modeflags & O_NONBLOCK)
+ {
+ trace (("%p: would block", cookie));
+ _gpg_err_set_errno (EAGAIN);
+ nwritten = -1;
+ goto leave;
+ }
+
+ trace (("%p: waiting for empty buffer", cookie));
+ WaitForSingleObject (ctx->is_empty, INFINITE);
+ trace (("%p: buffer is empty", cookie));
+ EnterCriticalSection (&ctx->mutex);
+ }
+
+ if (ctx->error)
+ {
+ LeaveCriticalSection (&ctx->mutex);
+ if (ctx->error_code == ERROR_NO_DATA)
+ _gpg_err_set_errno (EPIPE);
+ else
+ _gpg_err_set_errno (EIO);
+ nwritten = -1;
+ goto leave;
+ }
+
+ /* If no error occurred, the number of bytes in the buffer must be
+ zero. */
+ assert (!ctx->nbytes);
+
+ if (count > WRITEBUF_SIZE)
+ count = WRITEBUF_SIZE;
+ memcpy (ctx->buffer, buffer, count);
+ ctx->nbytes = count;
+
+ /* We have to reset the is_empty event early, because it is also
+ used by the select() implementation to probe the channel. */
+ if (!ResetEvent (ctx->is_empty))
+ {
+ trace (("%p: ResetEvent failed: ec=%d", cookie, (int)GetLastError ()));
+ LeaveCriticalSection (&ctx->mutex);
+ /* FIXME: Should translate the error code. */
+ _gpg_err_set_errno (EIO);
+ nwritten = -1;
+ goto leave;
+ }
+ if (!SetEvent (ctx->have_data))
+ {
+ trace (("%p: SetEvent failed: ec=%d", cookie, (int)GetLastError ()));
+ LeaveCriticalSection (&ctx->mutex);
+ /* FIXME: Should translate the error code. */
+ _gpg_err_set_errno (EIO);
+ nwritten = -1;
+ goto leave;
+ }
+ LeaveCriticalSection (&ctx->mutex);
+
+ nwritten = count;
+
+ leave:
+ trace_errno (nwritten==-1,("%p: leave nwritten=%d", cookie, nwritten));
+ return nwritten;
+}
+
+
+int
+_gpgrt_w32_poll (gpgrt_poll_t *fds, size_t nfds, int timeout)
+{
+ HANDLE waitbuf[MAXIMUM_WAIT_OBJECTS];
+ int waitidx[MAXIMUM_WAIT_OBJECTS];
+ char waitinfo[MAXIMUM_WAIT_OBJECTS];
+ unsigned int code;
+ int nwait;
+ int i;
+ int any;
+ int count;
+
+#if 0
+ restart:
+#endif
+
+ any = 0;
+ nwait = 0;
+ count = 0;
+ for (i = 0; i < nfds; i++)
+ {
+ struct estream_cookie_w32_pollable *pcookie;
+
+ if (fds[i].ignore)
+ continue;
+
+ if (fds[i].stream->intern->kind != BACKEND_W32_POLLABLE)
+ {
+ /* This stream does not support polling. */
+ fds[i].got_err = 1;
+ continue;
+ }
+
+ pcookie = fds[i].stream->intern->cookie;
+
+ if (fds[i].want_read || fds[i].want_write)
+ {
+ /* XXX: What if one wants read and write, is that supported? */
+ if (fds[i].want_read)
+ {
+ struct reader_context_s *ctx = pcookie->reader;
+ if (ctx == NULL)
+ {
+ pcookie->reader = ctx = create_reader (pcookie);
+ if (!ctx)
+ {
+ /* FIXME: Is the error code appropriate? */
+ _gpg_err_set_errno (EBADF);
+ return -1;
+ }
+ trace (("%p: new reader %p", pcookie, pcookie->reader));
+ }
+ trace (("%p: using reader %p", pcookie, pcookie->reader));
+
+ if (nwait >= DIM (waitbuf))
+ {
+ trace (("oops: too many objects for WFMO"));
+ /* FIXME: Should translate the error code. */
+ _gpg_err_set_errno (EIO);
+ return -1;
+ }
+ waitidx[nwait] = i;
+ waitinfo[nwait] = 'r';
+ waitbuf[nwait++] = ctx->have_data_ev;
+ any = 1;
+ }
+ else if (fds[i].want_write)
+ {
+ struct writer_context_s *ctx = pcookie->writer;
+ if (ctx == NULL)
+ {
+ pcookie->writer = ctx = create_writer (pcookie);
+ if (!ctx)
+ {
+ trace (("oops: create writer failed"));
+ /* FIXME: Is the error code appropriate? */
+ _gpg_err_set_errno (EBADF);
+ return -1;
+ }
+ trace (("%p: new writer %p", pcookie, pcookie->writer));
+ }
+ trace (("%p: using writer %p", pcookie, pcookie->writer));
+
+ if (nwait >= DIM (waitbuf))
+ {
+ trace (("oops: Too many objects for WFMO"));
+ /* FIXME: Should translate the error code. */
+ _gpg_err_set_errno (EIO);
+ return -1;
+ }
+ waitidx[nwait] = i;
+ waitinfo[nwait] = 'w';
+ waitbuf[nwait++] = ctx->is_empty;
+ any = 1;
+ }
+ }
+ }
+ trace_start (("poll on [ "));
+ for (i = 0; i < nwait; i++)
+ trace_append (("%d/%c ", waitidx[i], waitinfo[i]));
+ trace_finish (("]"));
+ if (!any)
+ return 0;
+
+ code = WaitForMultipleObjects (nwait, waitbuf, 0,
+ timeout == -1 ? INFINITE : timeout);
+ if (code < WAIT_OBJECT_0 + nwait)
+ {
+ /* This WFMO is a really silly function: It does return either
+ the index of the signaled object or if 2 objects have been
+ signalled at the same time, the index of the object with the
+ lowest object is returned - so and how do we find out how
+ many objects have been signaled???. The only solution I can
+ imagine is to test each object starting with the returned
+ index individually - how dull. */
+ any = 0;
+ for (i = code - WAIT_OBJECT_0; i < nwait; i++)
+ {
+ if (WaitForSingleObject (waitbuf[i], 0) == WAIT_OBJECT_0)
+ {
+ assert (waitidx[i] >=0 && waitidx[i] < nfds);
+ /* XXX: What if one wants read and write, is that
+ supported? */
+ if (fds[waitidx[i]].want_read)
+ fds[waitidx[i]].got_read = 1;
+ else if (fds[waitidx[i]].want_write)
+ fds[waitidx[i]].got_write = 1;
+ any = 1;
+ count++;
+ }
+ }
+ if (!any)
+ {
+ trace (("no signaled objects found after WFMO"));
+ count = -1;
+ }
+ }
+ else if (code == WAIT_TIMEOUT)
+ trace (("WFMO timed out"));
+ else if (code == WAIT_FAILED)
+ {
+ trace (("WFMO failed: ec=%d", (int)GetLastError ()));
+#if 0
+ if (GetLastError () == ERROR_INVALID_HANDLE)
+ {
+ int k;
+ int j = handle_to_fd (waitbuf[i]);
+
+ trace (("WFMO invalid handle %d removed", j));
+ for (k = 0 ; k < nfds; k++)
+ {
+ if (fds[k].fd == j)
+ {
+ fds[k].want_read = fds[k].want_write = 0;
+ goto restart;
+ }
+ }
+ trace ((" oops, or not???"));
+ }
+#endif
+ count = -1;
+ }
+ else
+ {
+ trace (("WFMO returned %u", code));
+ count = -1;
+ }
+
+ if (count > 0)
+ {
+ trace_start (("poll OK [ "));
+ for (i = 0; i < nfds; i++)
+ {
+ if (fds[i].ignore)
+ continue;
+ if (fds[i].got_read || fds[i].got_write)
+ trace_append (("%c%d ", fds[i].want_read ? 'r' : 'w', i));
+ }
+ trace_finish (("]"));
+ }
+
+ if (count < 0)
+ {
+ /* FIXME: Should determine a proper error code. */
+ _gpg_err_set_errno (EIO);
+ }
+
+ return count;
+}
+
+
+
+/*
+ * Implementation of pollable I/O on Windows.
+ */
+
+/*
+ * Constructor for pollable objects.
+ */
+int
+_gpgrt_w32_pollable_create (void *_GPGRT__RESTRICT *_GPGRT__RESTRICT cookie,
+ unsigned int modeflags,
+ struct cookie_io_functions_s next_functions,
+ void *next_cookie)
+{
+ estream_cookie_w32_pollable_t pcookie;
+ int err;
+
+ pcookie = _gpgrt_malloc (sizeof *pcookie);
+ if (!pcookie)
+ err = -1;
+ else
+ {
+ pcookie->modeflags = modeflags;
+ pcookie->next_functions = next_functions;
+ pcookie->next_cookie = next_cookie;
+ pcookie->reader = NULL;
+ pcookie->writer = NULL;
+ *cookie = pcookie;
+ err = 0;
+ }
+
+ trace_errno (err,("cookie=%p", *cookie));
+ return err;
+}
+
+
+/*
+ * Seek function for pollable objects.
+ */
+static int
+func_w32_pollable_seek (void *cookie, gpgrt_off_t *offset, int whence)
+{
+ estream_cookie_w32_pollable_t pcookie = cookie;
+ (void) pcookie;
+ (void) offset;
+ (void) whence;
+ /* XXX */
+ _gpg_err_set_errno (EOPNOTSUPP);
+ return -1;
+}
+
+
+/*
+ * The IOCTL function for pollable objects.
+ */
+static int
+func_w32_pollable_ioctl (void *cookie, int cmd, void *ptr, size_t *len)
+{
+ estream_cookie_w32_pollable_t pcookie = cookie;
+ cookie_ioctl_function_t func_ioctl = pcookie->next_functions.func_ioctl;
+
+ if (cmd == COOKIE_IOCTL_NONBLOCK)
+ {
+ if (ptr)
+ pcookie->modeflags |= O_NONBLOCK;
+ else
+ pcookie->modeflags &= ~O_NONBLOCK;
+ return 0;
+ }
+
+ if (func_ioctl)
+ return func_ioctl (pcookie->next_cookie, cmd, ptr, len);
+
+ _gpg_err_set_errno (EOPNOTSUPP);
+ return -1;
+}
+
+
+/*
+ * The destroy function for pollable objects.
+ */
+static int
+func_w32_pollable_destroy (void *cookie)
+{
+ estream_cookie_w32_pollable_t pcookie = cookie;
+
+ if (cookie)
+ {
+ if (pcookie->reader)
+ destroy_reader (pcookie->reader);
+ if (pcookie->writer)
+ destroy_writer (pcookie->writer);
+ pcookie->next_functions.public.func_close (pcookie->next_cookie);
+ _gpgrt_free (pcookie);
+ }
+ return 0;
+}
+
+/*
+ * Access object for the pollable functions.
+ */
+struct cookie_io_functions_s _gpgrt_functions_w32_pollable =
+ {
+ {
+ func_w32_pollable_read,
+ func_w32_pollable_write,
+ func_w32_pollable_seek,
+ func_w32_pollable_destroy,
+ },
+ func_w32_pollable_ioctl,
+ };
diff --git a/src/w32-gettext.c b/src/w32-gettext.c
new file mode 100644
index 0000000..3b54ebd
--- /dev/null
+++ b/src/w32-gettext.c
@@ -0,0 +1,1958 @@
+/* w32-gettext.h - A simple gettext implementation for Windows targets.
+ Copyright (C) 1995, 1996, 1997, 1999, 2005, 2007,
+ 2008, 2010 Free Software Foundation, Inc.
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+#if !defined (_WIN32) && !defined (__CYGWIN32__)
+# error This module may only be build for Windows or Cygwin32
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <ctype.h>
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#include <stdint.h>
+#ifndef HAVE_W32CE_SYSTEM
+# include <locale.h>
+#endif /*HAVE_W32CE_SYSTEM*/
+#include <windows.h>
+
+#ifdef JNLIB_IN_JNLIB
+#include "libjnlib-config.h"
+#endif
+
+#ifndef jnlib_malloc
+# define jnlib_malloc(a) malloc ((a))
+# define jnlib_calloc(a,b) calloc ((a), (b))
+# define jnlib_free(a) free ((a))
+# define jnlib_xstrdup(a) not_used
+#endif /*!jnlib_malloc*/
+
+#include "init.h"
+#include "gpg-error.h"
+
+#ifdef HAVE_W32CE_SYSTEM
+/* Forward declaration. */
+static wchar_t *utf8_to_wchar (const char *string, size_t length, size_t *retlen);
+
+static HANDLE
+MyCreateFileA (LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwSharedMode,
+ LPSECURITY_ATTRIBUTES lpSecurityAttributes,
+ DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes,
+ HANDLE hTemplateFile)
+{
+ wchar_t *filename;
+ HANDLE result;
+ int err;
+ size_t size;
+
+ filename = utf8_to_wchar (lpFileName, -1, &size);
+ if (!filename)
+ return INVALID_HANDLE_VALUE;
+
+ result = CreateFileW (filename, dwDesiredAccess, dwSharedMode,
+ lpSecurityAttributes, dwCreationDisposition,
+ dwFlagsAndAttributes, hTemplateFile);
+
+ err = GetLastError ();
+ free (filename);
+ SetLastError (err);
+ return result;
+}
+#undef CreateFileA
+#define CreateFileA MyCreateFileA
+#endif
+
+
+/* localname.c from gettext BEGIN. */
+
+/* Determine the current selected locale.
+ 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. */
+
+/* Written by Ulrich Drepper <[email protected]>, 1995. */
+/* Win32 code written by Tor Lillqvist <[email protected]>. */
+/* Renamed _nl_locale_name, removed unused args, removed include files,
+ non-W32 code and changed comments <[email protected]>. */
+
+/* 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 0x01
+#endif
+#ifndef SUBLANG_BENGALI_BANGLADESH
+#define SUBLANG_BENGALI_BANGLADESH 0x02
+#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 0x01
+#endif
+#ifndef SUBLANG_ROMANIAN_ROMANIA
+#define SUBLANG_ROMANIAN_ROMANIA 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
+
+/* Return an XPG style locale name
+ language[_territory[.codeset]][@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. The result must not be freed; it is statically
+ allocated. */
+static const char *
+my_nl_locale_name (const char *categoryname)
+{
+#ifndef HAVE_W32CE_SYSTEM
+ const char *retval;
+#endif
+ LCID lcid;
+ LANGID langid;
+ int primary, sub;
+
+ /* Let the user override the system settings through environment
+ variables, as on POSIX systems. */
+#ifndef HAVE_W32CE_SYSTEM
+ 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;
+#endif /*!HAVE_W32CE_SYSTEM*/
+
+ /* Use native Win32 API locale ID. */
+#ifdef HAVE_W32CE_SYSTEM
+ lcid = GetSystemDefaultLCID ();
+#else
+ lcid = GetThreadLocale ();
+#endif
+
+ /* 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.
+ For details about languages, see https://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 "div_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: return "ful_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 "ibo_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 "kau_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 */
+ }
+ return "pa";
+ case LANG_RHAETO_ROMANCE: return "rm_CH";
+ case LANG_ROMANIAN:
+ switch (sub)
+ {
+ case SUBLANG_ROMANIAN_ROMANIA: return "ro_RO";
+ }
+ 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";
+ }
+}
+
+/* localname.c from gettext END. */
+
+
+
+/* Support functions. */
+
+static GPG_ERR_INLINE uint32_t
+do_swap_u32 (uint32_t i)
+{
+ return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
+}
+
+#define SWAPIT(flag, data) ((flag) ? do_swap_u32(data) : (data))
+
+
+/* We assume to have `unsigned long int' value with at least 32 bits. */
+#define HASHWORDBITS 32
+
+/* 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 GPG_ERR_INLINE unsigned long
+hash_string (const char *str_param)
+{
+ unsigned long int hval, g;
+ const char *str = str_param;
+
+ hval = 0;
+ while (*str != '\0')
+ {
+ hval <<= 4;
+ hval += (unsigned long int) *str++;
+ g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4));
+ if (g != 0)
+ {
+ hval ^= g >> (HASHWORDBITS - 8);
+ hval ^= g;
+ }
+ }
+ return hval;
+}
+
+
+/* Generic message catalog and gettext stuff. */
+
+/* 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
+
+
+/* Header for binary .mo file format. */
+struct mo_file_header
+{
+ /* The magic number. */
+ uint32_t magic;
+ /* The revision number of the file format. */
+ uint32_t revision;
+ /* The number of strings pairs. */
+ uint32_t nstrings;
+ /* Offset of table with start offsets of original strings. */
+ uint32_t orig_tab_offset;
+ /* Offset of table with start offsets of translation strings. */
+ uint32_t trans_tab_offset;
+ /* Size of hashing table. */
+ uint32_t hash_tab_size;
+ /* Offset of first hashing entry. */
+ uint32_t hash_tab_offset;
+};
+
+
+struct string_desc
+{
+ /* Length of addressed string. */
+ uint32_t length;
+ /* Offset of string in file. */
+ uint32_t offset;
+};
+
+
+struct overflow_space_s
+{
+ struct overflow_space_s *next;
+ uint32_t idx;
+ uint32_t length;
+ char d[1];
+};
+
+struct loaded_domain
+{
+ char *data;
+ char *data_native; /* Data mapped to the native version of the
+ string. (Allocated along with DATA). */
+ int must_swap;
+ uint16_t nstrings; /* Number of strings. */
+ uint16_t *mapped; /* Array of mapping indicators:
+ 0 := Not mapped (original utf8).
+ 1 := Mapped to native encoding in overflow space.
+ >=2 := Mapped to native encoding. The value
+ gives the length of the mapped string.
+ Because the terminating nul is included
+ in the length and an empty string is
+ not allowed, values are always > 1. */
+ struct overflow_space_s *overflow_space;
+ struct string_desc *orig_tab;
+ struct string_desc *trans_tab;
+ uint32_t hash_size;
+ uint32_t *hash_tab;
+};
+
+
+/* The list of domains we we are aware of. This list is protected by
+ the criticla section DOMAINLIST_ACCESS_CS. */
+static struct domainlist_s *domainlist;
+
+/* A critical section to guard access to the domainlist. */
+static CRITICAL_SECTION domainlist_access_cs;
+
+/* The name of the current domain. This is a malloced string. This
+ is a gobal variable which is not thread-safe. */
+static char *current_domainname;
+
+
+
+/* Constructor for this module. This can only be used if we are a
+ DLL. If used as a static lib we can't control the process set; for
+ example it might be used with a main module which is not build with
+ mingw and thus does not know how to call the constructors. */
+#ifdef DLL_EXPORT
+static void module_init (void) _GPG_ERR_CONSTRUCTOR;
+#endif
+static void
+module_init (void)
+{
+ static int init_done;
+
+ if (!init_done)
+ {
+ InitializeCriticalSection (&domainlist_access_cs);
+ init_done = 1;
+ }
+}
+
+#if !defined(DLL_EXPORT) || !defined(_GPG_ERR_HAVE_CONSTRUCTOR)
+void
+_gpg_w32__init_gettext_module (void)
+{
+ module_init ();
+}
+#endif
+
+
+/* Free the domain data. */
+static void
+free_domain (struct loaded_domain *domain)
+{
+ struct overflow_space_s *os, *os2;
+
+ jnlib_free (domain->data);
+ jnlib_free (domain->mapped);
+ for (os = domain->overflow_space; os; os = os2)
+ {
+ os2 = os->next;
+ jnlib_free (os);
+ }
+ jnlib_free (domain);
+}
+
+
+static struct loaded_domain *
+load_domain (const char *filename)
+{
+ HANDLE fh;
+ DWORD size;
+ struct mo_file_header *data = NULL;
+ struct loaded_domain *domain = NULL;
+ size_t to_read;
+ char *read_ptr;
+
+ fh = CreateFileA (filename, GENERIC_READ, FILE_SHARE_WRITE, NULL,
+ OPEN_EXISTING, 0, NULL);
+ if (fh == INVALID_HANDLE_VALUE)
+ return NULL;
+
+ size = GetFileSize (fh, NULL);
+ if (size == INVALID_FILE_SIZE)
+ {
+ CloseHandle (fh);
+ return NULL;
+ }
+
+ data = (2*size <= size)? NULL : jnlib_malloc (2*size);
+ if (!data)
+ {
+ CloseHandle (fh);
+ return NULL;
+ }
+
+ to_read = size;
+ read_ptr = (char *) data;
+ do
+ {
+ BOOL res;
+ DWORD nb;
+
+ res = ReadFile (fh, read_ptr, to_read, &nb, NULL);
+ if (! res || nb < to_read)
+ {
+ CloseHandle (fh);
+ jnlib_free (data);
+ return NULL;
+ }
+ read_ptr += nb;
+ to_read -= nb;
+ }
+ while (to_read > 0);
+ CloseHandle (fh);
+
+ /* Using the magic number we can test whether it really is a message
+ catalog file. */
+ if (data->magic != MAGIC && data->magic != MAGIC_SWAPPED)
+ {
+ /* The magic number is wrong: not a message catalog file. */
+ jnlib_free (data);
+ return NULL;
+ }
+
+ domain = jnlib_calloc (1, sizeof *domain);
+ if (!domain)
+ {
+ jnlib_free (data);
+ return NULL;
+ }
+ domain->data = (char *) data;
+ domain->data_native = (char *) data + size;
+ domain->must_swap = data->magic != MAGIC;
+
+ /* Fill in the information about the available tables. */
+ switch (SWAPIT (domain->must_swap, data->revision))
+ {
+ case MO_REVISION_NUMBER:
+ {
+ uint32_t nstrings;
+
+ /* Because we use 16 bit values for the mapping array, we
+ can't support more that 65534 strings (65535 would be okay,
+ but it is often used as a special value). A PO file with
+ that many translations is very unlikely given that GnuPG
+ with its very large number of strings has only about 1600
+ strings + variants. */
+ nstrings = SWAPIT (domain->must_swap, data->nstrings);
+ if (nstrings > 65534)
+ goto bailout;
+ domain->nstrings = nstrings;
+ domain->orig_tab = (struct string_desc *)
+ ((char *) data + SWAPIT (domain->must_swap, data->orig_tab_offset));
+ domain->trans_tab = (struct string_desc *)
+ ((char *) data + SWAPIT (domain->must_swap, data->trans_tab_offset));
+ domain->hash_size = SWAPIT (domain->must_swap, data->hash_tab_size);
+ domain->hash_tab = (uint32_t *)
+ ((char *) data + SWAPIT (domain->must_swap, data->hash_tab_offset));
+ }
+ break;
+
+ default: /* This is an invalid revision. */
+ goto bailout;
+ }
+
+ /* Allocate an array to keep track of code page mappings. */
+ domain->mapped = jnlib_calloc (domain->nstrings, sizeof *domain->mapped);
+ if (domain->mapped)
+ return domain; /* Okay. */
+
+ bailout:
+ jnlib_free (data);
+ jnlib_free (domain);
+ return NULL;
+}
+
+
+/* Return a malloced wide char string from an UTF-8 encoded input
+ string STRING. Caller must free this value. On failure returns
+ NULL. The result of calling this function with STRING set to NULL
+ is not defined. */
+static wchar_t *
+utf8_to_wchar (const char *string, size_t length, size_t *retlen)
+{
+ int n;
+ wchar_t *result;
+ size_t nbytes;
+
+ n = MultiByteToWideChar (CP_UTF8, 0, string, length, NULL, 0);
+ if (n < 0 || (n+1) <= 0)
+ return NULL;
+
+ nbytes = (size_t)(n+1) * sizeof(*result);
+ if (nbytes / sizeof(*result) != (n+1))
+ {
+ gpg_err_set_errno (ENOMEM);
+ return NULL;
+ }
+ result = jnlib_malloc (nbytes);
+ if (!result)
+ return NULL;
+
+ n = MultiByteToWideChar (CP_UTF8, 0, string, length, result, n);
+ if (n < 0)
+ {
+ jnlib_free (result);
+ return NULL;
+ }
+ *retlen = n;
+ return result;
+}
+
+
+/* Return a malloced string encoded in the native console codepage
+ from the wide char input string STRING.
+ Caller must free this value. On failure returns NULL.
+ The result of calling this function with STRING set to NULL
+ is not defined. */
+static char *
+wchar_to_native (const wchar_t *string, size_t length, size_t *retlen)
+{
+ int n;
+ char *result;
+ unsigned int cpno = GetConsoleOutputCP ();
+
+ /* GetConsoleOutputCP returns the 8-Bit codepage that should be used
+ for console output. If the codepage is not returned we fall back
+ to the codepage GUI programs should use (CP_ACP). */
+ if (!cpno)
+ cpno = GetACP ();
+
+ n = WideCharToMultiByte (cpno, 0, string, length, NULL, 0, NULL, NULL);
+ if (n < 0 || (n+1) <= 0)
+ return NULL;
+
+ result = jnlib_malloc (n+1);
+ if (!result)
+ return NULL;
+
+ n = WideCharToMultiByte (cpno, 0, string, length, result, n, NULL, NULL);
+ if (n < 0)
+ {
+ jnlib_free (result);
+ return NULL;
+ }
+ *retlen = n;
+ return result;
+}
+
+
+/* Convert UTF8 to the native codepage. Caller must free the return value. */
+static char *
+utf8_to_native (const char *string, size_t length, size_t *retlen)
+{
+ wchar_t *wstring;
+ char *result;
+ size_t newlen;
+
+ wstring = utf8_to_wchar (string, length, &newlen);
+ if (wstring)
+ {
+ result = wchar_to_native (wstring, newlen, &newlen);
+ jnlib_free (wstring);
+ }
+ else
+ result = NULL;
+ *retlen = result? newlen : 0;
+ return result;
+}
+
+
+
+
+/* Specify that the DOMAINNAME message catalog will be found
+ in DIRNAME rather than in the system locale data base. */
+const char *
+_gpg_w32_bindtextdomain (const char *domainname, const char *dirname)
+{
+ const char *catval_full;
+ char *catval;
+ char *fname;
+ const char *retvalue;
+
+ if (!dirname)
+ {
+ struct domainlist_s *dl;
+
+ retvalue = NULL;
+ EnterCriticalSection (&domainlist_access_cs);
+ {
+ for (dl = domainlist; dl; dl = dl->next)
+ if (!strcmp (dl->name, domainname))
+ {
+ retvalue = dl->dname;
+ break;
+ }
+ }
+ LeaveCriticalSection (&domainlist_access_cs);
+ return retvalue;
+ }
+
+ /* DIRNAME is "$INSTALLDIR\share\locale". */
+
+ /* First find out the category value. */
+ catval = NULL;
+ catval_full = my_nl_locale_name ("LC_MESSAGES");
+
+ /* Normally we would have to loop over all returned locales and
+ search for the right file. See gettext intl/dcigettext.c for all
+ the gory details. Here, we only support the basic category, and
+ ignore everything else. */
+ if (catval_full)
+ {
+ char *p;
+
+ catval = jnlib_malloc (strlen (catval_full) + 1);
+ if (catval)
+ {
+ strcpy (catval, catval_full);
+ p = strchr (catval, '_');
+ if (p)
+ *p = '\0';
+ }
+ }
+ if (!catval)
+ return NULL;
+
+ /* Now build the filename string. The complete filename is this:
+ DIRNAME + \ + CATVAL + \LC_MESSAGES\ + DOMAINNAME + .mo */
+ {
+ int len = (strlen (dirname) + 1 + strlen (catval) + 13
+ + strlen (domainname) + 3 + 1);
+ char *p;
+
+ fname = jnlib_malloc (len);
+ if (!fname)
+ {
+ jnlib_free (catval);
+ return NULL;
+ }
+
+ p = fname;
+ strcpy (p, dirname);
+ p += strlen (dirname);
+ *(p++) = '\\';
+ strcpy (p, catval);
+ p += strlen (catval);
+ strcpy (p, "\\LC_MESSAGES\\");
+ p += 13;
+ strcpy (p, domainname);
+ p += strlen (domainname);
+ strcpy (p, ".mo");
+ }
+
+ jnlib_free (catval);
+
+ /* Store the domain information in the domainlist. */
+ {
+ struct domainlist_s *item, *dl;
+ char *rel_ptr1 = NULL;
+ char *rel_ptr2 = NULL;
+
+ item = jnlib_calloc (1, sizeof *dl + strlen (domainname));
+ if (!item)
+ {
+ jnlib_free (fname);
+ return NULL;
+ }
+ strcpy (item->name, domainname);
+ item->dname = jnlib_malloc (strlen (dirname) +1);
+ if(!item->dname)
+ {
+ jnlib_free (item);
+ jnlib_free (fname);
+ return NULL;
+ }
+ strcpy (item->dname, dirname);
+ retvalue = item->dname;
+
+ EnterCriticalSection (&domainlist_access_cs);
+ {
+ for (dl = domainlist; dl; dl = dl->next)
+ if (!strcmp (dl->name, domainname))
+ break;
+ if (!dl) /* First time called for this domainname. */
+ {
+ item->fname = fname;
+ fname = NULL;
+ item->next = domainlist;
+ domainlist = item;
+ item = NULL;
+ }
+ else /* Update only. */
+ {
+ rel_ptr1 = dl->fname;
+ dl->fname = fname;
+ fname = NULL;
+ rel_ptr2 = dl->dname;
+ dl->dname = item->dname;
+ item->dname = NULL;
+ }
+ }
+ LeaveCriticalSection (&domainlist_access_cs);
+
+ jnlib_free (item);
+ jnlib_free (rel_ptr1);
+ jnlib_free (rel_ptr2);
+ }
+
+ return retvalue;
+}
+
+
+
+
+static const char *
+get_plural (const char *data, size_t datalen, unsigned long nplural)
+{
+ const char *p;
+ int idx;
+
+ /* We only support the Germanic rule. */
+ idx = (nplural == 1? 0 : 1);
+
+ for (; idx; idx--)
+ {
+ p = strchr (data, 0) + 1;
+ if (p >= data+datalen)
+ return "ERROR in GETTEXT (bad plural entry)";
+ datalen -= (p-data);
+ data = p;
+ }
+ return data;
+}
+
+
+static const char*
+get_string (struct loaded_domain *domain, uint32_t idx,
+ int use_plural, unsigned long nplural)
+{
+ struct tls_space_s *tls = get_tls ();
+ struct overflow_space_s *os;
+ const char *trans; /* Pointer to the translated entry. */
+ size_t translen; /* Length of that entry. */
+
+ if (idx > 65534)
+ return "ERROR in GETTEXT (too many strings)";
+
+ if (tls->gt_use_utf8)
+ {
+ trans = (domain->data
+ + SWAPIT(domain->must_swap, domain->trans_tab[idx].offset));
+ translen = SWAPIT(domain->must_swap, domain->trans_tab[idx].length);
+ }
+ else if (!domain->mapped[idx])
+ {
+ /* Not yet mapped. Map from utf-8 to native encoding now. */
+ const char *p_utf8;
+ size_t plen_utf8, buflen;
+ char *buf;
+
+ p_utf8 = (domain->data
+ + SWAPIT(domain->must_swap, domain->trans_tab[idx].offset));
+ plen_utf8 = SWAPIT(domain->must_swap, domain->trans_tab[idx].length);
+
+ /* We need to include the nul, so that the utf8->wchar->native
+ conversion chain works correctly and the nul is stored after
+ the conversion. */
+ if (p_utf8[plen_utf8])
+ {
+ trans = "ERROR in MO file"; /* Terminating zero is missing. */
+ translen = 0;
+ goto leave;
+ }
+ plen_utf8++;
+
+ buf = utf8_to_native (p_utf8, plen_utf8, &buflen);
+ if (!buf)
+ {
+ trans = "ERROR in GETTEXT MALLOC";
+ translen = 0;
+ }
+ else if (buflen <= plen_utf8 && buflen > 1)
+ {
+ /* Copy into the DATA_NATIVE area. */
+ char *p_tmp;
+
+ p_tmp = (domain->data_native
+ + SWAPIT(domain->must_swap, domain->trans_tab[idx].offset));
+ memcpy (p_tmp, buf, buflen);
+ domain->mapped[idx] = buflen;
+ trans = p_tmp;
+ translen = buflen;
+ }
+ else
+ {
+ /* There is not enough space for the translation (or for
+ whatever reason an empty string is used): Store it in the
+ overflow_space and mark that in the mapped array.
+ Because UTF-8 strings are in general longer than the
+ Windows native encoding, we expect that this won't happen
+ too often and thus we use a linked list to manage this
+ space. */
+ os = jnlib_malloc (sizeof *os + buflen);
+ if (os)
+ {
+ os->idx = idx;
+ memcpy (os->d, buf, buflen);
+ os->length = buflen;
+ os->next = domain->overflow_space;
+ domain->overflow_space = os;
+ domain->mapped[idx] = 1;
+ trans = os->d;
+ translen = os->length;
+ }
+ else
+ {
+ trans = "ERROR in GETTEXT MALLOC";
+ translen = 0;
+ }
+ }
+ if (translen)
+ translen--; /* TRANSLEN shall be the size without the nul. */
+ jnlib_free (buf);
+ }
+ else if (domain->mapped[idx] == 1)
+ {
+ /* The translated string is in the overflow_space. */
+ for (os=domain->overflow_space; os; os = os->next)
+ if (os->idx == idx)
+ break;
+ if (os)
+ {
+ trans = os->d;
+ translen = os->length;
+ }
+ else
+ {
+ trans = "ERROR in GETTEXT (overflow space)\n";
+ translen = 0;
+ }
+ }
+ else
+ {
+ trans = (domain->data_native
+ + SWAPIT(domain->must_swap, domain->trans_tab[idx].offset));
+ translen = domain->mapped[idx];
+ }
+
+ leave:
+ if (use_plural && translen)
+ return get_plural (trans, translen, nplural);
+ else
+ return trans;
+}
+
+
+static const char *
+do_gettext (const char *domainname,
+ const char *msgid, const char *msgid2, unsigned long nplural)
+{
+ struct domainlist_s *dl;
+ struct loaded_domain *domain;
+ int load_failed;
+ uint32_t top, bottom, nstr;
+ char *filename;
+
+ if (!domainname)
+ domainname = current_domainname? current_domainname : "";
+
+ /* FIXME: The whole locking stuff is a bit questionable because
+ gettext does not claim to be thread-safe. We need to investigate
+ this further. */
+
+ load_failed = 0;
+ domain = NULL;
+ filename = NULL;
+ EnterCriticalSection (&domainlist_access_cs);
+ {
+ for (dl = domainlist; dl; dl = dl->next)
+ if (!strcmp (dl->name, domainname))
+ {
+ load_failed = dl->load_failed;
+ domain = dl->domain;
+ break;
+ }
+ if (dl && !domain && !load_failed && dl->fname)
+ {
+ filename = jnlib_malloc (strlen (dl->fname) + 1);
+ if (filename)
+ strcpy (filename, dl->fname);
+ }
+ }
+ LeaveCriticalSection (&domainlist_access_cs);
+ if (!dl)
+ goto not_found; /* DOMAINNAME not bound. */
+ if (filename)
+ {
+ /* No attempt so far to load the MO file. Try now. */
+ int updated = 0;
+
+ domain = load_domain (filename);
+ jnlib_free (filename);
+ filename = NULL;
+ EnterCriticalSection (&domainlist_access_cs);
+ {
+ for (dl = domainlist; dl; dl = dl->next)
+ if (!strcmp (dl->name, domainname))
+ {
+ if (domain)
+ dl->domain = domain;
+ else
+ dl->load_failed = 1;
+ updated = 1;
+ break;
+ }
+ }
+ LeaveCriticalSection (&domainlist_access_cs);
+ if (!updated)
+ {
+ /* Ooops - lost the domain. */
+ free_domain (domain);
+ domain = NULL;
+ }
+ }
+
+ if (!domain)
+ goto not_found; /* No MO file. */
+
+ /* First try to use the hash table. */
+ if (domain->hash_size > 2 && domain->hash_tab)
+ {
+ /* Use the hashing table. */
+ uint32_t len = strlen (msgid);
+ uint32_t hash_val = hash_string (msgid);
+ uint32_t idx = hash_val % domain->hash_size;
+ uint32_t incr = 1 + (hash_val % (domain->hash_size - 2));
+
+ while ( (nstr = SWAPIT (domain->must_swap, domain->hash_tab[idx])) )
+ {
+ nstr--;
+ if (nstr < domain->nstrings
+ && SWAPIT(domain->must_swap,
+ domain->orig_tab[nstr].length) >= len
+ && !strcmp (msgid, (domain->data
+ + SWAPIT(domain->must_swap,
+ domain->orig_tab[nstr].offset))))
+ {
+ return get_string (domain, nstr, !!msgid2, nplural);
+ }
+
+ if (idx >= domain->hash_size - incr)
+ idx -= domain->hash_size - incr;
+ else
+ idx += incr;
+ }
+ }
+
+ /* Now we try the default method: binary search in the sorted array
+ of messages. */
+ bottom = 0;
+ top = domain->nstrings;
+ while (bottom < top)
+ {
+ int cmp_val;
+
+ nstr = (bottom + top) / 2;
+ cmp_val = strcmp (msgid, (domain->data
+ + SWAPIT(domain->must_swap,
+ domain->orig_tab[nstr].offset)));
+ if (cmp_val < 0)
+ top = nstr;
+ else if (cmp_val > 0)
+ bottom = nstr + 1;
+ else
+ {
+ return get_string (domain, nstr, !!msgid2, nplural);
+ }
+ }
+
+ not_found:
+ /* We use the standard Germanic rule if plural has been requested. */
+ return msgid2? (nplural == 1? msgid : msgid2) : msgid;
+}
+
+
+const char *
+_gpg_w32_textdomain (const char *domainname)
+{
+ char *string;
+
+ if (!domainname)
+ {
+ if (!current_domainname)
+ gpg_err_set_errno (0);
+ }
+ else
+ {
+ string = malloc (strlen (domainname) + 1);
+ if (!string)
+ return NULL;
+ strcpy (string, domainname);
+ current_domainname = string;
+ }
+ return current_domainname;
+}
+
+
+/* A direct implementation of gettext instead of a macro calling
+ dngettext. This is so that the caller does not need to push dummy
+ values on the stack. The used domain is the first one registered
+ with bindtextdomain. */
+const char *
+_gpg_w32_gettext (const char *msgid)
+{
+ return do_gettext (NULL, msgid, NULL, 0);
+}
+
+
+/* A direct implementation of dgettext instead of a macro calling
+ dngettext. This is so that the caller does not need to push dummy
+ values on the stack. */
+const char *
+_gpg_w32_dgettext (const char *domainname, const char *msgid)
+{
+ return do_gettext (domainname, msgid, NULL, 0);
+}
+
+
+/* Our implementation of dngettext. This is the most genereic
+ function we have; a macro implements ngettext. */
+const char *
+_gpg_w32_dngettext (const char *domainname, const char *msgid1,
+ const char *msgid2, unsigned long int n)
+{
+ /* We use the simple Germanic plural rule. */
+ return do_gettext (domainname, msgid1, msgid2, n);
+}
+
+
+/* Return the locale name as used by gettext. The return value will
+ never be NULL. */
+const char *
+_gpg_w32_gettext_localename (void)
+{
+ const char *s;
+
+ s = my_nl_locale_name ("LC_MESSAGES");
+ return s? s:"";
+}
+
+
+/* With a VALUE of 1 switch the gettext functions into utf8 mode.
+ That is the strings are returned without translation to the native
+ charset. A VALUE of 0 switches back to translated strings. A VALUE
+ of -1 returns the current value. */
+int
+_gpg_w32_gettext_use_utf8 (int value)
+{
+ struct tls_space_s *tls = get_tls ();
+ int last = tls->gt_use_utf8;
+ if (value != -1)
+ tls->gt_use_utf8 = value;
+ return last;
+}
+
+
+#ifdef TEST
+int
+main (int argc, char **argv)
+{
+ const char atext1[] =
+ "Warning: You have entered an insecure passphrase.%%0A"
+ "A passphrase should be at least %u character long.";
+ const char atext2[] =
+ "Warning: You have entered an insecure passphrase.%%0A"
+ "A passphrase should be at least %u characters long.";
+
+ if (argc)
+ {
+ argc--;
+ argv++;
+ }
+
+ _gpg_err_w32_bindtextdomain ("gnupg2", "c:/programme/gnu/gnupg/share/locale");
+
+ printf ("locale is `%s'\n", _gpg_err_w32_gettext_localename ());
+ fputs ("text with N=1:\n", stdout);
+ fputs (_gpg_err_w32_ngettext (atext1, atext2, 1), stdout);
+ fputs ("\n\ntext with N=2:\n", stdout);
+ fputs (_gpg_err_w32_ngettext (atext1, atext2, 2), stdout);
+ fputs ("\nready\n", stdout);
+
+ return 0;
+}
+/*
+ * Local Variables:
+ * compile-command: "i586-mingw32msvc-gcc -DTEST -Wall -g w32-gettext.c"
+ * End:
+ */
+#endif /*TEST*/
diff --git a/src/w32-iconv.c b/src/w32-iconv.c
new file mode 100644
index 0000000..888b722
--- /dev/null
+++ b/src/w32-iconv.c
@@ -0,0 +1,1795 @@
+/* w32-iconv.c - iconv implementation for Windows.
+ * Copyright (C) 2016 g10 Code GmbH
+ *
+ * This file is part of libgpg-error.
+ *
+ * libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * libgpg-error is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ *
+ **************************************************************
+ * This code code is based on the file win_iconv.c as found
+ * at https://github.com/win-iconv/win-iconv with the commit id
+ * 8c23784e35327c9d85d22810b9e4a2cbd06ffe90, dated 2016-03-18.
+ * Yukihiro Nakadaira <[email protected]> is the
+ * original author. The file win_iconv.c carried this notice:
+ *--------------------------------------------------------------
+ * iconv implementation using Win32 API to convert.
+ *
+ * This file is placed in the public domain.
+ *---------------------------------------------------
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+#if !defined (_WIN32) && !defined (__CYGWIN32__)
+# error This module may only be build for Windows or Cygwin32
+#endif
+
+/* for WC_NO_BEST_FIT_CHARS */
+#ifndef WINVER
+# define WINVER 0x0500
+#endif
+
+#include <windows.h>
+#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "gpgrt-int.h"
+
+#undef USE_MLANG_DLL
+
+#define MB_CHAR_MAX 16
+
+#define UNICODE_MODE_BOM_DONE 1
+#define UNICODE_MODE_SWAPPED 2
+
+#define FLAG_USE_BOM 1
+#define FLAG_TRANSLIT 2 /* //TRANSLIT */
+#define FLAG_IGNORE 4 /* //IGNORE */
+
+typedef unsigned char uchar;
+typedef unsigned short ushort;
+typedef unsigned int uint;
+
+typedef struct compat_t compat_t;
+typedef struct csconv_t csconv_t;
+
+typedef int* (*f_errno)(void);
+typedef int (*f_mbtowc)(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize);
+typedef int (*f_wctomb)(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize);
+typedef int (*f_mblen)(csconv_t *cv, const uchar *buf, int bufsize);
+typedef int (*f_flush)(csconv_t *cv, uchar *buf, int bufsize);
+
+#define COMPAT_IN 1
+#define COMPAT_OUT 2
+
+/* unicode mapping for compatibility with other conversion table. */
+struct compat_t {
+ uint in;
+ uint out;
+ uint flag;
+};
+
+struct csconv_t {
+ int codepage;
+ int flags;
+ f_mbtowc mbtowc;
+ f_wctomb wctomb;
+ f_mblen mblen;
+ f_flush flush;
+ DWORD mode;
+ compat_t *compat;
+};
+
+struct _gpgrt_w32_iconv_s {
+ f_errno _errno;
+ csconv_t from;
+ csconv_t to;
+};
+
+#if USE_MLANG_DLL
+static int load_mlang(void);
+#endif /*USE_MLANG_DLL*/
+
+static int make_csconv(const char *name, csconv_t *cv);
+static int name_to_codepage(const char *name);
+static uint utf16_to_ucs4(const ushort *wbuf);
+static void ucs4_to_utf16(uint wc, ushort *wbuf, int *wbufsize);
+static int mbtowc_flags(int codepage);
+static int must_use_null_useddefaultchar(int codepage);
+static char *strrstr(const char *str, const char *token);
+static char *xstrndup(const char *s, size_t n);
+static int seterror(int err);
+
+static int sbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize);
+static int dbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize);
+static int mbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize);
+static int utf8_mblen(csconv_t *cv, const uchar *buf, int bufsize);
+#if USE_MLANG_DLL
+static int eucjp_mblen(csconv_t *cv, const uchar *buf, int bufsize);
+#endif /*USE_MLANG_DLL*/
+
+static int kernel_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize);
+static int kernel_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize);
+
+#if USE_MLANG_DLL
+static int mlang_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize);
+static int mlang_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize);
+#endif /*USE_MLANG_DLL*/
+
+static int utf16_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize);
+static int utf16_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize);
+static int utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize);
+static int utf32_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize);
+
+#if USE_MLANG_DLL
+static int iso2022jp_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize);
+static int iso2022jp_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize);
+static int iso2022jp_flush(csconv_t *cv, uchar *buf, int bufsize);
+#endif /*USE_MLANG_DLL*/
+
+static struct {
+ int codepage;
+ const char *name;
+} codepage_alias[] = {
+ {65001, "CP65001"},
+ {65001, "UTF8"},
+ {65001, "UTF-8"},
+
+ {1200, "CP1200"},
+ {1200, "UTF16LE"},
+ {1200, "UTF-16LE"},
+ {1200, "UCS2LE"},
+ {1200, "UCS-2LE"},
+ {1200, "UCS-2-INTERNAL"},
+
+ {1201, "CP1201"},
+ {1201, "UTF16BE"},
+ {1201, "UTF-16BE"},
+ {1201, "UCS2BE"},
+ {1201, "UCS-2BE"},
+ {1201, "unicodeFFFE"},
+
+ {12000, "CP12000"},
+ {12000, "UTF32LE"},
+ {12000, "UTF-32LE"},
+ {12000, "UCS4LE"},
+ {12000, "UCS-4LE"},
+
+ {12001, "CP12001"},
+ {12001, "UTF32BE"},
+ {12001, "UTF-32BE"},
+ {12001, "UCS4BE"},
+ {12001, "UCS-4BE"},
+
+ /*
+ * Default is big endian.
+ * See rfc2781 4.3 Interpreting text labelled as UTF-16.
+ */
+ {1201, "UTF16"},
+ {1201, "UTF-16"},
+ {1201, "UCS2"},
+ {1201, "UCS-2"},
+ {12001, "UTF32"},
+ {12001, "UTF-32"},
+ {12001, "UCS-4"},
+ {12001, "UCS4"},
+
+ /* copy from libiconv `iconv -l` */
+ /* !IsValidCodePage(367) */
+ {20127, "ANSI_X3.4-1968"},
+ {20127, "ANSI_X3.4-1986"},
+ {20127, "ASCII"},
+ {20127, "CP367"},
+ {20127, "IBM367"},
+ {20127, "ISO-IR-6"},
+ {20127, "ISO646-US"},
+ {20127, "ISO_646.IRV:1991"},
+ {20127, "US"},
+ {20127, "US-ASCII"},
+ {20127, "CSASCII"},
+
+ /* !IsValidCodePage(819) */
+ {1252, "CP819"},
+ {1252, "IBM819"},
+ {28591, "ISO-8859-1"},
+ {28591, "ISO-IR-100"},
+ {28591, "ISO8859-1"},
+ {28591, "ISO_8859-1"},
+ {28591, "ISO_8859-1:1987"},
+ {28591, "L1"},
+ {28591, "LATIN1"},
+ {28591, "CSISOLATIN1"},
+
+ {1250, "CP1250"},
+ {1250, "MS-EE"},
+ {1250, "WINDOWS-1250"},
+
+ {1251, "CP1251"},
+ {1251, "MS-CYRL"},
+ {1251, "WINDOWS-1251"},
+
+ {1252, "CP1252"},
+ {1252, "MS-ANSI"},
+ {1252, "WINDOWS-1252"},
+
+ {1253, "CP1253"},
+ {1253, "MS-GREEK"},
+ {1253, "WINDOWS-1253"},
+
+ {1254, "CP1254"},
+ {1254, "MS-TURK"},
+ {1254, "WINDOWS-1254"},
+
+ {1255, "CP1255"},
+ {1255, "MS-HEBR"},
+ {1255, "WINDOWS-1255"},
+
+ {1256, "CP1256"},
+ {1256, "MS-ARAB"},
+ {1256, "WINDOWS-1256"},
+
+ {1257, "CP1257"},
+ {1257, "WINBALTRIM"},
+ {1257, "WINDOWS-1257"},
+
+ {1258, "CP1258"},
+ {1258, "WINDOWS-1258"},
+
+ {850, "850"},
+ {850, "CP850"},
+ {850, "IBM850"},
+ {850, "CSPC850MULTILINGUAL"},
+
+ /* !IsValidCodePage(862) */
+ {862, "862"},
+ {862, "CP862"},
+ {862, "IBM862"},
+ {862, "CSPC862LATINHEBREW"},
+
+ {866, "866"},
+ {866, "CP866"},
+ {866, "IBM866"},
+ {866, "CSIBM866"},
+
+ /* !IsValidCodePage(154) */
+ {154, "CP154"},
+ {154, "CYRILLIC-ASIAN"},
+ {154, "PT154"},
+ {154, "PTCP154"},
+ {154, "CSPTCP154"},
+
+ /* !IsValidCodePage(1133) */
+ {1133, "CP1133"},
+ {1133, "IBM-CP1133"},
+
+ {874, "CP874"},
+ {874, "WINDOWS-874"},
+
+ /* !IsValidCodePage(51932) */
+ {51932, "CP51932"},
+ {51932, "MS51932"},
+ {51932, "WINDOWS-51932"},
+ {51932, "EUC-JP"},
+
+ {932, "CP932"},
+ {932, "MS932"},
+ {932, "SHIFFT_JIS"},
+ {932, "SHIFFT_JIS-MS"},
+ {932, "SJIS"},
+ {932, "SJIS-MS"},
+ {932, "SJIS-OPEN"},
+ {932, "SJIS-WIN"},
+ {932, "WINDOWS-31J"},
+ {932, "WINDOWS-932"},
+ {932, "CSWINDOWS31J"},
+
+ {50221, "CP50221"},
+ {50221, "ISO-2022-JP"},
+ {50221, "ISO-2022-JP-MS"},
+ {50221, "ISO2022-JP"},
+ {50221, "ISO2022-JP-MS"},
+ {50221, "MS50221"},
+ {50221, "WINDOWS-50221"},
+
+ {936, "CP936"},
+ {936, "GBK"},
+ {936, "MS936"},
+ {936, "WINDOWS-936"},
+
+ {950, "CP950"},
+ {950, "BIG5"},
+ {950, "BIG5HKSCS"},
+ {950, "BIG5-HKSCS"},
+
+ {949, "CP949"},
+ {949, "UHC"},
+ {949, "EUC-KR"},
+
+ {1361, "CP1361"},
+ {1361, "JOHAB"},
+
+ {437, "437"},
+ {437, "CP437"},
+ {437, "IBM437"},
+ {437, "CSPC8CODEPAGE437"},
+
+ {737, "CP737"},
+
+ {775, "CP775"},
+ {775, "IBM775"},
+ {775, "CSPC775BALTIC"},
+
+ {852, "852"},
+ {852, "CP852"},
+ {852, "IBM852"},
+ {852, "CSPCP852"},
+
+ /* !IsValidCodePage(853) */
+ {853, "CP853"},
+
+ {855, "855"},
+ {855, "CP855"},
+ {855, "IBM855"},
+ {855, "CSIBM855"},
+
+ {857, "857"},
+ {857, "CP857"},
+ {857, "IBM857"},
+ {857, "CSIBM857"},
+
+ /* !IsValidCodePage(858) */
+ {858, "CP858"},
+
+ {860, "860"},
+ {860, "CP860"},
+ {860, "IBM860"},
+ {860, "CSIBM860"},
+
+ {861, "861"},
+ {861, "CP-IS"},
+ {861, "CP861"},
+ {861, "IBM861"},
+ {861, "CSIBM861"},
+
+ {863, "863"},
+ {863, "CP863"},
+ {863, "IBM863"},
+ {863, "CSIBM863"},
+
+ {864, "CP864"},
+ {864, "IBM864"},
+ {864, "CSIBM864"},
+
+ {865, "865"},
+ {865, "CP865"},
+ {865, "IBM865"},
+ {865, "CSIBM865"},
+
+ {869, "869"},
+ {869, "CP-GR"},
+ {869, "CP869"},
+ {869, "IBM869"},
+ {869, "CSIBM869"},
+
+ /* !IsValidCodePage(1152) */
+ {1125, "CP1125"},
+
+ /*
+ * Code Page Identifiers
+ * https://msdn.microsoft.com/en-us/library/dd317756.aspx
+ */
+ {37, "IBM037"}, /* IBM EBCDIC US-Canada */
+ {437, "IBM437"}, /* OEM United States */
+ {500, "IBM500"}, /* IBM EBCDIC International */
+ {708, "ASMO-708"}, /* Arabic (ASMO 708) */
+ /* 709 Arabic (ASMO-449+, BCON V4) */
+ /* 710 Arabic - Transparent Arabic */
+ {720, "DOS-720"}, /* Arabic (Transparent ASMO); Arabic (DOS) */
+ {737, "ibm737"}, /* OEM Greek (formerly 437G); Greek (DOS) */
+ {775, "ibm775"}, /* OEM Baltic; Baltic (DOS) */
+ {850, "ibm850"}, /* OEM Multilingual Latin 1; Western European (DOS) */
+ {852, "ibm852"}, /* OEM Latin 2; Central European (DOS) */
+ {855, "IBM855"}, /* OEM Cyrillic (primarily Russian) */
+ {857, "ibm857"}, /* OEM Turkish; Turkish (DOS) */
+ {858, "IBM00858"}, /* OEM Multilingual Latin 1 + Euro symbol */
+ {860, "IBM860"}, /* OEM Portuguese; Portuguese (DOS) */
+ {861, "ibm861"}, /* OEM Icelandic; Icelandic (DOS) */
+ {862, "DOS-862"}, /* OEM Hebrew; Hebrew (DOS) */
+ {863, "IBM863"}, /* OEM French Canadian; French Canadian (DOS) */
+ {864, "IBM864"}, /* OEM Arabic; Arabic (864) */
+ {865, "IBM865"}, /* OEM Nordic; Nordic (DOS) */
+ {866, "cp866"}, /* OEM Russian; Cyrillic (DOS) */
+ {869, "ibm869"}, /* OEM Modern Greek; Greek, Modern (DOS) */
+ {870, "IBM870"}, /* IBM EBCDIC Multilingual/ROECE (Latin 2); IBM EBCDIC Multilingual Latin 2 */
+ {874, "windows-874"}, /* ANSI/OEM Thai (same as 28605, ISO 8859-15); Thai (Windows) */
+ {875, "cp875"}, /* IBM EBCDIC Greek Modern */
+ {932, "shift_jis"}, /* ANSI/OEM Japanese; Japanese (Shift-JIS) */
+ {932, "shift-jis"}, /* alternative name for it */
+ {936, "gb2312"}, /* ANSI/OEM Simplified Chinese (PRC, Singapore); Chinese Simplified (GB2312) */
+ {949, "ks_c_5601-1987"}, /* ANSI/OEM Korean (Unified Hangul Code) */
+ {950, "big5"}, /* ANSI/OEM Traditional Chinese (Taiwan; Hong Kong SAR, PRC); Chinese Traditional (Big5) */
+ {950, "big5hkscs"}, /* ANSI/OEM Traditional Chinese (Hong Kong SAR); Chinese Traditional (Big5-HKSCS) */
+ {950, "big5-hkscs"}, /* alternative name for it */
+ {1026, "IBM1026"}, /* IBM EBCDIC Turkish (Latin 5) */
+ {1047, "IBM01047"}, /* IBM EBCDIC Latin 1/Open System */
+ {1140, "IBM01140"}, /* IBM EBCDIC US-Canada (037 + Euro symbol); IBM EBCDIC (US-Canada-Euro) */
+ {1141, "IBM01141"}, /* IBM EBCDIC Germany (20273 + Euro symbol); IBM EBCDIC (Germany-Euro) */
+ {1142, "IBM01142"}, /* IBM EBCDIC Denmark-Norway (20277 + Euro symbol); IBM EBCDIC (Denmark-Norway-Euro) */
+ {1143, "IBM01143"}, /* IBM EBCDIC Finland-Sweden (20278 + Euro symbol); IBM EBCDIC (Finland-Sweden-Euro) */
+ {1144, "IBM01144"}, /* IBM EBCDIC Italy (20280 + Euro symbol); IBM EBCDIC (Italy-Euro) */
+ {1145, "IBM01145"}, /* IBM EBCDIC Latin America-Spain (20284 + Euro symbol); IBM EBCDIC (Spain-Euro) */
+ {1146, "IBM01146"}, /* IBM EBCDIC United Kingdom (20285 + Euro symbol); IBM EBCDIC (UK-Euro) */
+ {1147, "IBM01147"}, /* IBM EBCDIC France (20297 + Euro symbol); IBM EBCDIC (France-Euro) */
+ {1148, "IBM01148"}, /* IBM EBCDIC International (500 + Euro symbol); IBM EBCDIC (International-Euro) */
+ {1149, "IBM01149"}, /* IBM EBCDIC Icelandic (20871 + Euro symbol); IBM EBCDIC (Icelandic-Euro) */
+ {1250, "windows-1250"}, /* ANSI Central European; Central European (Windows) */
+ {1251, "windows-1251"}, /* ANSI Cyrillic; Cyrillic (Windows) */
+ {1252, "windows-1252"}, /* ANSI Latin 1; Western European (Windows) */
+ {1253, "windows-1253"}, /* ANSI Greek; Greek (Windows) */
+ {1254, "windows-1254"}, /* ANSI Turkish; Turkish (Windows) */
+ {1255, "windows-1255"}, /* ANSI Hebrew; Hebrew (Windows) */
+ {1256, "windows-1256"}, /* ANSI Arabic; Arabic (Windows) */
+ {1257, "windows-1257"}, /* ANSI Baltic; Baltic (Windows) */
+ {1258, "windows-1258"}, /* ANSI/OEM Vietnamese; Vietnamese (Windows) */
+ {1361, "Johab"}, /* Korean (Johab) */
+ {10000, "macintosh"}, /* MAC Roman; Western European (Mac) */
+ {10001, "x-mac-japanese"}, /* Japanese (Mac) */
+ {10002, "x-mac-chinesetrad"}, /* MAC Traditional Chinese (Big5); Chinese Traditional (Mac) */
+ {10003, "x-mac-korean"}, /* Korean (Mac) */
+ {10004, "x-mac-arabic"}, /* Arabic (Mac) */
+ {10005, "x-mac-hebrew"}, /* Hebrew (Mac) */
+ {10006, "x-mac-greek"}, /* Greek (Mac) */
+ {10007, "x-mac-cyrillic"}, /* Cyrillic (Mac) */
+ {10008, "x-mac-chinesesimp"}, /* MAC Simplified Chinese (GB 2312); Chinese Simplified (Mac) */
+ {10010, "x-mac-romanian"}, /* Romanian (Mac) */
+ {10017, "x-mac-ukrainian"}, /* Ukrainian (Mac) */
+ {10021, "x-mac-thai"}, /* Thai (Mac) */
+ {10029, "x-mac-ce"}, /* MAC Latin 2; Central European (Mac) */
+ {10079, "x-mac-icelandic"}, /* Icelandic (Mac) */
+ {10081, "x-mac-turkish"}, /* Turkish (Mac) */
+ {10082, "x-mac-croatian"}, /* Croatian (Mac) */
+ {20000, "x-Chinese_CNS"}, /* CNS Taiwan; Chinese Traditional (CNS) */
+ {20001, "x-cp20001"}, /* TCA Taiwan */
+ {20002, "x_Chinese-Eten"}, /* Eten Taiwan; Chinese Traditional (Eten) */
+ {20003, "x-cp20003"}, /* IBM5550 Taiwan */
+ {20004, "x-cp20004"}, /* TeleText Taiwan */
+ {20005, "x-cp20005"}, /* Wang Taiwan */
+ {20105, "x-IA5"}, /* IA5 (IRV International Alphabet No. 5, 7-bit); Western European (IA5) */
+ {20106, "x-IA5-German"}, /* IA5 German (7-bit) */
+ {20107, "x-IA5-Swedish"}, /* IA5 Swedish (7-bit) */
+ {20108, "x-IA5-Norwegian"}, /* IA5 Norwegian (7-bit) */
+ {20127, "us-ascii"}, /* US-ASCII (7-bit) */
+ {20261, "x-cp20261"}, /* T.61 */
+ {20269, "x-cp20269"}, /* ISO 6937 Non-Spacing Accent */
+ {20273, "IBM273"}, /* IBM EBCDIC Germany */
+ {20277, "IBM277"}, /* IBM EBCDIC Denmark-Norway */
+ {20278, "IBM278"}, /* IBM EBCDIC Finland-Sweden */
+ {20280, "IBM280"}, /* IBM EBCDIC Italy */
+ {20284, "IBM284"}, /* IBM EBCDIC Latin America-Spain */
+ {20285, "IBM285"}, /* IBM EBCDIC United Kingdom */
+ {20290, "IBM290"}, /* IBM EBCDIC Japanese Katakana Extended */
+ {20297, "IBM297"}, /* IBM EBCDIC France */
+ {20420, "IBM420"}, /* IBM EBCDIC Arabic */
+ {20423, "IBM423"}, /* IBM EBCDIC Greek */
+ {20424, "IBM424"}, /* IBM EBCDIC Hebrew */
+ {20833, "x-EBCDIC-KoreanExtended"}, /* IBM EBCDIC Korean Extended */
+ {20838, "IBM-Thai"}, /* IBM EBCDIC Thai */
+ {20866, "koi8-r"}, /* Russian (KOI8-R); Cyrillic (KOI8-R) */
+ {20871, "IBM871"}, /* IBM EBCDIC Icelandic */
+ {20880, "IBM880"}, /* IBM EBCDIC Cyrillic Russian */
+ {20905, "IBM905"}, /* IBM EBCDIC Turkish */
+ {20924, "IBM00924"}, /* IBM EBCDIC Latin 1/Open System (1047 + Euro symbol) */
+ {20932, "EUC-JP"}, /* Japanese (JIS 0208-1990 and 0121-1990) */
+ {20936, "x-cp20936"}, /* Simplified Chinese (GB2312); Chinese Simplified (GB2312-80) */
+ {20949, "x-cp20949"}, /* Korean Wansung */
+ {21025, "cp1025"}, /* IBM EBCDIC Cyrillic Serbian-Bulgarian */
+ /* 21027 (deprecated) */
+ {21866, "koi8-u"}, /* Ukrainian (KOI8-U); Cyrillic (KOI8-U) */
+ {28591, "iso-8859-1"}, /* ISO 8859-1 Latin 1; Western European (ISO) */
+ {28591, "iso8859-1"}, /* ISO 8859-1 Latin 1; Western European (ISO) */
+ {28591, "iso_8859-1"},
+ {28591, "iso_8859_1"},
+ {28592, "iso-8859-2"}, /* ISO 8859-2 Central European; Central European (ISO) */
+ {28592, "iso8859-2"}, /* ISO 8859-2 Central European; Central European (ISO) */
+ {28592, "iso_8859-2"},
+ {28592, "iso_8859_2"},
+ {28593, "iso-8859-3"}, /* ISO 8859-3 Latin 3 */
+ {28593, "iso8859-3"}, /* ISO 8859-3 Latin 3 */
+ {28593, "iso_8859-3"},
+ {28593, "iso_8859_3"},
+ {28594, "iso-8859-4"}, /* ISO 8859-4 Baltic */
+ {28594, "iso8859-4"}, /* ISO 8859-4 Baltic */
+ {28594, "iso_8859-4"},
+ {28594, "iso_8859_4"},
+ {28595, "iso-8859-5"}, /* ISO 8859-5 Cyrillic */
+ {28595, "iso8859-5"}, /* ISO 8859-5 Cyrillic */
+ {28595, "iso_8859-5"},
+ {28595, "iso_8859_5"},
+ {28596, "iso-8859-6"}, /* ISO 8859-6 Arabic */
+ {28596, "iso8859-6"}, /* ISO 8859-6 Arabic */
+ {28596, "iso_8859-6"},
+ {28596, "iso_8859_6"},
+ {28597, "iso-8859-7"}, /* ISO 8859-7 Greek */
+ {28597, "iso8859-7"}, /* ISO 8859-7 Greek */
+ {28597, "iso_8859-7"},
+ {28597, "iso_8859_7"},
+ {28598, "iso-8859-8"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Visual) */
+ {28598, "iso8859-8"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Visual) */
+ {28598, "iso_8859-8"},
+ {28598, "iso_8859_8"},
+ {28599, "iso-8859-9"}, /* ISO 8859-9 Turkish */
+ {28599, "iso8859-9"}, /* ISO 8859-9 Turkish */
+ {28599, "iso_8859-9"},
+ {28599, "iso_8859_9"},
+ {28603, "iso-8859-13"}, /* ISO 8859-13 Estonian */
+ {28603, "iso8859-13"}, /* ISO 8859-13 Estonian */
+ {28603, "iso_8859-13"},
+ {28603, "iso_8859_13"},
+ {28605, "iso-8859-15"}, /* ISO 8859-15 Latin 9 */
+ {28605, "iso8859-15"}, /* ISO 8859-15 Latin 9 */
+ {28605, "iso_8859-15"},
+ {28605, "iso_8859_15"},
+ {29001, "x-Europa"}, /* Europa 3 */
+ {38598, "iso-8859-8-i"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Logical) */
+ {38598, "iso8859-8-i"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Logical) */
+ {38598, "iso_8859-8-i"},
+ {38598, "iso_8859_8-i"},
+ {50220, "iso-2022-jp"}, /* ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS) */
+ {50221, "csISO2022JP"}, /* ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow 1 byte Kana) */
+ {50222, "iso-2022-jp"}, /* ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte Kana - SO/SI) */
+ {50225, "iso-2022-kr"}, /* ISO 2022 Korean */
+ {50225, "iso2022-kr"}, /* ISO 2022 Korean */
+ {50227, "x-cp50227"}, /* ISO 2022 Simplified Chinese; Chinese Simplified (ISO 2022) */
+ /* 50229 ISO 2022 Traditional Chinese */
+ /* 50930 EBCDIC Japanese (Katakana) Extended */
+ /* 50931 EBCDIC US-Canada and Japanese */
+ /* 50933 EBCDIC Korean Extended and Korean */
+ /* 50935 EBCDIC Simplified Chinese Extended and Simplified Chinese */
+ /* 50936 EBCDIC Simplified Chinese */
+ /* 50937 EBCDIC US-Canada and Traditional Chinese */
+ /* 50939 EBCDIC Japanese (Latin) Extended and Japanese */
+ {51932, "euc-jp"}, /* EUC Japanese */
+ {51936, "EUC-CN"}, /* EUC Simplified Chinese; Chinese Simplified (EUC) */
+ {51949, "euc-kr"}, /* EUC Korean */
+ /* 51950 EUC Traditional Chinese */
+ {52936, "hz-gb-2312"}, /* HZ-GB2312 Simplified Chinese; Chinese Simplified (HZ) */
+ {54936, "GB18030"}, /* Windows XP and later: GB18030 Simplified Chinese (4 byte); Chinese Simplified (GB18030) */
+ {57002, "x-iscii-de"}, /* ISCII Devanagari */
+ {57003, "x-iscii-be"}, /* ISCII Bengali */
+ {57004, "x-iscii-ta"}, /* ISCII Tamil */
+ {57005, "x-iscii-te"}, /* ISCII Telugu */
+ {57006, "x-iscii-as"}, /* ISCII Assamese */
+ {57007, "x-iscii-or"}, /* ISCII Oriya */
+ {57008, "x-iscii-ka"}, /* ISCII Kannada */
+ {57009, "x-iscii-ma"}, /* ISCII Malayalam */
+ {57010, "x-iscii-gu"}, /* ISCII Gujarati */
+ {57011, "x-iscii-pa"}, /* ISCII Punjabi */
+
+ {0, NULL}
+};
+
+/*
+ * SJIS SHIFTJIS table CP932 table
+ * ---- --------------------------- --------------------------------
+ * 5C U+00A5 YEN SIGN U+005C REVERSE SOLIDUS
+ * 7E U+203E OVERLINE U+007E TILDE
+ * 815C U+2014 EM DASH U+2015 HORIZONTAL BAR
+ * 815F U+005C REVERSE SOLIDUS U+FF3C FULLWIDTH REVERSE SOLIDUS
+ * 8160 U+301C WAVE DASH U+FF5E FULLWIDTH TILDE
+ * 8161 U+2016 DOUBLE VERTICAL LINE U+2225 PARALLEL TO
+ * 817C U+2212 MINUS SIGN U+FF0D FULLWIDTH HYPHEN-MINUS
+ * 8191 U+00A2 CENT SIGN U+FFE0 FULLWIDTH CENT SIGN
+ * 8192 U+00A3 POUND SIGN U+FFE1 FULLWIDTH POUND SIGN
+ * 81CA U+00AC NOT SIGN U+FFE2 FULLWIDTH NOT SIGN
+ *
+ * EUC-JP and ISO-2022-JP should be compatible with CP932.
+ *
+ * Kernel and MLang have different Unicode mapping table. Make sure
+ * which API is used.
+ */
+static compat_t cp932_compat[] = {
+ {0x00A5, 0x005C, COMPAT_OUT},
+ {0x203E, 0x007E, COMPAT_OUT},
+ {0x2014, 0x2015, COMPAT_OUT},
+ {0x301C, 0xFF5E, COMPAT_OUT},
+ {0x2016, 0x2225, COMPAT_OUT},
+ {0x2212, 0xFF0D, COMPAT_OUT},
+ {0x00A2, 0xFFE0, COMPAT_OUT},
+ {0x00A3, 0xFFE1, COMPAT_OUT},
+ {0x00AC, 0xFFE2, COMPAT_OUT},
+ {0, 0, 0}
+};
+
+static compat_t cp20932_compat[] = {
+ {0x00A5, 0x005C, COMPAT_OUT},
+ {0x203E, 0x007E, COMPAT_OUT},
+ {0x2014, 0x2015, COMPAT_OUT},
+ {0xFF5E, 0x301C, COMPAT_OUT|COMPAT_IN},
+ {0x2225, 0x2016, COMPAT_OUT|COMPAT_IN},
+ {0xFF0D, 0x2212, COMPAT_OUT|COMPAT_IN},
+ {0xFFE0, 0x00A2, COMPAT_OUT|COMPAT_IN},
+ {0xFFE1, 0x00A3, COMPAT_OUT|COMPAT_IN},
+ {0xFFE2, 0x00AC, COMPAT_OUT|COMPAT_IN},
+ {0, 0, 0}
+};
+
+static compat_t *cp51932_compat = cp932_compat;
+
+/* cp20932_compat for kernel. cp932_compat for mlang. */
+static compat_t *cp5022x_compat = cp932_compat;
+
+#if USE_MLANG_DLL
+typedef HRESULT (WINAPI *CONVERTINETSTRING)(
+ LPDWORD lpdwMode,
+ DWORD dwSrcEncoding,
+ DWORD dwDstEncoding,
+ LPCSTR lpSrcStr,
+ LPINT lpnSrcSize,
+ LPBYTE lpDstStr,
+ LPINT lpnDstSize
+);
+typedef HRESULT (WINAPI *CONVERTINETMULTIBYTETOUNICODE)(
+ LPDWORD lpdwMode,
+ DWORD dwSrcEncoding,
+ LPCSTR lpSrcStr,
+ LPINT lpnMultiCharCount,
+ LPWSTR lpDstStr,
+ LPINT lpnWideCharCount
+);
+typedef HRESULT (WINAPI *CONVERTINETUNICODETOMULTIBYTE)(
+ LPDWORD lpdwMode,
+ DWORD dwEncoding,
+ LPCWSTR lpSrcStr,
+ LPINT lpnWideCharCount,
+ LPSTR lpDstStr,
+ LPINT lpnMultiCharCount
+);
+typedef HRESULT (WINAPI *ISCONVERTINETSTRINGAVAILABLE)(
+ DWORD dwSrcEncoding,
+ DWORD dwDstEncoding
+);
+typedef HRESULT (WINAPI *LCIDTORFC1766A)(
+ LCID Locale,
+ LPSTR pszRfc1766,
+ int nChar
+);
+typedef HRESULT (WINAPI *LCIDTORFC1766W)(
+ LCID Locale,
+ LPWSTR pszRfc1766,
+ int nChar
+);
+typedef HRESULT (WINAPI *RFC1766TOLCIDA)(
+ LCID *pLocale,
+ LPSTR pszRfc1766
+);
+typedef HRESULT (WINAPI *RFC1766TOLCIDW)(
+ LCID *pLocale,
+ LPWSTR pszRfc1766
+);
+static CONVERTINETSTRING ConvertINetString;
+static CONVERTINETMULTIBYTETOUNICODE ConvertINetMultiByteToUnicode;
+static CONVERTINETUNICODETOMULTIBYTE ConvertINetUnicodeToMultiByte;
+static ISCONVERTINETSTRINGAVAILABLE IsConvertINetStringAvailable;
+static LCIDTORFC1766A LcidToRfc1766A;
+static RFC1766TOLCIDA Rfc1766ToLcidA;
+#endif /*USE_MLANG_DLL*/
+
+#if USE_MLANG_DLL
+static int
+load_mlang(void)
+{
+ HMODULE h;
+ if (ConvertINetString != NULL)
+ return TRUE;
+ h = LoadLibrary(TEXT("mlang.dll"));
+ if (!h)
+ return FALSE;
+ ConvertINetString = (CONVERTINETSTRING)GetProcAddressA(h, "ConvertINetString");
+ ConvertINetMultiByteToUnicode = (CONVERTINETMULTIBYTETOUNICODE)GetProcAddressA(h, "ConvertINetMultiByteToUnicode");
+ ConvertINetUnicodeToMultiByte = (CONVERTINETUNICODETOMULTIBYTE)GetProcAddressA(h, "ConvertINetUnicodeToMultiByte");
+ IsConvertINetStringAvailable = (ISCONVERTINETSTRINGAVAILABLE)GetProcAddressA(h, "IsConvertINetStringAvailable");
+ LcidToRfc1766A = (LCIDTORFC1766A)GetProcAddressA(h, "LcidToRfc1766A");
+ Rfc1766ToLcidA = (RFC1766TOLCIDA)GetProcAddressA(h, "Rfc1766ToLcidA");
+ return TRUE;
+}
+#endif
+
+
+static int
+win_iconv_open(gpgrt_w32_iconv_t cd, const char *tocode, const char *fromcode)
+{
+ if (!make_csconv(fromcode, &cd->from) || !make_csconv(tocode, &cd->to))
+ return FALSE;
+ cd->_errno = _errno;
+ return TRUE;
+}
+
+static size_t
+win_iconv (gpgrt_w32_iconv_t cd,
+ const char **inbuf, size_t *inbytesleft,
+ char **outbuf, size_t *outbytesleft)
+{
+ ushort wbuf[MB_CHAR_MAX]; /* enough room for one character */
+ int insize;
+ int outsize;
+ int wsize;
+ DWORD frommode;
+ DWORD tomode;
+ uint wc;
+ compat_t *cp;
+ int i;
+
+ if (inbuf == NULL || *inbuf == NULL)
+ {
+ if (outbuf != NULL && *outbuf != NULL && cd->to.flush != NULL)
+ {
+ tomode = cd->to.mode;
+ outsize = cd->to.flush(&cd->to, (uchar *)*outbuf, *outbytesleft);
+ if (outsize == -1)
+ {
+ if ((cd->to.flags & FLAG_IGNORE) && errno != E2BIG)
+ {
+ outsize = 0;
+ }
+ else
+ {
+ cd->to.mode = tomode;
+ return (size_t)(-1);
+ }
+ }
+ *outbuf += outsize;
+ *outbytesleft -= outsize;
+ }
+ cd->from.mode = 0;
+ cd->to.mode = 0;
+ return 0;
+ }
+
+ while (*inbytesleft != 0)
+ {
+ frommode = cd->from.mode;
+ tomode = cd->to.mode;
+ wsize = MB_CHAR_MAX;
+
+ insize = cd->from.mbtowc(&cd->from, (const uchar *)*inbuf, *inbytesleft, wbuf, &wsize);
+ if (insize == -1)
+ {
+ if (cd->to.flags & FLAG_IGNORE)
+ {
+ cd->from.mode = frommode;
+ insize = 1;
+ wsize = 0;
+ }
+ else
+ {
+ cd->from.mode = frommode;
+ return (size_t)(-1);
+ }
+ }
+
+ if (wsize == 0)
+ {
+ *inbuf += insize;
+ *inbytesleft -= insize;
+ continue;
+ }
+
+ if (cd->from.compat != NULL)
+ {
+ wc = utf16_to_ucs4(wbuf);
+ cp = cd->from.compat;
+ for (i = 0; cp[i].in != 0; ++i)
+ {
+ if ((cp[i].flag & COMPAT_IN) && cp[i].out == wc)
+ {
+ ucs4_to_utf16(cp[i].in, wbuf, &wsize);
+ break;
+ }
+ }
+ }
+
+ if (cd->to.compat != NULL)
+ {
+ wc = utf16_to_ucs4(wbuf);
+ cp = cd->to.compat;
+ for (i = 0; cp[i].in != 0; ++i)
+ {
+ if ((cp[i].flag & COMPAT_OUT) && cp[i].in == wc)
+ {
+ ucs4_to_utf16(cp[i].out, wbuf, &wsize);
+ break;
+ }
+ }
+ }
+
+ outsize = cd->to.wctomb(&cd->to, wbuf, wsize, (uchar *)*outbuf, *outbytesleft);
+ if (outsize == -1)
+ {
+ if ((cd->to.flags & FLAG_IGNORE) && errno != E2BIG)
+ {
+ cd->to.mode = tomode;
+ outsize = 0;
+ }
+ else
+ {
+ cd->from.mode = frommode;
+ cd->to.mode = tomode;
+ return (size_t)(-1);
+ }
+ }
+
+ *inbuf += insize;
+ *outbuf += outsize;
+ *inbytesleft -= insize;
+ *outbytesleft -= outsize;
+ }
+
+ return 0;
+}
+
+static int
+make_csconv(const char *_name, csconv_t *cv)
+{
+ CPINFO cpinfo;
+ int use_compat = TRUE;
+ int flag = 0;
+ char *name;
+ char *p;
+
+ name = xstrndup(_name, strlen(_name));
+ if (name == NULL)
+ return FALSE;
+
+ /* check for option "enc_name//opt1//opt2" */
+ while ((p = strrstr(name, "//")) != NULL)
+ {
+ if (_stricmp(p + 2, "nocompat") == 0)
+ use_compat = FALSE;
+ else if (_stricmp(p + 2, "translit") == 0)
+ flag |= FLAG_TRANSLIT;
+ else if (_stricmp(p + 2, "ignore") == 0)
+ flag |= FLAG_IGNORE;
+ *p = 0;
+ }
+
+ cv->mode = 0;
+ cv->flags = flag;
+ cv->mblen = NULL;
+ cv->flush = NULL;
+ cv->compat = NULL;
+ cv->codepage = name_to_codepage(name);
+ if (cv->codepage == 1200 || cv->codepage == 1201)
+ {
+ cv->mbtowc = utf16_mbtowc;
+ cv->wctomb = utf16_wctomb;
+ if (_stricmp(name, "UTF-16") == 0 || _stricmp(name, "UTF16") == 0 ||
+ _stricmp(name, "UCS-2") == 0 || _stricmp(name, "UCS2") == 0 ||
+ _stricmp(name,"UCS-2-INTERNAL") == 0)
+ cv->flags |= FLAG_USE_BOM;
+ }
+ else if (cv->codepage == 12000 || cv->codepage == 12001)
+ {
+ cv->mbtowc = utf32_mbtowc;
+ cv->wctomb = utf32_wctomb;
+ if (_stricmp(name, "UTF-32") == 0 || _stricmp(name, "UTF32") == 0 ||
+ _stricmp(name, "UCS-4") == 0 || _stricmp(name, "UCS4") == 0)
+ cv->flags |= FLAG_USE_BOM;
+ }
+ else if (cv->codepage == 65001)
+ {
+ cv->mbtowc = kernel_mbtowc;
+ cv->wctomb = kernel_wctomb;
+ cv->mblen = utf8_mblen;
+ }
+#if USE_MLANG_DLL
+ else if ((cv->codepage == 50220 || cv->codepage == 50221 || cv->codepage == 50222) && load_mlang())
+ {
+ cv->mbtowc = iso2022jp_mbtowc;
+ cv->wctomb = iso2022jp_wctomb;
+ cv->flush = iso2022jp_flush;
+ }
+ else if (cv->codepage == 51932 && load_mlang())
+ {
+ cv->mbtowc = mlang_mbtowc;
+ cv->wctomb = mlang_wctomb;
+ cv->mblen = eucjp_mblen;
+ }
+#endif /*USE_MLANG_DLL*/
+ else if (IsValidCodePage(cv->codepage)
+ && GetCPInfo(cv->codepage, &cpinfo) != 0)
+ {
+ cv->mbtowc = kernel_mbtowc;
+ cv->wctomb = kernel_wctomb;
+ if (cpinfo.MaxCharSize == 1)
+ cv->mblen = sbcs_mblen;
+ else if (cpinfo.MaxCharSize == 2)
+ cv->mblen = dbcs_mblen;
+ else
+ cv->mblen = mbcs_mblen;
+ }
+ else
+ {
+ /* not supported */
+ free(name);
+ errno = EINVAL;
+ return FALSE;
+ }
+
+ if (use_compat)
+ {
+ switch (cv->codepage)
+ {
+ case 932: cv->compat = cp932_compat; break;
+ case 20932: cv->compat = cp20932_compat; break;
+ case 51932: cv->compat = cp51932_compat; break;
+ case 50220: case 50221: case 50222: cv->compat = cp5022x_compat; break;
+ }
+ }
+
+ free(name);
+
+ return TRUE;
+}
+
+static int
+name_to_codepage(const char *name)
+{
+ int i;
+
+ if (*name == '\0' ||
+ strcmp(name, "char") == 0)
+ return GetACP();
+ else if (strcmp(name, "wchar_t") == 0)
+ return 1200;
+ else if (_strnicmp(name, "cp", 2) == 0)
+ return atoi(name + 2); /* CP123 */
+ else if ('0' <= name[0] && name[0] <= '9')
+ return atoi(name); /* 123 */
+ else if (_strnicmp(name, "xx", 2) == 0)
+ return atoi(name + 2); /* XX123 for debug */
+
+ for (i = 0; codepage_alias[i].name != NULL; ++i)
+ if (_stricmp(name, codepage_alias[i].name) == 0)
+ return codepage_alias[i].codepage;
+ return -1;
+}
+
+/*
+ * https://tools.ietf.org/html/rfc2781
+ */
+static uint
+utf16_to_ucs4(const ushort *wbuf)
+{
+ uint wc = wbuf[0];
+ if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF)
+ wc = ((wbuf[0] & 0x3FF) << 10) + (wbuf[1] & 0x3FF) + 0x10000;
+ return wc;
+}
+
+static void
+ucs4_to_utf16(uint wc, ushort *wbuf, int *wbufsize)
+{
+ if (wc < 0x10000)
+ {
+ wbuf[0] = wc;
+ *wbufsize = 1;
+ }
+ else
+ {
+ wc -= 0x10000;
+ wbuf[0] = 0xD800 | ((wc >> 10) & 0x3FF);
+ wbuf[1] = 0xDC00 | (wc & 0x3FF);
+ *wbufsize = 2;
+ }
+}
+
+/*
+ * Check if codepage is one of those for which the dwFlags parameter
+ * to MultiByteToWideChar() must be zero. Return zero or
+ * MB_ERR_INVALID_CHARS. The docs in Platform SDK for Windows
+ * Server 2003 R2 claims that also codepage 65001 is one of these, but
+ * that doesn't seem to be the case. The MSDN docs for MSVS2008 leave
+ * out 65001 (UTF-8), and that indeed seems to be the case on XP, it
+ * works fine to pass MB_ERR_INVALID_CHARS in dwFlags when converting
+ * from UTF-8.
+ */
+static int
+mbtowc_flags(int codepage)
+{
+ return (codepage == 50220 || codepage == 50221 ||
+ codepage == 50222 || codepage == 50225 ||
+ codepage == 50227 || codepage == 50229 ||
+ codepage == 52936 || codepage == 54936 ||
+ (codepage >= 57002 && codepage <= 57011) ||
+ codepage == 65000 || codepage == 42) ? 0 : MB_ERR_INVALID_CHARS;
+}
+
+/*
+ * Check if codepage is one those for which the lpUsedDefaultChar
+ * parameter to WideCharToMultiByte() must be NULL. The docs in
+ * Platform SDK for Windows Server 2003 R2 claims that this is the
+ * list below, while the MSDN docs for MSVS2008 claim that it is only
+ * for 65000 (UTF-7) and 65001 (UTF-8). This time the earlier Platform
+ * SDK seems to be correct, at least for XP.
+ */
+static int
+must_use_null_useddefaultchar(int codepage)
+{
+ return (codepage == 65000 || codepage == 65001 ||
+ codepage == 50220 || codepage == 50221 ||
+ codepage == 50222 || codepage == 50225 ||
+ codepage == 50227 || codepage == 50229 ||
+ codepage == 52936 || codepage == 54936 ||
+ (codepage >= 57002 && codepage <= 57011) ||
+ codepage == 42);
+}
+
+static char *
+strrstr(const char *str, const char *token)
+{
+ int len = strlen(token);
+ const char *p = str + strlen(str);
+
+ while (str <= --p)
+ if (p[0] == token[0] && strncmp(p, token, len) == 0)
+ return (char *)p;
+ return NULL;
+}
+
+static char *
+xstrndup(const char *s, size_t n)
+{
+ char *p;
+
+ p = (char *)malloc(n + 1);
+ if (p == NULL)
+ return NULL;
+ memcpy(p, s, n);
+ p[n] = '\0';
+ return p;
+}
+
+static int
+seterror(int err)
+{
+ _gpg_err_set_errno (err);
+ return -1;
+}
+
+
+static int
+sbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize)
+{
+ (void)cv;
+ (void)buf;
+ (void)bufsize;
+ return 1;
+}
+
+static int
+dbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize)
+{
+ int len = IsDBCSLeadByteEx(cv->codepage, buf[0]) ? 2 : 1;
+ if (bufsize < len)
+ return seterror(EINVAL);
+ return len;
+}
+
+static int
+mbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize)
+{
+ int len = 0;
+
+ if (cv->codepage == 54936) {
+ if (buf[0] <= 0x7F) len = 1;
+ else if (buf[0] >= 0x81 && buf[0] <= 0xFE &&
+ bufsize >= 2 &&
+ ((buf[1] >= 0x40 && buf[1] <= 0x7E) ||
+ (buf[1] >= 0x80 && buf[1] <= 0xFE))) len = 2;
+ else if (buf[0] >= 0x81 && buf[0] <= 0xFE &&
+ bufsize >= 4 &&
+ buf[1] >= 0x30 && buf[1] <= 0x39) len = 4;
+ else
+ return seterror(EINVAL);
+ return len;
+ }
+ else
+ return seterror(EINVAL);
+}
+
+static int
+utf8_mblen(csconv_t *cv, const uchar *buf, int bufsize)
+{
+ int len = 0;
+
+ (void) cv;
+
+ if (buf[0] < 0x80) len = 1;
+ else if ((buf[0] & 0xE0) == 0xC0) len = 2;
+ else if ((buf[0] & 0xF0) == 0xE0) len = 3;
+ else if ((buf[0] & 0xF8) == 0xF0) len = 4;
+ else if ((buf[0] & 0xFC) == 0xF8) len = 5;
+ else if ((buf[0] & 0xFE) == 0xFC) len = 6;
+
+ if (len == 0)
+ return seterror(EILSEQ);
+ else if (bufsize < len)
+ return seterror(EINVAL);
+ return len;
+}
+
+#if USE_MLANG_DLL
+static int
+eucjp_mblen(csconv_t *cv, const uchar *buf, int bufsize)
+{
+ (void) cv;
+
+ if (buf[0] < 0x80) /* ASCII */
+ return 1;
+ else if (buf[0] == 0x8E) /* JIS X 0201 */
+ {
+ if (bufsize < 2)
+ return seterror(EINVAL);
+ else if (!(0xA1 <= buf[1] && buf[1] <= 0xDF))
+ return seterror(EILSEQ);
+ return 2;
+ }
+ else if (buf[0] == 0x8F) /* JIS X 0212 */
+ {
+ if (bufsize < 3)
+ return seterror(EINVAL);
+ else if (!(0xA1 <= buf[1] && buf[1] <= 0xFE)
+ || !(0xA1 <= buf[2] && buf[2] <= 0xFE))
+ return seterror(EILSEQ);
+ return 3;
+ }
+ else /* JIS X 0208 */
+ {
+ if (bufsize < 2)
+ return seterror(EINVAL);
+ else if (!(0xA1 <= buf[0] && buf[0] <= 0xFE)
+ || !(0xA1 <= buf[1] && buf[1] <= 0xFE))
+ return seterror(EILSEQ);
+ return 2;
+ }
+}
+#endif /*USE_MLANG_DLL*/
+
+static int
+kernel_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize)
+{
+ int len;
+
+ len = cv->mblen(cv, buf, bufsize);
+ if (len == -1)
+ return -1;
+ /* If converting from ASCII, reject 8bit
+ * chars. MultiByteToWideChar() doesn't. Note that for ASCII we
+ * know that the mblen function is sbcs_mblen() so len is 1.
+ */
+ if (cv->codepage == 20127 && buf[0] >= 0x80)
+ return seterror(EILSEQ);
+ *wbufsize = MultiByteToWideChar(cv->codepage, mbtowc_flags (cv->codepage),
+ (const char *)buf, len, (wchar_t *)wbuf, *wbufsize);
+ if (*wbufsize == 0)
+ return seterror(EILSEQ);
+ return len;
+}
+
+static int
+kernel_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize)
+{
+ BOOL usedDefaultChar = 0;
+ BOOL *p = NULL;
+ int flags = 0;
+ int len;
+
+ if (bufsize == 0)
+ return seterror(E2BIG);
+ if (!must_use_null_useddefaultchar(cv->codepage))
+ {
+ p = &usedDefaultChar;
+#ifdef WC_NO_BEST_FIT_CHARS
+ if (!(cv->flags & FLAG_TRANSLIT))
+ flags |= WC_NO_BEST_FIT_CHARS;
+#endif
+ }
+ len = WideCharToMultiByte(cv->codepage, flags,
+ (const wchar_t *)wbuf, wbufsize, (char *)buf, bufsize, NULL, p);
+ if (len == 0)
+ {
+ if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
+ return seterror(E2BIG);
+ return seterror(EILSEQ);
+ }
+ else if (usedDefaultChar && !(cv->flags & FLAG_TRANSLIT))
+ return seterror(EILSEQ);
+ else if (cv->mblen(cv, buf, len) != len) /* validate result */
+ return seterror(EILSEQ);
+ return len;
+}
+
+/*
+ * It seems that the mode (cv->mode) is fixnum.
+ * For example, when converting iso-2022-jp(cp50221) to unicode:
+ * in ascii sequence: mode=0xC42C0000
+ * in jisx0208 sequence: mode=0xC42C0001
+ * "C42C" is same for each convert session.
+ * It should be: ((codepage-1)<<16)|state
+ */
+#if USE_MLANG_DLL
+static int
+mlang_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize)
+{
+ int len;
+ int insize;
+ HRESULT hr;
+
+ len = cv->mblen(cv, buf, bufsize);
+ if (len == -1)
+ return -1;
+ insize = len;
+ hr = ConvertINetMultiByteToUnicode(&cv->mode, cv->codepage,
+ (const char *)buf, &insize, (wchar_t *)wbuf, wbufsize);
+ if (hr != S_OK || insize != len)
+ return seterror(EILSEQ);
+ return len;
+}
+
+static int
+mlang_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize)
+{
+ char tmpbuf[MB_CHAR_MAX]; /* enough room for one character */
+ int tmpsize = MB_CHAR_MAX;
+ int insize = wbufsize;
+ HRESULT hr;
+
+ hr = ConvertINetUnicodeToMultiByte(&cv->mode, cv->codepage,
+ (const wchar_t *)wbuf, &wbufsize, tmpbuf, &tmpsize);
+ if (hr != S_OK || insize != wbufsize)
+ return seterror(EILSEQ);
+ else if (bufsize < tmpsize)
+ return seterror(E2BIG);
+ else if (cv->mblen(cv, (uchar *)tmpbuf, tmpsize) != tmpsize)
+ return seterror(EILSEQ);
+ memcpy(buf, tmpbuf, tmpsize);
+ return tmpsize;
+}
+#endif /*USE_MLANG_DLL*/
+
+static int
+utf16_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize)
+{
+ int codepage = cv->codepage;
+
+ /* swap endian: 1200 <-> 1201 */
+ if (cv->mode & UNICODE_MODE_SWAPPED)
+ codepage ^= 1;
+
+ if (bufsize < 2)
+ return seterror(EINVAL);
+ if (codepage == 1200) /* little endian */
+ wbuf[0] = (buf[1] << 8) | buf[0];
+ else if (codepage == 1201) /* big endian */
+ wbuf[0] = (buf[0] << 8) | buf[1];
+
+ if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE))
+ {
+ cv->mode |= UNICODE_MODE_BOM_DONE;
+ if (wbuf[0] == 0xFFFE)
+ {
+ cv->mode |= UNICODE_MODE_SWAPPED;
+ *wbufsize = 0;
+ return 2;
+ }
+ else if (wbuf[0] == 0xFEFF)
+ {
+ *wbufsize = 0;
+ return 2;
+ }
+ }
+
+ if (0xDC00 <= wbuf[0] && wbuf[0] <= 0xDFFF)
+ return seterror(EILSEQ);
+ if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF)
+ {
+ if (bufsize < 4)
+ return seterror(EINVAL);
+ if (codepage == 1200) /* little endian */
+ wbuf[1] = (buf[3] << 8) | buf[2];
+ else if (codepage == 1201) /* big endian */
+ wbuf[1] = (buf[2] << 8) | buf[3];
+ if (!(0xDC00 <= wbuf[1] && wbuf[1] <= 0xDFFF))
+ return seterror(EILSEQ);
+ *wbufsize = 2;
+ return 4;
+ }
+ *wbufsize = 1;
+ return 2;
+}
+
+static int
+utf16_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize)
+{
+ if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE))
+ {
+ int r;
+
+ cv->mode |= UNICODE_MODE_BOM_DONE;
+ if (bufsize < 2)
+ return seterror(E2BIG);
+ if (cv->codepage == 1200) /* little endian */
+ memcpy(buf, "\xFF\xFE", 2);
+ else if (cv->codepage == 1201) /* big endian */
+ memcpy(buf, "\xFE\xFF", 2);
+
+ r = utf16_wctomb(cv, wbuf, wbufsize, buf + 2, bufsize - 2);
+ if (r == -1)
+ return -1;
+ return r + 2;
+ }
+
+ if (bufsize < 2)
+ return seterror(E2BIG);
+ if (cv->codepage == 1200) /* little endian */
+ {
+ buf[0] = (wbuf[0] & 0x00FF);
+ buf[1] = (wbuf[0] & 0xFF00) >> 8;
+ }
+ else if (cv->codepage == 1201) /* big endian */
+ {
+ buf[0] = (wbuf[0] & 0xFF00) >> 8;
+ buf[1] = (wbuf[0] & 0x00FF);
+ }
+ if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF)
+ {
+ if (bufsize < 4)
+ return seterror(E2BIG);
+ if (cv->codepage == 1200) /* little endian */
+ {
+ buf[2] = (wbuf[1] & 0x00FF);
+ buf[3] = (wbuf[1] & 0xFF00) >> 8;
+ }
+ else if (cv->codepage == 1201) /* big endian */
+ {
+ buf[2] = (wbuf[1] & 0xFF00) >> 8;
+ buf[3] = (wbuf[1] & 0x00FF);
+ }
+ return 4;
+ }
+ return 2;
+}
+
+static int
+utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize)
+{
+ int codepage = cv->codepage;
+ uint wc = 0xD800;
+
+ /* swap endian: 12000 <-> 12001 */
+ if (cv->mode & UNICODE_MODE_SWAPPED)
+ codepage ^= 1;
+
+ if (bufsize < 4)
+ return seterror(EINVAL);
+ if (codepage == 12000) /* little endian */
+ wc = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0];
+ else if (codepage == 12001) /* big endian */
+ wc = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3];
+
+ if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE))
+ {
+ cv->mode |= UNICODE_MODE_BOM_DONE;
+ if (wc == 0xFFFE0000)
+ {
+ cv->mode |= UNICODE_MODE_SWAPPED;
+ *wbufsize = 0;
+ return 4;
+ }
+ else if (wc == 0x0000FEFF)
+ {
+ *wbufsize = 0;
+ return 4;
+ }
+ }
+
+ if ((0xD800 <= wc && wc <= 0xDFFF) || 0x10FFFF < wc)
+ return seterror(EILSEQ);
+ ucs4_to_utf16(wc, wbuf, wbufsize);
+ return 4;
+}
+
+static int
+utf32_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize)
+{
+ uint wc;
+
+ if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE))
+ {
+ int r;
+
+ cv->mode |= UNICODE_MODE_BOM_DONE;
+ if (bufsize < 4)
+ return seterror(E2BIG);
+ if (cv->codepage == 12000) /* little endian */
+ memcpy(buf, "\xFF\xFE\x00\x00", 4);
+ else if (cv->codepage == 12001) /* big endian */
+ memcpy(buf, "\x00\x00\xFE\xFF", 4);
+
+ r = utf32_wctomb(cv, wbuf, wbufsize, buf + 4, bufsize - 4);
+ if (r == -1)
+ return -1;
+ return r + 4;
+ }
+
+ if (bufsize < 4)
+ return seterror(E2BIG);
+ wc = utf16_to_ucs4(wbuf);
+ if (cv->codepage == 12000) /* little endian */
+ {
+ buf[0] = wc & 0x000000FF;
+ buf[1] = (wc & 0x0000FF00) >> 8;
+ buf[2] = (wc & 0x00FF0000) >> 16;
+ buf[3] = (wc & 0xFF000000) >> 24;
+ }
+ else if (cv->codepage == 12001) /* big endian */
+ {
+ buf[0] = (wc & 0xFF000000) >> 24;
+ buf[1] = (wc & 0x00FF0000) >> 16;
+ buf[2] = (wc & 0x0000FF00) >> 8;
+ buf[3] = wc & 0x000000FF;
+ }
+ return 4;
+}
+
+/*
+ * 50220: ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS)
+ * 50221: ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow
+ * 1 byte Kana)
+ * 50222: ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte
+ * Kana - SO/SI)
+ *
+ * MultiByteToWideChar() and WideCharToMultiByte() behave differently
+ * depending on Windows version. On XP, WideCharToMultiByte() doesn't
+ * terminate result sequence with ascii escape. But Vista does.
+ * Use MLang instead.
+ */
+
+#define ISO2022_MODE(cs, shift) (((cs) << 8) | (shift))
+#define ISO2022_MODE_CS(mode) (((mode) >> 8) & 0xFF)
+#define ISO2022_MODE_SHIFT(mode) ((mode) & 0xFF)
+
+#define ISO2022_SI 0
+#define ISO2022_SO 1
+
+#if USE_MLANG_DLL
+/* shift in */
+static const char iso2022_SI_seq[] = "\x0F";
+/* shift out */
+static const char iso2022_SO_seq[] = "\x0E";
+
+typedef struct iso2022_esc_t iso2022_esc_t;
+struct iso2022_esc_t {
+ const char *esc;
+ int esc_len;
+ int len;
+ int cs;
+};
+#endif
+
+#define ISO2022JP_CS_ASCII 0
+#define ISO2022JP_CS_JISX0201_ROMAN 1
+#define ISO2022JP_CS_JISX0201_KANA 2
+#define ISO2022JP_CS_JISX0208_1978 3
+#define ISO2022JP_CS_JISX0208_1983 4
+#define ISO2022JP_CS_JISX0212 5
+
+#if USE_MLANG_DLL
+static iso2022_esc_t iso2022jp_esc[] = {
+ {"\x1B\x28\x42", 3, 1, ISO2022JP_CS_ASCII},
+ {"\x1B\x28\x4A", 3, 1, ISO2022JP_CS_JISX0201_ROMAN},
+ {"\x1B\x28\x49", 3, 1, ISO2022JP_CS_JISX0201_KANA},
+ {"\x1B\x24\x40", 3, 2, ISO2022JP_CS_JISX0208_1983}, /* unify 1978 with 1983 */
+ {"\x1B\x24\x42", 3, 2, ISO2022JP_CS_JISX0208_1983},
+ {"\x1B\x24\x28\x44", 4, 2, ISO2022JP_CS_JISX0212},
+ {NULL, 0, 0, 0}
+};
+#endif /*USE_MLANG_DLL*/
+
+#if USE_MLANG_DLL
+static int
+iso2022jp_mbtowc(csconv_t *cv, const uchar *buf, int bufsize,
+ ushort *wbuf, int *wbufsize)
+{
+ iso2022_esc_t *iesc = iso2022jp_esc;
+ char tmp[MB_CHAR_MAX];
+ int insize;
+ HRESULT hr;
+ DWORD dummy = 0;
+ int len;
+ int esc_len;
+ int cs;
+ int shift;
+ int i;
+
+ if (buf[0] == 0x1B)
+ {
+ for (i = 0; iesc[i].esc != NULL; ++i)
+ {
+ esc_len = iesc[i].esc_len;
+ if (bufsize < esc_len)
+ {
+ if (strncmp((char *)buf, iesc[i].esc, bufsize) == 0)
+ return seterror(EINVAL);
+ }
+ else
+ {
+ if (strncmp((char *)buf, iesc[i].esc, esc_len) == 0)
+ {
+ cv->mode = ISO2022_MODE(iesc[i].cs, ISO2022_SI);
+ *wbufsize = 0;
+ return esc_len;
+ }
+ }
+ }
+ /* not supported escape sequence */
+ return seterror(EILSEQ);
+ }
+ else if (buf[0] == iso2022_SO_seq[0])
+ {
+ cv->mode = ISO2022_MODE(ISO2022_MODE_CS(cv->mode), ISO2022_SO);
+ *wbufsize = 0;
+ return 1;
+ }
+ else if (buf[0] == iso2022_SI_seq[0])
+ {
+ cv->mode = ISO2022_MODE(ISO2022_MODE_CS(cv->mode), ISO2022_SI);
+ *wbufsize = 0;
+ return 1;
+ }
+
+ cs = ISO2022_MODE_CS(cv->mode);
+ shift = ISO2022_MODE_SHIFT(cv->mode);
+
+ /* reset the mode for informal sequence */
+ if (buf[0] < 0x20)
+ {
+ cs = ISO2022JP_CS_ASCII;
+ shift = ISO2022_SI;
+ }
+
+ len = iesc[cs].len;
+ if (bufsize < len)
+ return seterror(EINVAL);
+ for (i = 0; i < len; ++i)
+ if (!(buf[i] < 0x80))
+ return seterror(EILSEQ);
+ esc_len = iesc[cs].esc_len;
+ memcpy(tmp, iesc[cs].esc, esc_len);
+ if (shift == ISO2022_SO)
+ {
+ memcpy(tmp + esc_len, iso2022_SO_seq, 1);
+ esc_len += 1;
+ }
+ memcpy(tmp + esc_len, buf, len);
+
+ if ((cv->codepage == 50220 || cv->codepage == 50221
+ || cv->codepage == 50222) && shift == ISO2022_SO)
+ {
+ /* XXX: shift-out cannot be used for mbtowc (both kernel and
+ * mlang) */
+ esc_len = iesc[ISO2022JP_CS_JISX0201_KANA].esc_len;
+ memcpy(tmp, iesc[ISO2022JP_CS_JISX0201_KANA].esc, esc_len);
+ memcpy(tmp + esc_len, buf, len);
+ }
+
+ insize = len + esc_len;
+ hr = ConvertINetMultiByteToUnicode(&dummy, cv->codepage,
+ (const char *)tmp, &insize, (wchar_t *)wbuf, wbufsize);
+ if (hr != S_OK || insize != len + esc_len)
+ return seterror(EILSEQ);
+
+ /* Check for conversion error. Assuming defaultChar is 0x3F. */
+ /* ascii should be converted from ascii */
+ if (wbuf[0] == buf[0]
+ && cv->mode != ISO2022_MODE(ISO2022JP_CS_ASCII, ISO2022_SI))
+ return seterror(EILSEQ);
+
+ /* reset the mode for informal sequence */
+ if (cv->mode != ISO2022_MODE(cs, shift))
+ cv->mode = ISO2022_MODE(cs, shift);
+
+ return len;
+}
+#endif /*USE_MLANG_DLL*/
+
+
+#if USE_MLANG_DLL
+static int
+iso2022jp_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize)
+{
+ iso2022_esc_t *iesc = iso2022jp_esc;
+ char tmp[MB_CHAR_MAX];
+ int tmpsize = MB_CHAR_MAX;
+ int insize = wbufsize;
+ HRESULT hr;
+ DWORD dummy = 0;
+ int len;
+ int esc_len;
+ int cs;
+ int shift;
+ int i;
+
+ /*
+ * MultiByte = [escape sequence] + character + [escape sequence]
+ *
+ * Whether trailing escape sequence is added depends on which API is
+ * used (kernel or MLang, and its version).
+ */
+ hr = ConvertINetUnicodeToMultiByte(&dummy, cv->codepage,
+ (const wchar_t *)wbuf, &wbufsize, tmp, &tmpsize);
+ if (hr != S_OK || insize != wbufsize)
+ return seterror(EILSEQ);
+ else if (bufsize < tmpsize)
+ return seterror(E2BIG);
+
+ if (tmpsize == 1)
+ {
+ cs = ISO2022JP_CS_ASCII;
+ esc_len = 0;
+ }
+ else
+ {
+ for (i = 1; iesc[i].esc != NULL; ++i)
+ {
+ esc_len = iesc[i].esc_len;
+ if (strncmp(tmp, iesc[i].esc, esc_len) == 0)
+ {
+ cs = iesc[i].cs;
+ break;
+ }
+ }
+ if (iesc[i].esc == NULL)
+ /* not supported escape sequence */
+ return seterror(EILSEQ);
+ }
+
+ shift = ISO2022_SI;
+ if (tmp[esc_len] == iso2022_SO_seq[0])
+ {
+ shift = ISO2022_SO;
+ esc_len += 1;
+ }
+
+ len = iesc[cs].len;
+
+ /* Check for converting error. Assuming defaultChar is 0x3F. */
+ /* ascii should be converted from ascii */
+ if (cs == ISO2022JP_CS_ASCII && !(wbuf[0] < 0x80))
+ return seterror(EILSEQ);
+ else if (tmpsize < esc_len + len)
+ return seterror(EILSEQ);
+
+ if (cv->mode == ISO2022_MODE(cs, shift))
+ {
+ /* remove escape sequence */
+ if (esc_len != 0)
+ memmove(tmp, tmp + esc_len, len);
+ esc_len = 0;
+ }
+ else
+ {
+ if (cs == ISO2022JP_CS_ASCII)
+ {
+ esc_len = iesc[ISO2022JP_CS_ASCII].esc_len;
+ memmove(tmp + esc_len, tmp, len);
+ memcpy(tmp, iesc[ISO2022JP_CS_ASCII].esc, esc_len);
+ }
+ if (ISO2022_MODE_SHIFT(cv->mode) == ISO2022_SO)
+ {
+ /* shift-in before changing to other mode */
+ memmove(tmp + 1, tmp, len + esc_len);
+ memcpy(tmp, iso2022_SI_seq, 1);
+ esc_len += 1;
+ }
+ }
+
+ if (bufsize < len + esc_len)
+ return seterror(E2BIG);
+ memcpy(buf, tmp, len + esc_len);
+ cv->mode = ISO2022_MODE(cs, shift);
+ return len + esc_len;
+}
+#endif /*USE_MLANG_DLL*/
+
+#if USE_MLANG_DLL
+static int
+iso2022jp_flush(csconv_t *cv, uchar *buf, int bufsize)
+{
+ iso2022_esc_t *iesc = iso2022jp_esc;
+ int esc_len;
+
+ if (cv->mode != ISO2022_MODE(ISO2022JP_CS_ASCII, ISO2022_SI))
+ {
+ esc_len = 0;
+ if (ISO2022_MODE_SHIFT(cv->mode) != ISO2022_SI)
+ esc_len += 1;
+ if (ISO2022_MODE_CS(cv->mode) != ISO2022JP_CS_ASCII)
+ esc_len += iesc[ISO2022JP_CS_ASCII].esc_len;
+ if (bufsize < esc_len)
+ return seterror(E2BIG);
+
+ esc_len = 0;
+ if (ISO2022_MODE_SHIFT(cv->mode) != ISO2022_SI)
+ {
+ memcpy(buf, iso2022_SI_seq, 1);
+ esc_len += 1;
+ }
+ if (ISO2022_MODE_CS(cv->mode) != ISO2022JP_CS_ASCII)
+ {
+ memcpy(buf + esc_len, iesc[ISO2022JP_CS_ASCII].esc,
+ iesc[ISO2022JP_CS_ASCII].esc_len);
+ esc_len += iesc[ISO2022JP_CS_ASCII].esc_len;
+ }
+ return esc_len;
+ }
+ return 0;
+}
+#endif /*USE_MLANG_DLL*/
+
+
+gpgrt_w32_iconv_t
+gpgrt_w32_iconv_open (const char *tocode, const char *fromcode)
+{
+ gpgrt_w32_iconv_t cd;
+
+ cd = calloc(1, sizeof *cd);
+ if (!cd)
+ return (gpgrt_w32_iconv_t)(-1);
+
+ /* reset the errno to prevent reporting wrong error code.
+ * 0 for unsorted error. */
+ _gpg_err_set_errno (0);
+ if (win_iconv_open(cd, tocode, fromcode))
+ return cd;
+
+ free(cd);
+
+ return (gpgrt_w32_iconv_t)(-1);
+}
+
+int
+gpgrt_w32_iconv_close (gpgrt_w32_iconv_t cd)
+{
+ if (cd)
+ {
+ free (cd);
+ }
+
+ return 0;
+}
+
+size_t
+gpgrt_w32_iconv (gpgrt_w32_iconv_t cd,
+ const char **inbuf, size_t *inbytesleft,
+ char **outbuf, size_t *outbytesleft)
+{
+ size_t r;
+
+ r = win_iconv (cd, inbuf, inbytesleft, outbuf, outbytesleft);
+ _gpg_err_set_errno (*(cd->_errno()));
+ return r;
+}
diff --git a/src/w32-lock-obj.h b/src/w32-lock-obj.h
new file mode 100644
index 0000000..8ed3084
--- /dev/null
+++ b/src/w32-lock-obj.h
@@ -0,0 +1,38 @@
+/* w32-lock-obj.h - Declaration of the Windows lock object
+ Copyright (C) 2014 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef W32_LOCK_OBJ_H
+#define W32_LOCK_OBJ_H
+
+#define LOCK_ABI_VERSION 1
+
+/* The real definition of our lock object. The public definition is
+ named gpgrt_lock_t and hides this internal structure. */
+#pragma pack(push, 8)
+typedef struct
+{
+ long vers;
+ volatile long initdone;
+ volatile long started;
+ CRITICAL_SECTION csec;
+} _gpgrt_lock_t;
+#pragma pack(pop)
+
+
+#endif /*W32_LOCK_OBJ_H*/
diff --git a/src/w32-lock.c b/src/w32-lock.c
new file mode 100644
index 0000000..51b13a1
--- /dev/null
+++ b/src/w32-lock.c
@@ -0,0 +1,182 @@
+/* w32-lock.c - GPGRT lock functions for Windows
+ Copyright (C) 2014 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifndef HAVE_W32_SYSTEM
+# error This module may only be build for Windows.
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <gpg-error.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include "lock.h"
+#include "w32-lock-obj.h"
+
+
+
+/*
+ * Functions called before and after blocking syscalls.
+ * gpgrt_set_syscall_clamp is used to set them.
+ */
+static void (*pre_lock_func)(void);
+static void (*post_lock_func)(void);
+
+
+/* Helper to set the clamp functions. This is called as a helper from
+ * _gpgrt_set_syscall_clamp to keep the function pointers local. */
+void
+_gpgrt_lock_set_lock_clamp (void (*pre)(void), void (*post)(void))
+{
+ pre_lock_func = pre;
+ post_lock_func = post;
+}
+
+
+
+static _gpgrt_lock_t *
+get_lock_object (gpgrt_lock_t *lockhd)
+{
+ _gpgrt_lock_t *lock = (_gpgrt_lock_t*)lockhd;
+
+ if (lock->vers != LOCK_ABI_VERSION)
+ abort ();
+
+ return lock;
+}
+
+
+gpg_err_code_t
+_gpgrt_lock_init (gpgrt_lock_t *lockhd)
+{
+ _gpgrt_lock_t *lock = (_gpgrt_lock_t*)lockhd;
+
+ /* If VERS is zero we assume that no static initialization has been
+ done, so we setup our ABI version right here. The caller might
+ have called us to test whether lock support is at all available. */
+ if (!lock->vers)
+ {
+ if (sizeof (gpgrt_lock_t) < sizeof (_gpgrt_lock_t))
+ abort ();
+ lock->vers = LOCK_ABI_VERSION;
+ }
+ else /* Run the usual check. */
+ {
+ lock = get_lock_object (lockhd);
+ if (sizeof (gpgrt_lock_t) < sizeof (_gpgrt_lock_t))
+ abort ();
+ }
+
+ InitializeCriticalSection (&lock->csec);
+ lock->initdone = 1;
+ return 0;
+}
+
+
+gpg_err_code_t
+_gpgrt_lock_lock (gpgrt_lock_t *lockhd)
+{
+ _gpgrt_lock_t *lock = get_lock_object (lockhd);
+
+ if (!lock->initdone)
+ {
+ if (!InterlockedIncrement (&lock->started))
+ {
+ /* The new value of started is 0. Because the initial value
+ if the variable was -1 we known that this thread is the
+ first who needs this lock. Thus we initialize now. All
+ other threads won't get 0 back from InterlockedIncrement
+ and thus fall into the wait loop below. We ignore that
+ STARTED may in theory overflow if this thread starves for
+ too long. */
+ gpgrt_lock_init (lockhd);
+ }
+ else
+ {
+ while (!lock->initdone)
+ Sleep (0);
+ }
+ }
+
+ if (pre_lock_func)
+ pre_lock_func ();
+ EnterCriticalSection (&lock->csec);
+ if (post_lock_func)
+ post_lock_func ();
+ return 0;
+}
+
+
+gpg_err_code_t
+_gpgrt_lock_trylock (gpgrt_lock_t *lockhd)
+{
+ _gpgrt_lock_t *lock = get_lock_object (lockhd);
+
+ if (!lock->initdone)
+ {
+ if (!InterlockedIncrement (&lock->started))
+ {
+ gpgrt_lock_init (lockhd);
+ }
+ else
+ {
+ while (!lock->initdone)
+ Sleep (0);
+ }
+ }
+
+ if (!TryEnterCriticalSection (&lock->csec))
+ return GPG_ERR_EBUSY;
+ return 0;
+}
+
+
+gpg_err_code_t
+_gpgrt_lock_unlock (gpgrt_lock_t *lockhd)
+{
+ _gpgrt_lock_t *lock = get_lock_object (lockhd);
+
+ if (!lock->initdone)
+ return GPG_ERR_INV_LOCK_OBJ;
+ LeaveCriticalSection (&lock->csec);
+ return 0;
+}
+
+
+/* Note: Use this function only if no other thread holds or waits for
+ this lock. */
+gpg_err_code_t
+_gpgrt_lock_destroy (gpgrt_lock_t *lockhd)
+{
+ _gpgrt_lock_t *lock = get_lock_object (lockhd);
+
+ if (!lock->initdone)
+ return GPG_ERR_INV_LOCK_OBJ;
+ DeleteCriticalSection (&lock->csec);
+ lock->initdone = 0;
+ lock->started = -1;
+ return 0;
+}
diff --git a/src/w32-thread.c b/src/w32-thread.c
new file mode 100644
index 0000000..aef421f
--- /dev/null
+++ b/src/w32-thread.c
@@ -0,0 +1,66 @@
+/* w32-thread.c - GPGRT thread functions for Windows
+ Copyright (C) 2014 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifndef HAVE_W32_SYSTEM
+# error This module may only be build for Windows.
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <gpg-error.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include "thread.h"
+
+/*
+ * Functions called before and after blocking syscalls.
+ * gpgrt_set_syscall_clamp is used to set them.
+ */
+static void (*pre_syscall_func)(void);
+static void (*post_syscall_func)(void);
+
+
+/* Helper to set the clamp functions. This is called as a helper from
+ * _gpgrt_set_syscall_clamp to keep the function pointers local. */
+void
+_gpgrt_thread_set_syscall_clamp (void (*pre)(void), void (*post)(void))
+{
+ pre_syscall_func = pre;
+ post_syscall_func = post;
+}
+
+
+
+gpg_err_code_t
+_gpgrt_yield (void)
+{
+ if (pre_syscall_func)
+ pre_syscall_func ();
+ Sleep (0);
+ if (post_syscall_func)
+ post_syscall_func ();
+ return 0;
+}
diff --git a/src/w32ce-add.h b/src/w32ce-add.h
new file mode 100644
index 0000000..c6207bb
--- /dev/null
+++ b/src/w32ce-add.h
@@ -0,0 +1,8 @@
+## w32ce-add.h - Snippet to be be included into gpg-error.h.
+## (Comments are indicated by a double hash mark)
+
+/* Substitute for strerror - this one is thread safe. */
+char *_gpg_w32ce_strerror (int err);
+#ifdef GPG_ERR_ENABLE_ERRNO_MACROS
+# define strerror(a) _gpg_w32ce_strerror (a)
+#endif
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..a3c6cbd
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,41 @@
+# Makefile.am for libgpg-error/tests.
+# Copyright (C) 2003 g10 Code GmbH
+#
+# This file is part of libgpg-error.
+#
+# libgpg-error is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of the
+# License, or (at your option) any later version.
+#
+# libgpg-error is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser 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
+
+## Process this file with automake to produce Makefile.in
+
+if HAVE_W32CE_SYSTEM
+extra_includes = -idirafter $(top_builddir)/src/gpg-extra
+else
+extra_includes =
+endif
+
+gpg_error_lib = ../src/libgpg-error.la
+
+TESTS = t-version t-strerror t-syserror t-lock t-printf t-poll t-b64dec
+
+AM_CPPFLAGS = -I$(top_builddir)/src $(extra_includes)
+
+AM_LDFLAGS = -no-install
+LDADD = $(gpg_error_lib)
+
+noinst_PROGRAMS = $(TESTS)
+noinst_HEADERS = t-common.h
+
+t_lock_LDADD = $(gpg_error_lib) $(LIBMULTITHREAD)
+t_poll_LDADD = $(gpg_error_lib) $(LIBMULTITHREAD)
diff --git a/tests/t-b64dec.c b/tests/t-b64dec.c
new file mode 100644
index 0000000..aae208b
--- /dev/null
+++ b/tests/t-b64dec.c
@@ -0,0 +1,123 @@
+/* t-b64dec.c - b64dec test.
+ Copyright (C) 2017 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with libgpgme-error; if not, write to the Free
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#include <gpg-error.h>
+
+static const char *test_b64_string = "bGliZ3BnLWVycm9yIGlzIGZyZWUgc29"
+ "mdHdhcmU7IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vciBtb2RpZnkgaXQgd"
+ "W5kZXIgdGhlIHRlcm1zIG9mIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljIEx"
+ "pY2Vuc2UgYXMgcHVibGlzaGVkIGJ5IHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb"
+ "247IGVpdGhlciB2ZXJzaW9uIDIuMSBvZiB0aGUgTGljZW5zZSwgb3IgKGF0IHlvdXI"
+ "gb3B0aW9uKSBhbnkgbGF0ZXIgdmVyc2lvbi4=";
+
+static const char *test_string = "libgpg-error is free software; "
+ "you can redistribute it and/or modify it under the terms of "
+ "the GNU Lesser General Public License as published by the Free "
+ "Software Foundation; either version 2.1 of the License, or "
+ "(at your option) any later version.";
+
+#define fail(a) do { fprintf (stderr, "%s:%d: test %d failed\n",\
+ __FILE__,__LINE__, (a)); \
+ errcount++; \
+ } while(0)
+
+static int errcount;
+
+static gpg_error_t
+test_b64dec_string (const char *string, const char *expected)
+{
+ gpg_error_t err;
+ gpgrt_b64state_t state;
+ char *buffer;
+ size_t len;
+
+ len = strlen (string);
+ buffer = malloc (strlen (string) + 1);
+ if (!buffer)
+ {
+ err = gpg_error_from_syserror ();
+ return err;
+ }
+
+ state = gpgrt_b64dec_start ("");
+ if (!state)
+ {
+ err = gpg_error_from_syserror ();
+ free (buffer);
+ return err;
+ }
+
+ err = gpgrt_b64dec_proc (state, buffer, len, &len);
+ if (err)
+ {
+ if (gpg_err_code (err) != GPG_ERR_EOF)
+ {
+ free (buffer);
+ free (state);
+ return err;
+ }
+ }
+
+ err = gpgrt_b64dec_finish (state);
+ if (err)
+ {
+ free (buffer);
+ return err;
+ }
+
+ if (strncmp (buffer, expected, len) == 0)
+ err = 0;
+ else
+ err = GPG_ERR_INTERNAL;
+
+ free (buffer);
+ return err;
+}
+
+
+
+int
+main (int argc, char **argv)
+{
+ gpg_error_t err;
+
+ (void)argc;
+ (void)argv;
+
+ err = test_b64dec_string (test_b64_string, test_string);
+
+ if (err)
+ {
+ fail (1);
+ return 1;
+ }
+ else
+ return 0;
+}
diff --git a/tests/t-common.h b/tests/t-common.h
new file mode 100644
index 0000000..e11bca9
--- /dev/null
+++ b/tests/t-common.h
@@ -0,0 +1,102 @@
+/* t-common.h - Common code for the tests.
+ * Copyright (C) 2013 g10 Code GmbH
+ *
+ * This file is part of libgpg-error.
+ *
+ * libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * libgpg-error is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include <stdarg.h>
+
+#include "../src/gpg-error.h"
+
+#ifndef PGM
+# error Macro PGM not defined.
+#endif
+#ifndef DIM
+# define DIM(array) (sizeof (array) / sizeof (*array))
+#endif
+
+
+static int verbose;
+static int debug;
+static int errorcount;
+
+
+static void
+die (const char *format, ...)
+{
+ va_list arg_ptr ;
+
+ fflush (stdout);
+#ifdef HAVE_FLOCKFILE
+ flockfile (stderr);
+#endif
+ fprintf (stderr, "%s: ", PGM);
+ va_start (arg_ptr, format) ;
+ vfprintf (stderr, format, arg_ptr);
+ va_end (arg_ptr);
+ if (*format && format[strlen(format)-1] != '\n')
+ putc ('\n', stderr);
+#ifdef HAVE_FLOCKFILE
+ funlockfile (stderr);
+#endif
+ exit (1);
+}
+
+
+static void
+fail (const char *format, ...)
+{
+ va_list arg_ptr;
+
+ fflush (stdout);
+#ifdef HAVE_FLOCKFILE
+ flockfile (stderr);
+#endif
+ fprintf (stderr, "%s: ", PGM);
+ va_start (arg_ptr, format);
+ vfprintf (stderr, format, arg_ptr);
+ va_end (arg_ptr);
+ if (*format && format[strlen(format)-1] != '\n')
+ putc ('\n', stderr);
+#ifdef HAVE_FLOCKFILE
+ funlockfile (stderr);
+#endif
+ errorcount++;
+ if (errorcount >= 50)
+ die ("stopped after 50 errors.");
+}
+
+
+static void
+show (const char *format, ...)
+{
+ va_list arg_ptr;
+
+ if (!verbose)
+ return;
+#ifdef HAVE_FLOCKFILE
+ flockfile (stderr);
+#endif
+ fprintf (stderr, "%s: ", PGM);
+ va_start (arg_ptr, format);
+ vfprintf (stderr, format, arg_ptr);
+ if (*format && format[strlen(format)-1] != '\n')
+ putc ('\n', stderr);
+ va_end (arg_ptr);
+#ifdef HAVE_FLOCKFILE
+ funlockfile (stderr);
+#endif
+}
diff --git a/tests/t-lock.c b/tests/t-lock.c
new file mode 100644
index 0000000..6add18b
--- /dev/null
+++ b/tests/t-lock.c
@@ -0,0 +1,333 @@
+/* t-lock.c - Check the lock functions
+ * Copyright (C) 2013, 2015 g10 Code GmbH
+ *
+ * This file is part of libgpg-error.
+ *
+ * libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * libgpg-error is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <sys/types.h>
+#include <unistd.h>
+#ifdef _WIN32
+# include <windows.h>
+# include <time.h>
+#else
+# ifdef USE_POSIX_THREADS
+# include <pthread.h>
+# endif
+#endif
+
+#define PGM "t-lock"
+
+#include "t-common.h"
+
+#ifdef _WIN32
+# define THREAD_RET_TYPE DWORD WINAPI
+# define THREAD_RET_VALUE 0
+#else
+# define THREAD_RET_TYPE void *
+# define THREAD_RET_VALUE NULL
+#endif
+
+
+/* Our tests works by having a a couple of accountant threads which do
+ random transactions between accounts and a revision threads which
+ checks that the balance of all accounts is invariant. The idea for
+ this check is due to Bruno Haible. */
+#define N_ACCOUNT 8
+#define ACCOUNT_VALUE 42
+static int account[N_ACCOUNT];
+GPGRT_LOCK_DEFINE (accounts_lock);
+
+/* Number of transactions done by each accountant. */
+#define N_TRANSACTIONS 1000
+
+/* Number of accountants to run. */
+#define N_ACCOUNTANTS 5
+
+/* Maximum transaction value. A quite low value is used so that we
+ would get an integer overflow. */
+#define MAX_TRANSACTION_VALUE 50
+
+/* Flag to tell the revision thread to finish. */
+static volatile int stop_revision_thread;
+
+
+/* Initialze all accounts. */
+static void
+init_accounts (void)
+{
+ int i;
+
+ for (i=0; i < N_ACCOUNT; i++)
+ account[i] = ACCOUNT_VALUE;
+}
+
+
+/* Check that the sum of all accounts matches the initial sum. */
+static void
+check_accounts (void)
+{
+ int i, sum;
+
+ sum = 0;
+ for (i = 0; i < N_ACCOUNT; i++)
+ sum += account[i];
+ if (sum != N_ACCOUNT * ACCOUNT_VALUE)
+ die ("accounts out of balance");
+}
+
+
+static void
+print_accounts (void)
+{
+ int i;
+
+ for (i=0; i < N_ACCOUNT; i++)
+ printf ("account %d: %6d\n", i, account[i]);
+}
+
+
+#if defined(_WIN32) || defined(USE_POSIX_THREADS)
+/* Get a a random integer value in the range 0 to HIGH. */
+static unsigned int
+get_rand (int high)
+{
+ return (unsigned int)(1+(int)((double)(high+1)*rand ()/(RAND_MAX+1.0))) - 1;
+}
+
+
+/* Pick a random account. Note that this function is not
+ thread-safe. */
+static int
+pick_account (void)
+{
+ return get_rand (N_ACCOUNT - 1);
+}
+
+
+/* Pick a random value for a transaction. This is not thread-safe. */
+static int
+pick_value (void)
+{
+ return get_rand (MAX_TRANSACTION_VALUE);
+}
+
+
+/* This is the revision department. */
+static THREAD_RET_TYPE
+revision_thread (void *arg)
+{
+ gpg_err_code_t rc;
+ int i = 0;
+
+ (void)arg;
+
+ while (!stop_revision_thread)
+ {
+ rc = gpgrt_lock_lock (&accounts_lock);
+ if (rc)
+ fail ("gpgrt_lock_lock failed at %d: %s", __LINE__, gpg_strerror (rc));
+
+ check_accounts ();
+ rc = gpgrt_lock_unlock (&accounts_lock);
+ if (rc)
+ fail ("gpgrt_lock_unlock failed at %d: %s", __LINE__,gpg_strerror (rc));
+ if (!(++i%7))
+ gpgrt_yield ();
+ }
+ return THREAD_RET_VALUE;
+}
+
+
+/* This is one of our accountants. */
+static THREAD_RET_TYPE
+accountant_thread (void *arg)
+{
+ gpg_err_code_t rc;
+ int i;
+ int acc1, acc2;
+ int value;
+
+ (void)arg;
+
+#ifdef _WIN32
+ srand (time(NULL)*getpid()); /* Windows needs it per thread. */
+#endif
+ for (i = 0; i < N_TRANSACTIONS; i++)
+ {
+ rc = gpgrt_lock_lock (&accounts_lock);
+ if (rc)
+ fail ("gpgrt_lock_lock failed at %d: %s", __LINE__, gpg_strerror (rc));
+
+ acc1 = pick_account ();
+ acc2 = pick_account ();
+ value = pick_value ();
+ account[acc1] += value;
+ account[acc2] -= value;
+
+ rc = gpgrt_lock_unlock (&accounts_lock);
+ if (rc)
+ fail ("gpgrt_lock_unlock failed at %d: %s", __LINE__,gpg_strerror (rc));
+ if (i && !(i%8))
+ gpgrt_yield ();
+ }
+ return THREAD_RET_VALUE;
+}
+#endif /*_WIN32||USE_POSIX_THREADS*/
+
+
+static void
+run_test (void)
+{
+#ifdef _WIN32
+ HANDLE rthread;
+ HANDLE athreads[N_ACCOUNTANTS];
+ int i;
+ int rc;
+
+ stop_revision_thread = 0;
+ rthread = CreateThread (NULL, 0, revision_thread, NULL, 0, NULL);
+ if (!rthread)
+ die ("error creating revision thread: rc=%d", (int)GetLastError ());
+
+ for (i=0; i < N_ACCOUNTANTS; i++)
+ {
+ athreads[i] = CreateThread (NULL, 0, accountant_thread, NULL, 0, NULL);
+ if (!athreads[i])
+ die ("error creating accountant thread %d: rc=%d",
+ i, (int)GetLastError ());
+ }
+
+ for (i=0; i < N_ACCOUNTANTS; i++)
+ {
+ rc = WaitForSingleObject (athreads[i], INFINITE);
+ if (rc == WAIT_OBJECT_0)
+ show ("accountant thread %d has terminated", i);
+ else
+ fail ("waiting for accountant thread %d failed: %d",
+ i, (int)GetLastError ());
+ CloseHandle (athreads[i]);
+ }
+ stop_revision_thread = 1;
+
+ rc = WaitForSingleObject (rthread, INFINITE);
+ if (rc == WAIT_OBJECT_0)
+ show ("revision thread has terminated");
+ else
+ fail ("waiting for revision thread failed: %d", (int)GetLastError ());
+ CloseHandle (rthread);
+
+#else /*!_WIN32*/
+# ifdef USE_POSIX_THREADS
+ pthread_t rthread;
+ pthread_t athreads[N_ACCOUNTANTS];
+ int i;
+
+ stop_revision_thread = 0;
+ pthread_create (&rthread, NULL, revision_thread, NULL);
+
+ for (i=0; i < N_ACCOUNTANTS; i++)
+ pthread_create (&athreads[i], NULL, accountant_thread, NULL);
+
+ for (i=0; i < N_ACCOUNTANTS; i++)
+ {
+ pthread_join (athreads[i], NULL);
+ show ("accountant thread %d has terminated", i);
+ }
+
+ stop_revision_thread = 1;
+ pthread_join (rthread, NULL);
+ show ("revision thread has terminated");
+# else /*!USE_POSIX_THREADS*/
+ verbose++;
+ show ("no thread support - skipping test\n", PGM);
+ verbose--;
+# endif /*!USE_POSIX_THREADS*/
+#endif /*!_WIN32*/
+
+ gpgrt_lock_destroy (&accounts_lock);
+}
+
+
+int
+main (int argc, char **argv)
+{
+ int last_argc = -1;
+ int rc;
+
+ if (argc)
+ {
+ argc--; argv++;
+ }
+ while (argc && last_argc != argc )
+ {
+ last_argc = argc;
+ if (!strcmp (*argv, "--help"))
+ {
+ puts (
+"usage: ./t-lock [options]\n"
+"\n"
+"Options:\n"
+" --verbose Show what is going on\n"
+" --debug Flyswatter\n"
+);
+ exit (0);
+ }
+ if (!strcmp (*argv, "--verbose"))
+ {
+ verbose = 1;
+ argc--; argv++;
+ }
+ else if (!strcmp (*argv, "--debug"))
+ {
+ verbose = debug = 1;
+ argc--; argv++;
+ }
+ }
+
+ srand (time(NULL)*getpid());
+
+ if (!gpg_error_check_version (GPG_ERROR_VERSION))
+ {
+ die ("gpg_error_check_version returned an error");
+ errorcount++;
+ }
+
+ init_accounts ();
+ check_accounts ();
+ run_test ();
+ check_accounts ();
+ /* Run a second time to check deinit code. */
+ run_test ();
+ check_accounts ();
+ /* And a third time to test an explicit init. */
+ rc = gpgrt_lock_init (&accounts_lock);
+ if (rc)
+ fail ("gpgrt_lock_init failed at %d: %s", __LINE__, gpg_strerror (rc));
+ run_test ();
+ check_accounts ();
+ if (verbose)
+ print_accounts ();
+
+ return errorcount ? 1 : 0;
+}
diff --git a/tests/t-poll.c b/tests/t-poll.c
new file mode 100644
index 0000000..ec79416
--- /dev/null
+++ b/tests/t-poll.c
@@ -0,0 +1,440 @@
+/* t-poll.c - Check the poll function
+ * Copyright (C) 2015 g10 Code GmbH
+ *
+ * This file is part of libgpg-error.
+ *
+ * libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * libgpg-error is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+/* FIXME: We need much better tests that this very basic one. */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <errno.h>
+#ifdef _WIN32
+# include <windows.h>
+# include <time.h>
+#else
+# ifdef USE_POSIX_THREADS
+# include <pthread.h>
+# endif
+#endif
+
+#define PGM "t-poll"
+
+#include "t-common.h"
+
+#ifdef _WIN32
+# define THREAD_RET_TYPE DWORD WINAPI
+# define THREAD_RET_VALUE 0
+#else
+# define THREAD_RET_TYPE void *
+# define THREAD_RET_VALUE NULL
+#endif
+
+
+/* Object to convey data to a thread. */
+struct thread_arg
+{
+ const char *name;
+ estream_t stream;
+ volatile int stop_me;
+#ifdef USE_POSIX_THREADS
+ pthread_t thread;
+#elif _WIN32
+ HANDLE thread;
+#endif
+};
+
+
+static struct thread_arg peer_stdin; /* Thread to feed the stdin. */
+static struct thread_arg peer_stdout; /* Thread to feed the stdout. */
+static struct thread_arg peer_stderr; /* Thread to feed the stderr. */
+
+static estream_t test_stdin;
+static estream_t test_stdout;
+static estream_t test_stderr;
+
+#if defined(_WIN32) || defined(USE_POSIX_THREADS)
+
+/* This thread feeds data to the given stream. */
+static THREAD_RET_TYPE
+producer_thread (void *argaddr)
+{
+ struct thread_arg *arg = argaddr;
+ int i = 0;
+
+ (void)arg;
+
+ while (!arg->stop_me && i++ < 3)
+ {
+ show ("thread '%s' about to write\n", arg->name);
+ es_fprintf (arg->stream, "This is '%s' count=%d\n", arg->name, i);
+ es_fflush (arg->stream);
+ }
+ es_fclose (arg->stream);
+ return THREAD_RET_VALUE;
+}
+
+/* This thread eats data from the given stream. */
+static THREAD_RET_TYPE
+consumer_thread (void *argaddr)
+{
+ struct thread_arg *arg = argaddr;
+ char buf[15];
+
+ (void)arg;
+
+ while (!arg->stop_me)
+ {
+ show ("thread '%s' ready to read\n", arg->name);
+ if (!es_fgets (buf, sizeof buf, arg->stream))
+ {
+ show ("Thread '%s' received EOF or error\n", arg->name);
+ break;
+ }
+ show ("Thread '%s' got: '%s'\n", arg->name, buf);
+ }
+ es_fclose (arg->stream);
+ return THREAD_RET_VALUE;
+}
+
+#endif /*_WIN32 || USE_POSIX_THREADS */
+
+
+static void
+launch_thread (THREAD_RET_TYPE (*fnc)(void *), struct thread_arg *th)
+{
+ int fd;
+
+ th->stop_me = 0;
+ fd = es_fileno (th->stream);
+#ifdef _WIN32
+
+ th->thread = CreateThread (NULL, 0, fnc, th, 0, NULL);
+ if (!th->thread)
+ die ("creating thread '%s' failed: rc=%d", th->name, (int)GetLastError ());
+ show ("thread '%s' launched (fd=%d)\n", th->name, fd);
+
+#elif USE_POSIX_THREADS
+
+ if (pthread_create (&th->thread, NULL, fnc, th))
+ die ("creating thread '%s' failed: %s\n", th->name, strerror (errno));
+ show ("thread '%s' launched (fd=%d)\n", th->name, fd);
+
+# else /* no thread support */
+
+ verbose++;
+ show ("no thread support - skipping test\n", PGM);
+ verbose--;
+
+#endif /* no thread support */
+}
+
+
+static void
+join_thread (struct thread_arg *th)
+{
+#ifdef _WIN32
+ int rc;
+
+ rc = WaitForSingleObject (th->thread, INFINITE);
+ if (rc == WAIT_OBJECT_0)
+ show ("thread '%s' has terminated\n", th->name);
+ else
+ fail ("waiting for thread '%s' failed: %d", th->name, (int)GetLastError ());
+ CloseHandle (th->thread);
+
+#elif USE_POSIX_THREADS
+
+ pthread_join (th->thread, NULL);
+ show ("thread '%s' has terminated\n", th->name);
+
+#endif
+}
+
+
+static void
+create_pipe (estream_t *r_in, estream_t *r_out)
+{
+ gpg_error_t err;
+ int filedes[2];
+
+#ifdef _WIN32
+ if (_pipe (filedes, 512, 0) == -1)
+#else
+ if (pipe (filedes) == -1)
+#endif
+ {
+ err = gpg_error_from_syserror ();
+ die ("error creating a pipe: %s\n", gpg_strerror (err));
+ }
+
+ show ("created pipe [%d, %d]\n", filedes[0], filedes[1]);
+
+ *r_in = es_fdopen (filedes[0], "r,pollable");
+ if (!*r_in)
+ {
+ err = gpg_error_from_syserror ();
+ die ("error creating a stream for a pipe: %s\n", gpg_strerror (err));
+ }
+
+ *r_out = es_fdopen (filedes[1], "w,pollable");
+ if (!*r_out)
+ {
+ err = gpg_error_from_syserror ();
+ die ("error creating a stream for a pipe: %s\n", gpg_strerror (err));
+ }
+}
+
+
+static void
+test_poll (void)
+{
+ int ret;
+ gpgrt_poll_t fds[3];
+ char buffer[16];
+ size_t used, nwritten;
+ int c;
+
+ memset (fds, 0, sizeof fds);
+ fds[0].stream = test_stdin;
+ fds[0].want_read = 1;
+ fds[1].stream = test_stdout;
+ fds[1].want_write = 1;
+ /* FIXME: We don't use the next stream at all. */
+ fds[2].stream = test_stderr;
+ fds[2].want_write = 1;
+ fds[2].ignore = 1;
+
+
+ used = 0;
+ while (used || !fds[0].ignore)
+ {
+ ret = gpgrt_poll (fds, DIM(fds), -1);
+ if (ret == -1)
+ {
+ fail ("gpgrt_poll failed: %s\n", strerror (errno));
+ continue;
+ }
+ if (!ret)
+ {
+ fail ("gpgrt_poll unexpectedly timed out\n");
+ continue;
+ }
+
+ show ("gpgrt_poll detected %d events\n", ret);
+ if (debug)
+ show ("gpgrt_poll: r=%d"
+ " 0:%c%c%c%c%c%c%c%c%c%c%c%c"
+ " 1:%c%c%c%c%c%c%c%c%c%c%c%c"
+ " 2:%c%c%c%c%c%c%c%c%c%c%c%c"
+ "\n",
+ ret,
+ fds[0].want_read? 'r':'-',
+ fds[0].want_write? 'w':'-',
+ fds[0].want_oob? 'o':'-',
+ fds[0].want_rdhup? 'h':'-',
+ fds[0].ignore? '!':'=',
+ fds[0].got_read? 'r':'-',
+ fds[0].got_write? 'w':'-',
+ fds[0].got_oob? 'o':'-',
+ fds[0].got_rdhup? 'h':'-',
+ fds[0].got_hup? 'H':' ',
+ fds[0].got_err? 'e':' ',
+ fds[0].got_nval? 'n':' ',
+
+ fds[1].want_read? 'r':'-',
+ fds[1].want_write? 'w':'-',
+ fds[1].want_oob? 'o':'-',
+ fds[1].want_rdhup? 'h':'-',
+ fds[1].ignore? '!':'=',
+ fds[1].got_read? 'r':'-',
+ fds[1].got_write? 'w':'-',
+ fds[1].got_oob? 'o':'-',
+ fds[1].got_rdhup? 'h':'-',
+ fds[1].got_hup? 'H':' ',
+ fds[1].got_err? 'e':' ',
+ fds[1].got_nval? 'n':' ',
+
+ fds[2].want_read? 'r':'-',
+ fds[2].want_write? 'w':'-',
+ fds[2].want_oob? 'o':'-',
+ fds[2].want_rdhup? 'h':'-',
+ fds[2].ignore? '!':'=',
+ fds[2].got_read? 'r':'-',
+ fds[2].got_write? 'w':'-',
+ fds[2].got_oob? 'o':'-',
+ fds[2].got_rdhup? 'h':'-',
+ fds[2].got_hup? 'H':' ',
+ fds[2].got_err? 'e':' ',
+ fds[2].got_nval? 'n':' '
+ );
+ else
+ show ("gpgrt_poll detected %d events\n", ret);
+
+ if (fds[0].got_read)
+ {
+ /* Read from the producer. */
+ for (;;)
+ {
+ c = es_fgetc (fds[0].stream);
+ if (c == EOF)
+ {
+ if (es_feof (fds[0].stream))
+ {
+ show ("reading '%s': EOF\n", peer_stdin.name);
+ fds[0].ignore = 1; /* Not anymore needed. */
+ peer_stdin.stop_me = 1; /* Tell the thread to stop. */
+ }
+ else if (es_ferror (fds[0].stream))
+ {
+ fail ("error reading '%s': %s\n",
+ peer_stdin.name, strerror (errno));
+ fds[0].ignore = 1; /* Disable. */
+ peer_stdin.stop_me = 1; /* Tell the thread to stop. */
+ }
+ else
+ show ("reading '%s': EAGAIN\n", peer_stdin.name);
+ break;
+ }
+ else
+ {
+ if (used <= sizeof buffer -1)
+ buffer[used++] = c;
+ if (used == sizeof buffer)
+ {
+ show ("throttling reading from '%s'\n", peer_stdin.name);
+ fds[0].ignore = 1;
+ break;
+ }
+ }
+ }
+ show ("read from '%s': %zu bytes\n", peer_stdin.name, used);
+ if (used)
+ fds[1].ignore = 0; /* Data to send. */
+ }
+ if (fds[1].got_write)
+ {
+ if (used)
+ {
+ ret = es_write (fds[1].stream, buffer, used, &nwritten);
+ show ("result for writing to '%s': ret=%d, n=%zu, nwritten=%zu\n",
+ peer_stdout.name, ret, used, nwritten);
+ if (!ret)
+ {
+ assert (nwritten <= used);
+ /* Move the remaining data to the front of buffer. */
+ memmove (buffer, buffer + nwritten,
+ sizeof buffer - nwritten);
+ used -= nwritten;
+ }
+ ret = es_fflush (fds[1].stream);
+ if (ret)
+ fail ("Flushing for '%s' failed: %s\n",
+ peer_stdout.name, strerror (errno));
+ }
+ if (!used)
+ fds[1].ignore = 1; /* No need to send data. */
+ }
+
+ if (used < sizeof buffer / 2 && !peer_stdin.stop_me && fds[0].ignore)
+ {
+ show ("accelerate reading from '%s'\n", peer_stdin.name);
+ fds[0].ignore = 0;
+ }
+ }
+}
+
+
+int
+main (int argc, char **argv)
+{
+ int last_argc = -1;
+
+ if (argc)
+ {
+ argc--; argv++;
+ }
+ while (argc && last_argc != argc )
+ {
+ last_argc = argc;
+ if (!strcmp (*argv, "--help"))
+ {
+ puts (
+"usage: ./t-poll [options]\n"
+"\n"
+"Options:\n"
+" --verbose Show what is going on\n"
+" --debug Flyswatter\n"
+);
+ exit (0);
+ }
+ if (!strcmp (*argv, "--verbose"))
+ {
+ verbose = 1;
+ argc--; argv++;
+ }
+ else if (!strcmp (*argv, "--debug"))
+ {
+ verbose = debug = 1;
+ argc--; argv++;
+ }
+ }
+
+ if (!gpg_error_check_version (GPG_ERROR_VERSION))
+ {
+ die ("gpg_error_check_version returned an error");
+ errorcount++;
+ }
+
+ peer_stdin.name = "stdin producer";
+ create_pipe (&test_stdin, &peer_stdin.stream);
+ peer_stdout.name = "stdout consumer";
+ create_pipe (&peer_stdout.stream, &test_stdout);
+ peer_stderr.name = "stderr consumer";
+ create_pipe (&peer_stderr.stream, &test_stderr);
+
+ if (es_set_nonblock (test_stdin, 1))
+ fail ("error setting test_stdin to nonblock: %s\n", strerror (errno));
+ if (es_set_nonblock (test_stdout, 1))
+ fail ("error setting test_stdout to nonblock: %s\n", strerror (errno));
+ if (es_set_nonblock (test_stderr, 1))
+ fail ("error setting test_stderr to nonblock: %s\n", strerror (errno));
+
+ launch_thread (producer_thread, &peer_stdin );
+ launch_thread (consumer_thread, &peer_stdout);
+ launch_thread (consumer_thread, &peer_stderr);
+ test_poll ();
+ show ("Waiting for threads to terminate...\n");
+ es_fclose (test_stdin);
+ es_fclose (test_stdout);
+ es_fclose (test_stderr);
+ peer_stdin.stop_me = 1;
+ peer_stdout.stop_me = 1;
+ peer_stderr.stop_me = 1;
+ join_thread (&peer_stdin);
+ join_thread (&peer_stdout);
+ join_thread (&peer_stderr);
+
+ return errorcount ? 1 : 0;
+}
diff --git a/tests/t-printf.c b/tests/t-printf.c
new file mode 100644
index 0000000..7fba012
--- /dev/null
+++ b/tests/t-printf.c
@@ -0,0 +1,429 @@
+/* t-printf.c - Check the estream printf fucntions.
+ * Copyright (C) 2013 g10 Code GmbH
+ *
+ * This file is part of libgpg-error.
+ *
+ * libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * libgpg-error is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+/* Note that these tests check against glibc behaviour. On non glibc
+ systems expect non matching return codes in some border cases. */
+
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <errno.h>
+#include <locale.h>
+
+#define PGM "t-printf"
+
+#include "t-common.h"
+
+
+static char *one_test_buf1;
+static int one_test_rc1;
+
+static void
+one_test_x0 (const char *format, ...)
+{
+ va_list arg_ptr;
+
+ show ("format: ->%s<-\n", format);
+
+ errno = ENOENT; /* For the "%m" test. */
+ va_start (arg_ptr, format);
+#ifdef HAVE_VASPRINTF
+ one_test_rc1 = vasprintf (&one_test_buf1, format, arg_ptr);
+#else
+ one_test_rc1 = -1;
+#endif
+ va_end (arg_ptr);
+ if (one_test_rc1 == -1)
+ {
+ fail (" sys: errno=%d (%s)\n", errno, strerror (errno));
+ one_test_buf1 = NULL;
+ }
+ else
+ show (" sys: ->%s<-\n", one_test_buf1);
+}
+
+static void
+one_test_x1 (const char *format, ...)
+{
+ int rc2;
+ va_list arg_ptr;
+ char *buf2;
+
+ errno = ENOENT;
+ va_start (arg_ptr, format);
+ rc2 = gpgrt_vasprintf (&buf2, format, arg_ptr);
+ va_end (arg_ptr);
+ if (rc2 == -1)
+ {
+ fail (" our: errno=%d (%s)\n", errno, strerror (errno));
+ }
+ else
+ show (" our: ->%s<-\n", buf2);
+
+ if (one_test_rc1 != -1 && rc2 != -1 && strcmp (one_test_buf1, buf2))
+ {
+ fail ("error: output does not match\n"
+ "format: ->%s<-\n sys: ->%s<-\n our: ->%s<-\n",
+ format, one_test_buf1, buf2);
+ }
+ else if ( one_test_rc1 != rc2 )
+ {
+ fail ("error: return codes are different: sys_rc=%d our_rc=%d\n",
+ one_test_rc1, rc2);
+ }
+
+ free (buf2);
+}
+
+static void
+one_test_x2 (const char *format, ...)
+{
+ va_list arg_ptr;
+ char *buf2;
+
+ /* Test once more using the bsprintf variant. */
+ errno = ENOENT;
+ va_start (arg_ptr, format);
+ buf2 = gpgrt_vbsprintf (format, arg_ptr);
+ va_end (arg_ptr);
+ if (!buf2)
+ {
+ fail (" our(2): errno=%d (%s)\n", errno, strerror (errno));
+ }
+ else if (verbose)
+ show (" our: ->%s<-\n", buf2);
+
+ if (one_test_rc1 != -1 && buf2 && strcmp (one_test_buf1, buf2))
+ {
+ fail ("error: output does not match\n"
+ "format(2): ->%s<-\n sys: ->%s<-\n our: ->%s<-\n",
+ format, one_test_buf1, buf2);
+ }
+ es_free (buf2);
+
+ free (one_test_buf1);
+ one_test_buf1 = NULL;
+}
+
+
+#define one_test_0(a) \
+ one_test_x0 (a); \
+ one_test_x1 (a); \
+ one_test_x2 (a)
+#define one_test_1(a, b) \
+ one_test_x0 (a, b); \
+ one_test_x1 (a, b); \
+ one_test_x2 (a, b)
+#define one_test_2(a, b, c) \
+ one_test_x0 (a, b, c); \
+ one_test_x1 (a, b, c); \
+ one_test_x2 (a, b, c)
+#define one_test_3(a, b, c, d) \
+ one_test_x0 (a, b, c, d); \
+ one_test_x1 (a, b, c, d); \
+ one_test_x2 (a, b, c, d)
+
+static void
+run_tests (void)
+{
+#ifndef HAVE_VASPRINTF
+ /* We do not have a system vasprintf. */
+ show ("run-tests: disabled due to missing vasprintf.\n");
+#else /*HAVE_VASPRINTF */
+
+ /*one_test ("%d %% %'d", 17, 19681977);*/
+
+ one_test_2 ("%d %% %d", 17, 768114563);
+ one_test_2 ("%d %% %d", 17, -768114563);
+
+ one_test_1 ("%d", 17);
+ one_test_1 ("%4d", 17);
+ one_test_1 ("%40d", 17);
+ one_test_1 ("%-d", 17);
+ one_test_1 ("%-4d", 17);
+ one_test_1 ("%-140d", 17);
+ one_test_1 ("%d", -17);
+ one_test_1 ("%4d", -17);
+ one_test_1 ("%40d", -17);
+ one_test_1 ("%-d", -17);
+ one_test_1 ("%-4d", -17);
+ one_test_1 ("%-40d", -17);
+
+ one_test_1 ("%+4d", 17);
+ one_test_1 ("%+4d", -17);
+ one_test_1 ("%-+4d", 17);
+ one_test_1 ("%-+4d", -17);
+ one_test_1 ("% 4d", 17);
+ one_test_1 ("% 4d", -17);
+ one_test_1 ("%- +4d", 17);
+ one_test_1 ("%- +4d", -17);
+
+ one_test_1 ("%.4d", 17);
+ one_test_1 ("%.0d", 17);
+ one_test_1 ("%.0d", 0);
+ one_test_1 ("%.4d", -17);
+ one_test_1 ("%.0d", -17);
+ one_test_1 ("%6.4d", 17);
+ one_test_1 ("%6.4d", -17);
+ one_test_1 ("%6.0d", 0);
+ one_test_1 ("%4.6d", 17);
+ one_test_1 ("%4.6d", -17);
+
+ one_test_1 ("% 4.6d", 17);
+ one_test_1 ("% 6.0d", 0);
+
+ one_test_1 ("%.4d", 17);
+ one_test_1 ("%04d", 17);
+ one_test_1 ("%.4d", -17);
+ one_test_1 ("%04d", -17);
+ one_test_1 ("%0.d", 0);
+
+ one_test_2 ("%*d", 7, 42);
+ one_test_2 ("%*d", -7, 42);
+ one_test_2 ("%.*d", 7, 42);
+ one_test_2 ("%.*d", -7, 42);
+ one_test_3 ("%*.*d", 10, 7, 42);
+ one_test_3 ("%*.*d", 10, -7, 42);
+ one_test_3 ("%*.*d", -10, 7, 42);
+ one_test_3 ("%*.*d", -10, -7, 42);
+
+ one_test_2 ("%*x", 7, 42);
+ one_test_2 ("%*x", -7, 42);
+ one_test_2 ("%.*x", 7, 42);
+ one_test_2 ("%.*x", -7, 42);
+ one_test_3 ("%*.*x", 10, 7, 42);
+ one_test_3 ("%*.*x", 10, -7, 42);
+ one_test_3 ("%*.*x", -10, 7, 42);
+ one_test_3 ("%*.*x", -10, -7, 42);
+ one_test_2 ("%#*x", 7, 42);
+ one_test_2 ("%#*x", -7, 42);
+ one_test_2 ("%#.*x", 7, 42);
+ one_test_2 ("%#.*x", -7, 42);
+ one_test_3 ("%#*.*x", 10, 7, 42);
+ one_test_3 ("%#*.*x", 10, -7, 42);
+ one_test_3 ("%#*.*x", -10, 7, 42);
+ one_test_3 ("%#*.*x", -10, -7, 42);
+
+ one_test_2 ("%*X", 7, 42);
+ one_test_2 ("%*X", -7, 42);
+ one_test_2 ("%.*X", 7, 42);
+ one_test_2 ("%.*X", -7, 42);
+ one_test_3 ("%*.*X", 10, 7, 42);
+ one_test_3 ("%*.*X", 10, -7, 42);
+ one_test_3 ("%*.*X", -10, 7, 42);
+ one_test_3 ("%*.*X", -10, -7, 42);
+ one_test_2 ("%#*X", 7, 42);
+ one_test_2 ("%#*X", -7, 42);
+ one_test_2 ("%#.*X", 7, 42);
+ one_test_2 ("%#.*X", -7, 42);
+ one_test_3 ("%#*.*X", 10, 7, 42);
+ one_test_3 ("%#*.*X", 10, -7, 42);
+ one_test_3 ("%#*.*X", -10, 7, 42);
+ one_test_3 ("%#*.*X", -10, -7, 42);
+
+ one_test_2 ("%*o", 7, 42);
+ one_test_2 ("%*o", -7, 42);
+ one_test_2 ("%.*o", 7, 42);
+ one_test_2 ("%.*o", -7, 42);
+ one_test_3 ("%*.*o", 10, 7, 42);
+ one_test_3 ("%*.*o", 10, -7, 42);
+ one_test_3 ("%*.*o", -10, 7, 42);
+ one_test_3 ("%*.*o", -10, -7, 42);
+ one_test_2 ("%#*o", 7, 42);
+ one_test_2 ("%#*o", -7, 42);
+ one_test_2 ("%#.*o", 7, 42);
+ one_test_2 ("%#.*o", -7, 42);
+ one_test_3 ("%#*.*o", 10, 7, 42);
+ one_test_3 ("%#*.*o", 10, -7, 42);
+ one_test_3 ("%#*.*o", -10, 7, 42);
+ one_test_3 ("%#*.*o", -10, -7, 42);
+
+ one_test_1 ("%s", "the quick brown fox jumps over the lazy dogs back");
+ one_test_1 ("%.0s", "the quick brown fox jumps over the lazy dogs back");
+ one_test_1 ("%.10s", "the quick brown fox jumps over the lazy dogs back");
+ one_test_1 ("%.48s", "the quick brown fox jumps over the lazy dogs back");
+ one_test_1 ("%.49s", "the quick brown fox jumps over the lazy dogs back");
+ one_test_1 ("%.50s", "the quick brown fox jumps over the lazy dogs back");
+ one_test_1 ("%.51s", "the quick brown fox jumps over the lazy dogs back");
+ one_test_1 ("%48s", "the quick brown fox jumps over the lazy dogs back");
+ one_test_1 ("%49s", "the quick brown fox jumps over the lazy dogs back");
+ one_test_1 ("%50s", "the quick brown fox jumps over the lazy dogs back");
+ one_test_1 ("%51s", "the quick brown fox jumps over the lazy dogs back");
+ one_test_1 ("%-51s", "the quick brown fox jumps over the lazy dogs back");
+
+ one_test_1 ("/%s=", "CN");
+
+ one_test_1 ("%f", 3.1415926535);
+ one_test_1 ("%f", -3.1415926535);
+ one_test_1 ("%.10f", 3.1415926535);
+ one_test_1 ("%.2f", 3.1415926535);
+ one_test_1 ("%.1f", 3.1415926535);
+ one_test_1 ("%.0f", 3.1415926535);
+ one_test_1 ("%.20f", 3.1415926535);
+ one_test_1 ("%10.10f", 3.1415926535);
+ one_test_1 ("%10.2f", 3.1415926535);
+ one_test_1 ("%10.1f", 3.1415926535);
+ one_test_1 ("%10.0f", 3.1415926535);
+ one_test_1 ("%30.20f", 3.1415926535);
+ one_test_1 ("%10.10f", -3.1415926535);
+ one_test_1 ("%10.2f", -3.1415926535);
+ one_test_1 ("%10.1f", -3.1415926535);
+ one_test_1 ("%10.0f", -3.1415926535);
+ one_test_1 ("%30.20f", -3.1415926535);
+
+ one_test_1 ("%-10f", 3.1415926535);
+ one_test_1 ("%-10.10f", 3.1415926535);
+ one_test_1 ("%-10.2f", 3.1415926535);
+ one_test_1 ("%-10.1f", 3.1415926535);
+ one_test_1 ("%-10.0f", 3.1415926535);
+ one_test_1 ("%-30.20f", 3.1415926535);
+ one_test_1 ("%-10f", -3.1415926535);
+ one_test_1 ("%-10.10f", -3.1415926535);
+ one_test_1 ("%-10.2f", -3.1415926535);
+ one_test_1 ("%-10.1f", -3.1415926535);
+ one_test_1 ("%-10.0f", -3.1415926535);
+ one_test_1 ("%-30.20f", -3.1415926535);
+
+ one_test_1 ("%#.0f", 3.1415926535);
+ one_test_1 ("%#10.0f", 3.1415926535);
+ one_test_1 ("%#10.0f", -3.1415926535);
+ one_test_1 ("%-#10.0f", 3.1415926535);
+ one_test_1 ("%-#10.0f", -3.1415926535);
+
+ one_test_1 ("%e", 3.1415926535);
+ one_test_1 ("%g", 3.1415926535);
+
+ one_test_1 ("%a", 1.0);
+ one_test_1 ("%a", -1.0);
+ one_test_1 ("%a", 3.1415926535);
+
+#ifdef HAVE_LONG_DOUBLE
+ one_test_1 ("%La", (long double)1.0);
+ one_test_1 ("%La", (long double)-1.0);
+ one_test_1 ("%La", (long double)3.1415926535);
+#endif
+
+#ifdef __GLIBC__
+ /* "%m" is a glibc extension so this _test_ will only work on such a
+ system. */
+ one_test_0 ("%m");
+ one_test_1 ("%d=%m", 17);
+ one_test_2 ("%2$d:%m:%1$d", 42, 17);
+#endif /*__GLIBC__*/
+
+#endif /*HAVE_VASPRINTF */
+}
+
+static void
+check_snprintf (void)
+{
+ char buffer[20];
+ int rc, rc2;
+ size_t tmplen, blen, blen2;
+
+ rc = gpgrt_snprintf (buffer, 0, "%*s", 18, "");
+ if (rc != 18)
+ printf ("rc=%d\n", rc );
+ rc = gpgrt_snprintf (buffer, sizeof buffer, "%*s", 18, "");
+ if (rc != 18)
+ printf ("rc=%d, strlen(buffer)=%d\n", rc, (int)strlen (buffer));
+ rc = gpgrt_snprintf (buffer, sizeof buffer, "%*s", 19, "");
+ if (rc != 19)
+ printf ("rc=%d, strlen(buffer)=%d\n", rc, (int)strlen (buffer));
+ rc = gpgrt_snprintf (buffer, sizeof buffer, "%*s", 20, "");
+ if (rc != 20)
+ printf ("rc=%d, strlen(buffer)=%d\n", rc, (int)strlen (buffer));
+ rc = gpgrt_snprintf (buffer, sizeof buffer, "%*s", 21, "");
+ if (rc != 21)
+ printf ("rc=%d, strlen(buffer)=%d\n", rc, (int)strlen (buffer));
+
+ for (tmplen = 0; tmplen <= sizeof buffer; tmplen++)
+ {
+ rc = gpgrt_snprintf (buffer, tmplen, "%04d%02d%02dT%02d%02d%02d",
+ 1998, 9, 7, 16, 56, 05);
+ blen = strlen (buffer);
+ rc2 = snprintf (buffer, tmplen, "%04d%02d%02dT%02d%02d%02d",
+ 1998, 9, 7, 16, 56, 05);
+ blen2 = strlen (buffer);
+ if (rc != rc2 || blen != blen2)
+ printf ("snprintf test with len %u gives %d instead of %d (%u,%u)\n",
+ (unsigned int)tmplen, rc, rc2,
+ (unsigned int)blen, (unsigned int)blen2);
+ }
+}
+
+
+
+int
+main (int argc, char **argv)
+{
+ int last_argc = -1;
+
+ if (argc)
+ {
+ argc--; argv++;
+ }
+ while (argc && last_argc != argc )
+ {
+ last_argc = argc;
+ if (!strcmp (*argv, "--help"))
+ {
+ puts (
+"usage: ./" PGM " [options]\n"
+"\n"
+"Options:\n"
+" --verbose Show what is going on\n"
+" --debug Flyswatter\n"
+);
+ exit (0);
+ }
+ if (!strcmp (*argv, "--verbose"))
+ {
+ verbose = 1;
+ argc--; argv++;
+ }
+ else if (!strcmp (*argv, "--debug"))
+ {
+ verbose = debug = 1;
+ argc--; argv++;
+ }
+ }
+
+ setlocale (LC_NUMERIC, "");
+ if (!gpg_error_check_version (GPG_ERROR_VERSION))
+ {
+ die ("gpg_error_check_version returned an error");
+ errorcount++;
+ }
+
+ run_tests ();
+ check_snprintf ();
+
+#ifdef __GLIBC__
+ return !!errorcount;
+#else
+ return 0;
+#endif
+}
diff --git a/tests/t-strerror.c b/tests/t-strerror.c
new file mode 100644
index 0000000..9289066
--- /dev/null
+++ b/tests/t-strerror.c
@@ -0,0 +1,63 @@
+/* t-strerror.c - Regression test.
+ Copyright (C) 2003 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with libgpgme-error; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#include <gpg-error.h>
+
+int
+main (int argc, char *argv[])
+{
+ if (argc > 1)
+ {
+ int i = 1;
+ while (i + 1 < argc)
+ {
+ gpg_error_t err = gpg_err_make (atoi (argv[i]), atoi (argv[i + 1]));
+ printf ("%s: %s\n", gpg_strsource (err), gpg_strerror (err));
+ i += 2;
+ }
+ }
+ else
+ {
+ struct
+ {
+ gpg_err_source_t src;
+ gpg_err_code_t code;
+ } list[] = { { 0, 0 }, { 1, 201 }, { 2, 2 }, { 3, 102 },
+ { 4, 100 }, { 5, 99 }, { 6, 110 }, { 7, 7 }, { 8, 888 } };
+ int i = 0;
+
+ while (i < sizeof (list) / sizeof (list[0]))
+ {
+ gpg_error_t err = gpg_err_make (list[i].src, list[i].code);
+ printf ("%s: %s\n", gpg_strsource (err), gpg_strerror (err));
+ i++;
+ }
+ }
+ return 0;
+}
diff --git a/tests/t-syserror.c b/tests/t-syserror.c
new file mode 100644
index 0000000..a4cb983
--- /dev/null
+++ b/tests/t-syserror.c
@@ -0,0 +1,87 @@
+/* t-syserror.c - System error specific regression test.
+ Copyright (C) 2006 g10 Code GmbH
+
+ This file is part of libgpg-error.
+
+ libgpg-error is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License
+ as published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ libgpg-error is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with libgpgme-error; if not, write to the Free
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <errno.h>
+
+#include <gpg-error.h>
+
+int
+main (int argc, char *argv[])
+{
+ FILE *fp;
+ int save_errno;
+ gpg_err_code_t ec;
+
+ (void)argc;
+ (void)argv;
+
+ fp = fopen ("/does-not-exist/110761/nowhere.foo", "r");
+ if (fp)
+ {
+ fclose (fp);
+ fp = fopen (" no this file does not exists foo 4711", "r");
+ }
+ if (fp)
+ {
+ fprintf (stderr, "unable to run test\n");
+ return 1;
+ }
+ save_errno = errno;
+
+ ec = gpg_err_code_from_syserror ();
+ if (ec != GPG_ERR_ENOENT)
+ {
+ fprintf (stderr, "fopen failed with bad code: %d\n", save_errno);
+ return 1;
+ }
+
+ if (ec != gpg_err_code_from_errno (save_errno))
+ {
+ fprintf (stderr, "oops at %d\n",__LINE__);
+ return 1;
+ }
+
+ gpg_err_set_errno (0);
+
+ ec = gpg_err_code_from_syserror ();
+ if (ec != GPG_ERR_MISSING_ERRNO)
+ {
+ fprintf (stderr, "oops at %d\n",__LINE__);
+ return 1;
+ }
+
+ if ( gpg_err_code_from_errno (0) )
+ {
+ fprintf (stderr, "oops at %d\n",__LINE__);
+ return 1;
+ }
+
+
+ return 0;
+}
diff --git a/tests/t-version.c b/tests/t-version.c
new file mode 100644
index 0000000..4606dbc
--- /dev/null
+++ b/tests/t-version.c
@@ -0,0 +1,98 @@
+/* t-version.c - Check the version info function
+ * Copyright (C) 2013 g10 Code GmbH
+ *
+ * This file is part of libgpg-error.
+ *
+ * libgpg-error is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * libgpg-error is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+#include "../src/gpg-error.h"
+
+static const char *logpfx = "";
+static int verbose;
+static int debug;
+static int errorcount;
+
+int
+main (int argc, char **argv)
+{
+ int last_argc = -1;
+
+ if (argc)
+ {
+ logpfx = *argv;
+ argc--; argv++;
+ }
+ while (argc && last_argc != argc )
+ {
+ last_argc = argc;
+ if (!strcmp (*argv, "--help"))
+ {
+ puts (
+"usage: ./version [options]\n"
+"\n"
+"Options:\n"
+" --verbose Show what is going on\n"
+);
+ exit (0);
+ }
+ if (!strcmp (*argv, "--verbose"))
+ {
+ verbose = 1;
+ argc--; argv++;
+ }
+ else if (!strcmp (*argv, "--debug"))
+ {
+ verbose = debug = 1;
+ argc--; argv++;
+ }
+ }
+
+ if (!gpg_error_check_version (GPG_ERROR_VERSION))
+ {
+ fprintf (stderr, "%s: gpg_error_check_version returned an error\n",
+ logpfx);
+ errorcount++;
+ }
+ if (!gpg_error_check_version ("1.10"))
+ {
+ fprintf (stderr, "%s: gpg_error_check_version returned an "
+ "error for an old version\n", logpfx);
+ errorcount++;
+ }
+ if (gpg_error_check_version ("15"))
+ {
+ fprintf (stderr, "%s: gpg_error_check_version did not return an error"
+ " for a newer version\n", logpfx);
+ errorcount++;
+ }
+ if (verbose || errorcount)
+ {
+ printf ("Version from header: %s (0x%06x)\n",
+ GPG_ERROR_VERSION, GPG_ERROR_VERSION_NUMBER);
+ printf ("Version from binary: %s\n", gpg_error_check_version (NULL));
+ printf ("Copyright blurb ...:%s\n", gpg_error_check_version ("\x01\x01"));
+ }
+
+ return errorcount ? 1 : 0;
+}