summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPiotr Pawlow <pp@siedziba.pl>2014-03-13 20:51:31 +0100
committerPiotr Pawlow <pp@siedziba.pl>2014-03-13 20:51:31 +0100
commitc04af18902322cea1bd05b6f01b7860ca7bfa432 (patch)
treed8d3f812112c0cc835fd29e68d92e297e0164b52
- import version 0.9.1 from upstream
-rw-r--r--ABOUT-NLS996
-rw-r--r--AUTHORS2
-rw-r--r--COPYING340
-rw-r--r--ChangeLog126
-rw-r--r--INSTALL239
-rw-r--r--MAINTAINERS2
-rw-r--r--Makefile.am45
-rw-r--r--NEWS96
-rw-r--r--README295
-rw-r--r--THANKS4
-rw-r--r--TODO0
-rw-r--r--acinclude.m41
-rwxr-xr-xconfig.guess1526
-rw-r--r--config.h.in107
-rwxr-xr-xconfig.sub1658
-rw-r--r--configure.in157
-rwxr-xr-xdepcomp530
-rwxr-xr-xinstall-sh323
-rw-r--r--intltool-extract.in0
-rw-r--r--intltool-merge.in0
-rw-r--r--intltool-update.in0
-rw-r--r--lingot.desktop.in9
-rwxr-xr-xltmain.sh9642
-rwxr-xr-xmissing360
-rwxr-xr-xmkinstalldirs162
-rw-r--r--pixmaps/Makefile.am12
-rw-r--r--pixmaps/lingot-icon.svg284
-rw-r--r--po/ChangeLog23
-rw-r--r--po/LINGUAS10
-rw-r--r--po/Makefile.in.in217
-rw-r--r--po/POTFILES.in26
-rw-r--r--po/ca.po702
-rw-r--r--po/cs.po698
-rw-r--r--po/de.po689
-rw-r--r--po/es.po794
-rw-r--r--po/fr.po682
-rw-r--r--po/gl.po790
-rw-r--r--po/it.po694
-rw-r--r--po/pt_BR.po697
-rw-r--r--po/sv.po692
-rw-r--r--po/zh_CN.po700
-rw-r--r--src/Makefile.am55
-rw-r--r--src/glade/Makefile.am8
-rw-r--r--src/glade/lingot-config-dialog.glade1085
-rw-r--r--src/glade/lingot-mainframe.glade273
-rw-r--r--src/lingot-audio-alsa.c205
-rw-r--r--src/lingot-audio-alsa.h34
-rw-r--r--src/lingot-audio-jack.c349
-rw-r--r--src/lingot-audio-jack.h36
-rw-r--r--src/lingot-audio-oss.c168
-rw-r--r--src/lingot-audio-oss.h34
-rw-r--r--src/lingot-audio.c208
-rw-r--r--src/lingot-audio.h109
-rw-r--r--src/lingot-background.xpm201
-rw-r--r--src/lingot-complex.c71
-rw-r--r--src/lingot-complex.h44
-rw-r--r--src/lingot-config-scale.c255
-rw-r--r--src/lingot-config-scale.h52
-rw-r--r--src/lingot-config.c458
-rw-r--r--src/lingot-config.h123
-rw-r--r--src/lingot-core.c535
-rw-r--r--src/lingot-core.h92
-rw-r--r--src/lingot-defs.h67
-rw-r--r--src/lingot-fft.c167
-rw-r--r--src/lingot-fft.h51
-rw-r--r--src/lingot-filter.c243
-rw-r--r--src/lingot-filter.h65
-rw-r--r--src/lingot-gauge.c91
-rw-r--r--src/lingot-gauge.h45
-rw-r--r--src/lingot-gui-config-dialog-scale.c671
-rw-r--r--src/lingot-gui-config-dialog-scale.h47
-rw-r--r--src/lingot-gui-config-dialog.c435
-rw-r--r--src/lingot-gui-config-dialog.h73
-rw-r--r--src/lingot-gui-mainframe.c861
-rw-r--r--src/lingot-gui-mainframe.h81
-rw-r--r--src/lingot-i18n.h41
-rw-r--r--src/lingot-logo.xpm364
-rw-r--r--src/lingot-msg.c91
-rw-r--r--src/lingot-msg.h42
-rw-r--r--src/lingot-signal.c165
-rw-r--r--src/lingot-signal.h48
-rw-r--r--src/lingot.c149
82 files changed, 32522 insertions, 0 deletions
diff --git a/ABOUT-NLS b/ABOUT-NLS
new file mode 100644
index 0000000..e32d52d
--- /dev/null
+++ b/ABOUT-NLS
@@ -0,0 +1,996 @@
+1 Notes on the Free Translation Project
+***************************************
+
+Free software is going international! The Free Translation Project is
+a way to get maintainers of free software, translators, and users all
+together, so that free software will gradually become able to speak many
+languages. A few packages already provide translations for their
+messages.
+
+ If you found this `ABOUT-NLS' file inside a distribution, you may
+assume that the distributed package does use GNU `gettext' internally,
+itself available at your nearest GNU archive site. But you do _not_
+need to install GNU `gettext' prior to configuring, installing or using
+this package with messages translated.
+
+ Installers will find here some useful hints. These notes also
+explain how users should proceed for getting the programs to use the
+available translations. They tell how people wanting to contribute and
+work on translations can contact the appropriate team.
+
+ When reporting bugs in the `intl/' directory or bugs which may be
+related to internationalization, you should tell about the version of
+`gettext' which is used. The information can be found in the
+`intl/VERSION' file, in internationalized packages.
+
+1.1 Quick configuration advice
+==============================
+
+If you want to exploit the full power of internationalization, you
+should configure it using
+
+ ./configure --with-included-gettext
+
+to force usage of internationalizing routines provided within this
+package, despite the existence of internationalizing capabilities in the
+operating system where this package is being installed. So far, only
+the `gettext' implementation in the GNU C library version 2 provides as
+many features (such as locale alias, message inheritance, automatic
+charset conversion or plural form handling) as the implementation here.
+It is also not possible to offer this additional functionality on top
+of a `catgets' implementation. Future versions of GNU `gettext' will
+very likely convey even more functionality. So it might be a good idea
+to change to GNU `gettext' as soon as possible.
+
+ So you need _not_ provide this option if you are using GNU libc 2 or
+you have installed a recent copy of the GNU gettext package with the
+included `libintl'.
+
+1.2 INSTALL Matters
+===================
+
+Some packages are "localizable" when properly installed; the programs
+they contain can be made to speak your own native language. Most such
+packages use GNU `gettext'. Other packages have their own ways to
+internationalization, predating GNU `gettext'.
+
+ By default, this package will be installed to allow translation of
+messages. It will automatically detect whether the system already
+provides the GNU `gettext' functions. If not, the included GNU
+`gettext' library will be used. This library is wholly contained
+within this package, usually in the `intl/' subdirectory, so prior
+installation of the GNU `gettext' package is _not_ required.
+Installers may use special options at configuration time for changing
+the default behaviour. The commands:
+
+ ./configure --with-included-gettext
+ ./configure --disable-nls
+
+will, respectively, bypass any pre-existing `gettext' to use the
+internationalizing routines provided within this package, or else,
+_totally_ disable translation of messages.
+
+ When you already have GNU `gettext' installed on your system and run
+configure without an option for your new package, `configure' will
+probably detect the previously built and installed `libintl.a' file and
+will decide to use this. This might not be desirable. You should use
+the more recent version of the GNU `gettext' library. I.e. if the file
+`intl/VERSION' shows that the library which comes with this package is
+more recent, you should use
+
+ ./configure --with-included-gettext
+
+to prevent auto-detection.
+
+ The configuration process will not test for the `catgets' function
+and therefore it will not be used. The reason is that even an
+emulation of `gettext' on top of `catgets' could not provide all the
+extensions of the GNU `gettext' library.
+
+ Internationalized packages usually have many `po/LL.po' files, where
+LL gives an ISO 639 two-letter code identifying the language. Unless
+translations have been forbidden at `configure' time by using the
+`--disable-nls' switch, all available translations are installed
+together with the package. However, the environment variable `LINGUAS'
+may be set, prior to configuration, to limit the installed set.
+`LINGUAS' should then contain a space separated list of two-letter
+codes, stating which languages are allowed.
+
+1.3 Using This Package
+======================
+
+As a user, if your language has been installed for this package, you
+only have to set the `LANG' environment variable to the appropriate
+`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code,
+and `CC' is an ISO 3166 two-letter country code. For example, let's
+suppose that you speak German and live in Germany. At the shell
+prompt, merely execute `setenv LANG de_DE' (in `csh'),
+`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
+This can be done from your `.login' or `.profile' file, once and for
+all.
+
+ You might think that the country code specification is redundant.
+But in fact, some languages have dialects in different countries. For
+example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
+country code serves to distinguish the dialects.
+
+ The locale naming convention of `LL_CC', with `LL' denoting the
+language and `CC' denoting the country, is the one use on systems based
+on GNU libc. On other systems, some variations of this scheme are
+used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
+locales supported by your system for your country by running the command
+`locale -a | grep '^LL''.
+
+ Not all programs have translations for all languages. By default, an
+English message is shown in place of a nonexistent translation. If you
+understand other languages, you can set up a priority list of languages.
+This is done through a different environment variable, called
+`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
+for the purpose of message handling, but you still need to have `LANG'
+set to the primary language; this is required by other parts of the
+system libraries. For example, some Swedish users who would rather
+read translations in German than English for when Swedish is not
+available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
+
+ Special advice for Norwegian users: The language code for Norwegian
+bokma*l changed from `no' to `nb' recently (in 2003). During the
+transition period, while some message catalogs for this language are
+installed under `nb' and some older ones under `no', it's recommended
+for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
+older translations are used.
+
+ In the `LANGUAGE' environment variable, but not in the `LANG'
+environment variable, `LL_CC' combinations can be abbreviated as `LL'
+to denote the language's main dialect. For example, `de' is equivalent
+to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
+(Portuguese as spoken in Portugal) in this context.
+
+1.4 Translating Teams
+=====================
+
+For the Free Translation Project to be a success, we need interested
+people who like their own language and write it well, and who are also
+able to synergize with other translators speaking the same language.
+Each translation team has its own mailing list. The up-to-date list of
+teams can be found at the Free Translation Project's homepage,
+`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
+area.
+
+ If you'd like to volunteer to _work_ at translating messages, you
+should become a member of the translating team for your own language.
+The subscribing address is _not_ the same as the list itself, it has
+`-request' appended. For example, speakers of Swedish can send a
+message to `sv-request@li.org', having this message body:
+
+ subscribe
+
+ Keep in mind that team members are expected to participate
+_actively_ in translations, or at solving translational difficulties,
+rather than merely lurking around. If your team does not exist yet and
+you want to start one, or if you are unsure about what to do or how to
+get started, please write to `translation@iro.umontreal.ca' to reach the
+coordinator for all translator teams.
+
+ The English team is special. It works at improving and uniformizing
+the terminology in use. Proven linguistic skill are praised more than
+programming skill, here.
+
+1.5 Available Packages
+======================
+
+Languages are not equally supported in all packages. The following
+matrix shows the current state of internationalization, as of May 2005.
+The matrix shows, in regard of each package, for which languages PO
+files have been submitted to translation coordination, with a
+translation percentage of at least 50%.
+
+ Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB
+ +-------------------------------------------------+
+ GNUnet | |
+ a2ps | [] [] [] [] [] |
+ aegis | () |
+ ant-phone | () |
+ anubis | [] |
+ ap-utils | |
+ aspell | [] [] [] [] |
+ bash | [] [] |
+ batchelor | [] |
+ bfd | |
+ bibshelf | [] |
+ binutils | [] |
+ bison | [] [] |
+ bluez-pin | [] [] [] [] |
+ clisp | [] [] |
+ console-tools | [] [] |
+ coreutils | [] [] [] [] |
+ cpio | |
+ cpplib | [] [] [] |
+ darkstat | [] () [] |
+ dialog | [] [] [] [] [] [] |
+ diffutils | [] [] [] [] [] |
+ doodle | [] |
+ e2fsprogs | [] [] |
+ enscript | [] [] [] [] |
+ error | [] [] [] [] |
+ fetchmail | [] [] () [] |
+ fileutils | [] [] |
+ findutils | [] [] [] |
+ flex | [] [] [] |
+ fslint | [] |
+ gas | |
+ gawk | [] [] [] |
+ gbiff | [] |
+ gcal | [] |
+ gcc | [] |
+ gettext-examples | [] [] [] [] |
+ gettext-runtime | [] [] [] [] |
+ gettext-tools | [] [] |
+ gimp-print | [] [] [] [] |
+ gip | |
+ gliv | [] |
+ glunarclock | |
+ gmult | [] [] |
+ gnubiff | () |
+ gnucash | [] () () [] |
+ gnucash-glossary | [] () |
+ gpe-aerial | [] [] |
+ gpe-beam | [] [] |
+ gpe-calendar | [] [] |
+ gpe-clock | [] [] |
+ gpe-conf | [] [] |
+ gpe-contacts | |
+ gpe-edit | [] |
+ gpe-go | [] |
+ gpe-login | [] [] |
+ gpe-ownerinfo | [] [] |
+ gpe-sketchbook | [] [] |
+ gpe-su | [] [] |
+ gpe-taskmanager | [] [] |
+ gpe-timesheet | [] |
+ gpe-today | [] [] |
+ gpe-todo | [] [] |
+ gphoto2 | [] [] [] [] |
+ gprof | [] [] |
+ gpsdrive | () () |
+ gramadoir | [] [] |
+ grep | [] [] [] [] [] [] |
+ gretl | |
+ gsasl | [] |
+ gss | |
+ gst-plugins | [] [] [] [] [] [] |
+ gstreamer | [] [] [] [] [] |
+ gtick | [] () |
+ gtkspell | [] [] [] |
+ hello | [] [] [] [] |
+ id-utils | [] [] |
+ impost | |
+ indent | [] [] |
+ iso_3166 | |
+ iso_3166_1 | [] [] [] [] [] |
+ iso_3166_2 | |
+ iso_3166_3 | [] |
+ iso_4217 | |
+ iso_639 | |
+ jpilot | [] |
+ jtag | |
+ jwhois | |
+ kbd | [] [] [] [] |
+ latrine | () |
+ ld | [] |
+ libc | [] [] [] [] [] |
+ libextractor | |
+ libgpewidget | [] [] [] |
+ libgphoto2 | [] |
+ libgphoto2_port | [] |
+ libgsasl | |
+ libiconv | [] [] [] [] [] |
+ libidn | |
+ lifelines | [] () |
+ lilypond | [] |
+ lingoteach | |
+ lynx | [] [] [] [] |
+ m4 | [] [] [] [] |
+ mailutils | [] |
+ make | [] [] |
+ man-db | [] () [] [] |
+ minicom | [] [] |
+ mysecretdiary | [] [] |
+ nano | [] () [] |
+ nano_1_0 | [] () [] [] |
+ opcodes | [] |
+ parted | [] [] [] [] |
+ psmisc | |
+ ptx | [] [] [] |
+ pwdutils | |
+ python | |
+ radius | [] |
+ recode | [] [] [] [] [] |
+ rpm | [] [] |
+ screem | |
+ scrollkeeper | [] [] [] [] [] [] [] [] |
+ sed | [] [] |
+ sh-utils | [] [] |
+ shared-mime-info | [] [] |
+ sharutils | [] [] [] [] [] |
+ silky | |
+ skencil | [] () |
+ sketch | [] () |
+ solfege | [] |
+ soundtracker | [] [] |
+ sp | [] |
+ stardict | [] |
+ tar | |
+ texinfo | [] [] |
+ textutils | [] [] [] |
+ tin | () () |
+ tp-robot | [] |
+ tuxpaint | [] [] [] [] [] [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux | [] [] [] [] |
+ vorbis-tools | [] [] [] [] |
+ wastesedge | () |
+ wdiff | [] [] [] [] |
+ wget | |
+ xchat | [] [] [] [] [] |
+ xkeyboard-config | |
+ xpad | |
+ +-------------------------------------------------+
+ af am ar az be bg bs ca cs cy da de el en en_GB
+ 10 0 0 2 7 5 0 40 43 2 51 91 19 1 14
+
+ eo es et eu fa fi fr ga gl he hi hr hu id is
+ +-----------------------------------------------+
+ GNUnet | |
+ a2ps | [] [] [] |
+ aegis | |
+ ant-phone | [] |
+ anubis | [] |
+ ap-utils | [] |
+ aspell | [] [] |
+ bash | [] [] [] [] |
+ batchelor | [] [] |
+ bfd | [] |
+ bibshelf | [] [] |
+ binutils | [] [] |
+ bison | [] [] [] [] [] |
+ bluez-pin | [] [] [] [] [] [] |
+ clisp | [] [] |
+ console-tools | |
+ coreutils | [] [] [] [] [] |
+ cpio | [] [] |
+ cpplib | [] [] |
+ darkstat | [] () [] [] [] |
+ dialog | [] [] [] [] [] [] [] |
+ diffutils | [] [] [] [] [] [] [] [] [] |
+ doodle | [] |
+ e2fsprogs | [] [] |
+ enscript | [] [] |
+ error | [] [] [] [] [] |
+ fetchmail | [] |
+ fileutils | [] [] [] [] [] |
+ findutils | [] [] [] [] |
+ flex | [] [] [] |
+ fslint | [] |
+ gas | [] [] |
+ gawk | [] [] [] [] |
+ gbiff | [] |
+ gcal | [] [] |
+ gcc | [] |
+ gettext-examples | [] [] [] |
+ gettext-runtime | [] [] [] [] [] |
+ gettext-tools | [] [] |
+ gimp-print | [] [] |
+ gip | [] [] [] |
+ gliv | () |
+ glunarclock | [] [] [] |
+ gmult | [] [] |
+ gnubiff | () |
+ gnucash | [] () |
+ gnucash-glossary | [] |
+ gpe-aerial | [] [] |
+ gpe-beam | [] [] |
+ gpe-calendar | [] [] [] [] |
+ gpe-clock | [] [] [] |
+ gpe-conf | [] |
+ gpe-contacts | [] |
+ gpe-edit | [] [] |
+ gpe-go | [] [] |
+ gpe-login | [] [] [] |
+ gpe-ownerinfo | [] [] [] [] [] |
+ gpe-sketchbook | [] [] |
+ gpe-su | [] [] [] |
+ gpe-taskmanager | [] [] [] |
+ gpe-timesheet | [] [] [] [] |
+ gpe-today | [] [] [] [] |
+ gpe-todo | [] [] [] |
+ gphoto2 | [] [] [] [] |
+ gprof | [] [] [] |
+ gpsdrive | () () [] |
+ gramadoir | [] [] |
+ grep | [] [] [] [] [] [] [] [] [] [] [] |
+ gretl | [] [] |
+ gsasl | [] [] [] |
+ gss | [] |
+ gst-plugins | [] [] |
+ gstreamer | |
+ gtick | [] [] [] [] |
+ gtkspell | [] [] [] [] [] |
+ hello | [] [] [] [] [] [] [] [] [] [] [] [] [] |
+ id-utils | [] [] [] |
+ impost | [] [] |
+ indent | [] [] [] [] [] [] [] [] [] [] |
+ iso_3166 | [] [] [] |
+ iso_3166_1 | [] [] [] [] [] [] [] |
+ iso_3166_2 | [] |
+ iso_3166_3 | [] |
+ iso_4217 | [] [] [] |
+ iso_639 | [] [] [] [] |
+ jpilot | [] [] |
+ jtag | [] |
+ jwhois | [] [] [] [] |
+ kbd | [] [] |
+ latrine | [] [] |
+ ld | [] [] |
+ libc | [] [] [] [] [] |
+ libextractor | |
+ libgpewidget | [] [] [] [] [] |
+ libgphoto2 | [] [] [] |
+ libgphoto2_port | [] |
+ libgsasl | [] [] |
+ libiconv | [] [] [] [] [] [] [] [] [] [] |
+ libidn | [] [] |
+ lifelines | () |
+ lilypond | |
+ lingoteach | [] [] |
+ lynx | [] [] |
+ m4 | [] [] [] [] |
+ mailutils | [] [] |
+ make | [] [] [] [] [] [] [] |
+ man-db | () |
+ minicom | [] [] [] [] |
+ mysecretdiary | [] [] [] |
+ nano | [] [] () [] |
+ nano_1_0 | [] [] [] [] |
+ opcodes | [] [] [] |
+ parted | [] [] [] |
+ psmisc | [] |
+ ptx | [] [] [] [] [] [] [] [] [] |
+ pwdutils | |
+ python | |
+ radius | [] [] |
+ recode | [] [] [] [] [] [] [] |
+ rpm | [] |
+ screem | |
+ scrollkeeper | [] [] [] |
+ sed | [] [] [] [] [] [] |
+ sh-utils | [] [] [] [] [] [] |
+ shared-mime-info | [] [] [] [] [] [] |
+ sharutils | [] [] [] [] [] [] |
+ silky | [] |
+ skencil | [] [] |
+ sketch | [] [] |
+ solfege | |
+ soundtracker | [] [] |
+ sp | [] |
+ stardict | [] |
+ tar | [] [] [] [] |
+ texinfo | [] [] [] |
+ textutils | [] [] [] [] [] |
+ tin | [] () |
+ tp-robot | [] [] |
+ tuxpaint | [] [] [] [] [] [] [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | [] [] |
+ util-linux | [] [] [] [] [] |
+ vorbis-tools | [] [] |
+ wastesedge | () |
+ wdiff | [] [] [] [] [] [] [] |
+ wget | [] [] [] [] |
+ xchat | [] [] [] [] [] |
+ xkeyboard-config | |
+ xpad | [] [] [] |
+ +-----------------------------------------------+
+ eo es et eu fa fi fr ga gl he hi hr hu id is
+ 15 85 21 15 2 35 115 45 16 8 1 6 40 27 1
+
+ it ja ko ku lg lt lv mk mn ms mt nb nl nn no nso
+ +--------------------------------------------------+
+ GNUnet | |
+ a2ps | () () [] [] () |
+ aegis | () |
+ ant-phone | [] |
+ anubis | [] [] [] |
+ ap-utils | |
+ aspell | [] [] |
+ bash | [] |
+ batchelor | [] |
+ bfd | |
+ bibshelf | [] |
+ binutils | |
+ bison | [] [] [] [] |
+ bluez-pin | [] [] |
+ clisp | [] |
+ console-tools | |
+ coreutils | [] [] |
+ cpio | |
+ cpplib | [] |
+ darkstat | [] [] |
+ dialog | [] [] |
+ diffutils | [] [] [] [] |
+ doodle | [] |
+ e2fsprogs | [] |
+ enscript | [] |
+ error | [] |
+ fetchmail | [] [] |
+ fileutils | [] [] [] |
+ findutils | [] [] |
+ flex | [] [] |
+ fslint | [] |
+ gas | |
+ gawk | [] [] |
+ gbiff | [] |
+ gcal | |
+ gcc | |
+ gettext-examples | [] [] [] |
+ gettext-runtime | [] [] [] [] |
+ gettext-tools | [] [] [] |
+ gimp-print | [] [] |
+ gip | [] |
+ gliv | [] |
+ glunarclock | [] [] |
+ gmult | [] [] |
+ gnubiff | () |
+ gnucash | [] () () [] |
+ gnucash-glossary | [] [] |
+ gpe-aerial | [] |
+ gpe-beam | [] |
+ gpe-calendar | [] |
+ gpe-clock | [] |
+ gpe-conf | [] |
+ gpe-contacts | |
+ gpe-edit | [] |
+ gpe-go | [] |
+ gpe-login | [] |
+ gpe-ownerinfo | [] |
+ gpe-sketchbook | [] |
+ gpe-su | [] |
+ gpe-taskmanager | [] [] |
+ gpe-timesheet | [] |
+ gpe-today | [] |
+ gpe-todo | [] |
+ gphoto2 | [] [] [] |
+ gprof | |
+ gpsdrive | () () () () |
+ gramadoir | () |
+ grep | [] [] [] [] |
+ gretl | [] |
+ gsasl | [] |
+ gss | |
+ gst-plugins | [] [] |
+ gstreamer | [] [] |
+ gtick | [] [] |
+ gtkspell | [] [] [] |
+ hello | [] [] [] [] [] [] [] [] [] |
+ id-utils | [] [] |
+ impost | |
+ indent | [] [] [] |
+ iso_3166 | [] |
+ iso_3166_1 | [] [] |
+ iso_3166_2 | [] |
+ iso_3166_3 | [] |
+ iso_4217 | [] [] [] |
+ iso_639 | [] [] [] |
+ jpilot | () () () |
+ jtag | |
+ jwhois | [] [] |
+ kbd | [] |
+ latrine | [] [] |
+ ld | |
+ libc | [] [] [] [] [] |
+ libextractor | |
+ libgpewidget | [] |
+ libgphoto2 | [] [] |
+ libgphoto2_port | [] [] |
+ libgsasl | [] |
+ libiconv | [] [] |
+ libidn | [] |
+ lifelines | [] |
+ lilypond | |
+ lingoteach | [] [] |
+ lynx | [] [] [] |
+ m4 | [] [] |
+ mailutils | |
+ make | [] [] [] |
+ man-db | () |
+ minicom | [] |
+ mysecretdiary | [] |
+ nano | [] [] [] |
+ nano_1_0 | [] [] [] [] |
+ opcodes | [] |
+ parted | [] [] [] [] |
+ psmisc | [] [] [] |
+ ptx | [] [] [] |
+ pwdutils | |
+ python | |
+ radius | |
+ recode | [] [] |
+ rpm | [] [] |
+ screem | [] |
+ scrollkeeper | [] [] [] |
+ sed | [] [] |
+ sh-utils | [] [] [] |
+ shared-mime-info | [] [] [] [] |
+ sharutils | [] [] [] |
+ silky | [] |
+ skencil | |
+ sketch | |
+ solfege | [] [] [] |
+ soundtracker | [] |
+ sp | () |
+ stardict | [] [] |
+ tar | [] [] [] |
+ texinfo | [] [] [] |
+ textutils | [] [] [] |
+ tin | |
+ tp-robot | [] |
+ tuxpaint | [] [] [] [] [] [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux | [] [] [] |
+ vorbis-tools | [] |
+ wastesedge | [] |
+ wdiff | [] [] [] |
+ wget | [] |
+ xchat | [] [] [] [] [] |
+ xkeyboard-config | [] |
+ xpad | [] |
+ +--------------------------------------------------+
+ it ja ko ku lg lt lv mk mn ms mt nb nl nn no nso
+ 46 35 11 2 1 1 2 2 3 11 0 15 96 7 5 0
+
+ or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv
+ +----------------------------------------------+
+ GNUnet | |
+ a2ps | () [] [] [] [] [] [] |
+ aegis | () () |
+ ant-phone | [] |
+ anubis | [] [] [] |
+ ap-utils | () |
+ aspell | [] [] |
+ bash | [] [] [] |
+ batchelor | [] |
+ bfd | |
+ bibshelf | |
+ binutils | [] [] |
+ bison | [] [] [] [] [] |
+ bluez-pin | [] [] [] [] [] [] [] [] |
+ clisp | [] |
+ console-tools | [] |
+ coreutils | [] [] [] [] |
+ cpio | [] [] |
+ cpplib | |
+ darkstat | [] [] [] [] [] [] |
+ dialog | [] [] [] [] [] [] [] |
+ diffutils | [] [] [] [] [] [] |
+ doodle | [] |
+ e2fsprogs | [] [] |
+ enscript | [] [] [] [] |
+ error | [] [] [] |
+ fetchmail | [] [] [] [] |
+ fileutils | [] [] [] [] [] |
+ findutils | [] [] [] [] [] [] |
+ flex | [] [] [] [] [] |
+ fslint | [] [] [] |
+ gas | |
+ gawk | [] [] [] [] |
+ gbiff | [] |
+ gcal | [] |
+ gcc | |
+ gettext-examples | [] [] [] [] [] [] |
+ gettext-runtime | [] [] [] [] [] [] [] |
+ gettext-tools | [] [] [] [] [] [] [] |
+ gimp-print | [] [] |
+ gip | [] [] [] |
+ gliv | [] [] [] |
+ glunarclock | [] [] [] [] [] [] |
+ gmult | [] [] [] [] |
+ gnubiff | () [] |
+ gnucash | () [] [] [] [] |
+ gnucash-glossary | [] [] [] |
+ gpe-aerial | [] [] [] [] [] [] |
+ gpe-beam | [] [] [] [] [] [] |
+ gpe-calendar | [] [] [] [] [] [] [] |
+ gpe-clock | [] [] [] [] [] [] [] |
+ gpe-conf | [] [] [] [] [] [] |
+ gpe-contacts | [] [] [] [] |
+ gpe-edit | [] [] [] [] [] [] [] |
+ gpe-go | [] [] [] [] [] |
+ gpe-login | [] [] [] [] [] [] [] |
+ gpe-ownerinfo | [] [] [] [] [] [] [] |
+ gpe-sketchbook | [] [] [] [] [] [] [] |
+ gpe-su | [] [] [] [] [] [] [] |
+ gpe-taskmanager | [] [] [] [] [] [] [] |
+ gpe-timesheet | [] [] [] [] [] [] [] |
+ gpe-today | [] [] [] [] [] [] [] |
+ gpe-todo | [] [] [] [] [] [] [] [] |
+ gphoto2 | [] [] [] [] |
+ gprof | [] [] [] |
+ gpsdrive | [] [] |
+ gramadoir | [] |
+ grep | [] [] [] [] [] [] [] |
+ gretl | [] |
+ gsasl | [] [] [] [] [] |
+ gss | [] [] [] |
+ gst-plugins | [] [] [] [] |
+ gstreamer | [] [] [] [] |
+ gtick | [] [] [] |
+ gtkspell | [] [] [] [] [] [] |
+ hello | [] [] [] [] [] [] [] |
+ id-utils | [] [] [] [] |
+ impost | |
+ indent | [] [] [] [] [] [] |
+ iso_3166 | [] [] [] [] [] |
+ iso_3166_1 | [] [] [] [] |
+ iso_3166_2 | |
+ iso_3166_3 | [] [] [] |
+ iso_4217 | [] [] |
+ iso_639 | [] [] [] |
+ jpilot | |
+ jtag | [] |
+ jwhois | [] [] [] () () |
+ kbd | [] [] [] |
+ latrine | [] [] |
+ ld | [] |
+ libc | [] [] [] [] [] |
+ libextractor | [] |
+ libgpewidget | [] [] [] [] [] [] |
+ libgphoto2 | [] [] |
+ libgphoto2_port | [] |
+ libgsasl | [] [] [] |
+ libiconv | [] [] [] [] [] [] [] [] [] [] |
+ libidn | [] () |
+ lifelines | [] [] |
+ lilypond | |
+ lingoteach | [] |
+ lynx | [] [] [] |
+ m4 | [] [] [] [] [] |
+ mailutils | [] [] [] |
+ make | [] [] [] [] |
+ man-db | [] [] |
+ minicom | [] [] [] [] |
+ mysecretdiary | [] [] [] [] |
+ nano | [] [] [] |
+ nano_1_0 | [] [] [] [] |
+ opcodes | [] [] |
+ parted | [] [] [] [] |
+ psmisc | [] [] |
+ ptx | [] [] [] [] [] [] |
+ pwdutils | [] |
+ python | |
+ radius | [] [] |
+ recode | [] [] [] [] [] [] |
+ rpm | [] [] [] [] |
+ screem | |
+ scrollkeeper | [] [] [] [] [] [] [] |
+ sed | [] [] [] [] [] [] [] [] |
+ sh-utils | [] [] [] |
+ shared-mime-info | [] [] [] [] [] [] |
+ sharutils | [] [] [] |
+ silky | [] |
+ skencil | [] [] [] |
+ sketch | [] [] [] |
+ solfege | |
+ soundtracker | [] [] |
+ sp | |
+ stardict | [] [] |
+ tar | [] [] [] [] |
+ texinfo | [] [] [] [] |
+ textutils | [] [] [] |
+ tin | |
+ tp-robot | [] |
+ tuxpaint | [] [] [] [] [] [] [] [] |
+ unicode-han-tra... | |
+ unicode-transla... | |
+ util-linux | [] [] [] |
+ vorbis-tools | [] [] |
+ wastesedge | |
+ wdiff | [] [] [] [] [] [] |
+ wget | |
+ xchat | [] [] [] [] [] [] [] |
+ xkeyboard-config | |
+ xpad | |
+ +----------------------------------------------+
+ or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv
+ 1 3 47 29 57 6 78 73 5 44 12 12 50 85
+
+ ta tg th tk tr uk ven vi wa xh zh_CN zh_TW zu
+ +-----------------------------------------------+
+ GNUnet | | 0
+ a2ps | [] [] [] | 19
+ aegis | | 0
+ ant-phone | [] [] | 5
+ anubis | [] [] [] | 11
+ ap-utils | () [] | 2
+ aspell | [] [] [] | 13
+ bash | [] | 11
+ batchelor | [] [] | 7
+ bfd | | 1
+ bibshelf | [] | 5
+ binutils | [] | 6
+ bison | [] [] | 18
+ bluez-pin | [] [] [] [] [] | 25
+ clisp | | 7
+ console-tools | [] [] | 5
+ coreutils | [] [] | 17
+ cpio | [] [] [] | 7
+ cpplib | [] [] | 8
+ darkstat | [] () () | 15
+ dialog | [] [] [] | 25
+ diffutils | [] [] [] [] | 28
+ doodle | [] | 5
+ e2fsprogs | [] | 8
+ enscript | [] | 12
+ error | [] [] [] | 16
+ fetchmail | [] | 12
+ fileutils | [] [] [] | 18
+ findutils | [] [] | 17
+ flex | [] [] | 15
+ fslint | [] | 7
+ gas | [] | 3
+ gawk | [] | 14
+ gbiff | [] | 5
+ gcal | [] | 5
+ gcc | [] [] | 4
+ gettext-examples | [] [] [] [] [] | 21
+ gettext-runtime | [] [] [] [] [] | 25
+ gettext-tools | [] [] [] [] [] | 19
+ gimp-print | [] | 11
+ gip | [] | 8
+ gliv | [] [] | 7
+ glunarclock | [] [] | 13
+ gmult | [] [] [] | 13
+ gnubiff | [] | 3
+ gnucash | () [] | 10
+ gnucash-glossary | [] [] | 9
+ gpe-aerial | [] [] | 13
+ gpe-beam | [] [] | 13
+ gpe-calendar | [] [] [] [] | 18
+ gpe-clock | [] [] [] [] | 17
+ gpe-conf | [] [] | 12
+ gpe-contacts | [] [] | 7
+ gpe-edit | [] [] [] [] | 15
+ gpe-go | [] [] | 11
+ gpe-login | [] [] [] [] [] | 18
+ gpe-ownerinfo | [] [] [] [] | 19
+ gpe-sketchbook | [] [] | 14
+ gpe-su | [] [] [] | 16
+ gpe-taskmanager | [] [] [] | 17
+ gpe-timesheet | [] [] [] [] | 17
+ gpe-today | [] [] [] [] [] | 19
+ gpe-todo | [] [] [] | 17
+ gphoto2 | [] [] [] | 18
+ gprof | [] [] | 10
+ gpsdrive | | 3
+ gramadoir | [] | 6
+ grep | [] [] [] [] | 32
+ gretl | | 4
+ gsasl | [] [] | 12
+ gss | [] | 5
+ gst-plugins | [] [] [] | 17
+ gstreamer | [] [] [] [] | 15
+ gtick | [] | 11
+ gtkspell | [] [] [] [] | 21
+ hello | [] [] [] [] | 37
+ id-utils | [] [] | 13
+ impost | [] | 3
+ indent | [] [] [] [] | 25
+ iso_3166 | [] [] [] | 12
+ iso_3166_1 | [] [] | 20
+ iso_3166_2 | | 2
+ iso_3166_3 | [] [] | 8
+ iso_4217 | [] [] | 10
+ iso_639 | [] [] | 12
+ jpilot | [] [] [] | 6
+ jtag | | 2
+ jwhois | [] [] [] | 12
+ kbd | [] [] | 12
+ latrine | [] [] | 8
+ ld | [] | 5
+ libc | [] [] | 22
+ libextractor | | 1
+ libgpewidget | [] [] | 17
+ libgphoto2 | [] | 9
+ libgphoto2_port | | 5
+ libgsasl | [] | 7
+ libiconv | [] [] [] [] [] | 32
+ libidn | [] [] | 6
+ lifelines | | 4
+ lilypond | | 1
+ lingoteach | [] | 6
+ lynx | [] [] [] | 15
+ m4 | [] [] | 17
+ mailutils | [] | 7
+ make | [] [] | 18
+ man-db | | 5
+ minicom | | 11
+ mysecretdiary | [] [] | 12
+ nano | [] [] | 13
+ nano_1_0 | [] [] [] | 18
+ opcodes | [] [] | 9
+ parted | [] [] [] | 18
+ psmisc | [] | 7
+ ptx | [] [] | 23
+ pwdutils | | 1
+ python | | 0
+ radius | [] | 6
+ recode | [] [] | 22
+ rpm | [] [] | 11
+ screem | | 1
+ scrollkeeper | [] [] [] | 24
+ sed | [] [] [] | 21
+ sh-utils | [] | 15
+ shared-mime-info | [] [] [] | 21
+ sharutils | [] [] [] | 20
+ silky | | 3
+ skencil | | 6
+ sketch | | 6
+ solfege | | 4
+ soundtracker | [] | 8
+ sp | [] | 3
+ stardict | [] [] [] [] | 10
+ tar | [] [] [] [] | 15
+ texinfo | [] [] | 14
+ textutils | [] [] [] | 17
+ tin | | 1
+ tp-robot | [] [] [] | 8
+ tuxpaint | [] [] [] [] | 34
+ unicode-han-tra... | | 0
+ unicode-transla... | | 2
+ util-linux | [] [] [] | 18
+ vorbis-tools | [] | 10
+ wastesedge | | 1
+ wdiff | [] [] | 22
+ wget | [] [] | 7
+ xchat | [] [] [] [] | 26
+ xkeyboard-config | [] | 2
+ xpad | [] | 5
+ +-----------------------------------------------+
+ 73 teams ta tg th tk tr uk ven vi wa xh zh_CN zh_TW zu
+ 149 domains 0 0 0 1 77 30 0 92 16 0 42 32 0 1746
+
+ Some counters in the preceding matrix are higher than the number of
+visible blocks let us expect. This is because a few extra PO files are
+used for implementing regional variants of languages, or language
+dialects.
+
+ For a PO file in the matrix above to be effective, the package to
+which it applies should also have been internationalized and
+distributed as such by its maintainer. There might be an observable
+lag between the mere existence a PO file and its wide availability in a
+distribution.
+
+ If May 2005 seems to be old, you may fetch a more recent copy of
+this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
+matrix with full percentage details can be found at
+`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
+
+1.6 Using `gettext' in new packages
+===================================
+
+If you are writing a freely available program and want to
+internationalize it you are welcome to use GNU `gettext' in your
+package. Of course you have to respect the GNU Library General Public
+License which covers the use of the GNU `gettext' library. This means
+in particular that even non-free programs can use `libintl' as a shared
+library, whereas only free software can use `libintl' as a static
+library or use modified versions of `libintl'.
+
+ Once the sources are changed appropriately and the setup can handle
+the use of `gettext' the only thing missing are the translations. The
+Free Translation Project is also available for packages which are not
+developed inside the GNU project. Therefore the information given above
+applies also for every other Free Software Project. Contact
+`translation@iro.umontreal.ca' to make the `.pot' files available to
+the translation teams.
+
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..374e64c
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,2 @@
+Ibán Cereijo Graña <ibancg at gmail com>
+Jairo Chapela Martínez <jairochapela at gmail com>
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/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..34a56de
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,126 @@
+
+2011-08-13 Ibán Cereijo <ibancg@gmail.com>
+
+ * Fixed bug #34007 (#637610 in debian).
+
+2011-03-11 Ibán Cereijo <ibancg@gmail.com>
+
+ * Fixed bug #33046 (#622038 in debian).
+ * Added 48K sample rate to OSS and ALSA.
+
+2011-02-21 Ibán Cereijo <ibancg@gmail.com>
+
+ * Fixed bug #31532.
+ * Added configuration file importation/exportation options from the GUI.
+ * Improved messages to the user.
+ * Added tooltips.
+ * Applied a blur effect over the gauge background image.
+ * Released Lingot 0.9.0
+
+
+2010-10-20 Ibán Cereijo <ibancg@gmail.com>
+
+ * Added sync between computation and read threads over the temporal buffer.
+ * The deviation value didn't work in version 0.8.2b2.
+ * Released Lingot 0.8.2b3.
+
+
+2010-10-18 Ibán Cereijo <ibancg@gmail.com>
+
+ * Fixed bug #31369
+ * Audio API is now transparent, providing the read thread.
+ * Improved error messages from audio device issues.
+ * Released Lingot 0.8.2b2
+
+
+2010-10-12 Ibán Cereijo <ibancg@gmail.com>
+
+ * Added different scales support.
+ + Scale edition in a cell table.
+ + Importation of Scala .scl files (http://www.huygens-fokker.org/scala/)
+ + The gauge adapts its range to the scale.
+ + The deviation control has been moved to the scale tab.
+ * The sample rate control has been changed to a GtkComboBoxEntry.
+ * When the sample rate is not available, the user is notified.
+ * Corrected some minor errors opening audio devices.
+ * Improved OSS error messages.
+ * Minor changes in the capture tab in the config dialog.
+ * lingot-error now supports multiple messages in the queue.
+ * Added some macros to simulate try/catch. Used in audio handling.
+ * The error dispatcher runs now under its own timer.
+ * Released Lingot 0.8.2b1
+
+
+2010-03-17 Ibán Cereijo <ibancg@gmail.com>
+
+ * Released Lingot 0.8.1
+
+
+2010-03-14 Ibán Cereijo <ibancg@gmail.com>
+
+ * Fixed a SIGSEGV in the JACK thread management (bug #29090).
+ * Fixed core hang up bug #29091 (#562425 in debian).
+ * Fixed https://bugzilla.redhat.com/show_bug.cgi?id=517970#c9
+ * Added a graphic controller for the MIN_FREQUENCY parameter.
+
+
+2010-02-26 Ibán Cereijo <ibancg@gmail.com>
+
+ * Released Lingot 0.8.0
+
+
+2010-02-23 Ibán Cereijo <ibancg@gmail.com>
+
+ * Added ALSA support
+ * Added translations: zh_CN, it
+ * Changed default sample rate to 44100 Hz
+
+
+2008-06-24 Ibán Cereijo <ibancg@gmail.com>
+
+ * Added JACK support
+ * Fixed memory leak in GUI
+ * Added translations: cs, sv, de, pt_BR
+ * Changed default sample rate to 11025 Hz instead of 8 KHz
+
+
+2007-12-26 Jairo Chapela-Martínez <jairochapela@gmail.com>
+
+ * Fixed some strange issues in the configuration scripts
+
+
+2008-12-23 Ibán Cereijo <ibancg@gmail.com>
+
+ * Fixed SIGSEGV bug #21850 (#425867 in debian).
+ * Released Lingot 0.7.6
+
+
+2008-12-18 Ibán Cereijo <ibancg@gmail.com>
+
+ * Released Lingot 0.7.5
+
+
+2007-08-30 Ibán Cereijo <ibancg@gmail.com>
+
+ * Added frequency legend, noise threshold and scroll bar to spectrum area
+ * Reorganized Menu Items
+ * Added a "View" menu item
+ * Added translations: gl
+
+
+2007-08-26 Ibán Cereijo <ibancg@gmail.com>
+
+ * Code refactoring: migration to C.
+ * Fixed exit SIGSEGV bug.
+ * Fixed extra thread bug.
+
+
+2007-08-23 Ibán Cereijo <ibancg@gmail.com>
+
+ * Changes in automake proccess.
+ * fixed charset problems in spanish translation
+ * Updated translations: es
+ * Renamed src/tuner.cc to src/lingot.cc
+ * Added resource src/lingot-i18n.h
+ * Changed ChangeLog and NEWS format
+ * Released Lingot 0.7.4
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..db288bd
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,239 @@
+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.
+
+`--enable-jack'
+ Provides JACK support
+
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
+
diff --git a/MAINTAINERS b/MAINTAINERS
new file mode 100644
index 0000000..374e64c
--- /dev/null
+++ b/MAINTAINERS
@@ -0,0 +1,2 @@
+Ibán Cereijo Graña <ibancg at gmail com>
+Jairo Chapela Martínez <jairochapela at gmail com>
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..e99f2b6
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,45 @@
+## Process this file with automake to produce Makefile.in
+## Created by Anjuta - will be overwritten
+## If you don't want it to overwrite it,
+## Please disable it in the Anjuta project configuration
+
+SUBDIRS = po src pixmaps
+
+lingotdocdir = ${docdir}
+lingotdoc_DATA = \
+ README\
+ COPYING\
+ AUTHORS\
+ ChangeLog\
+ INSTALL\
+ NEWS\
+ TODO\
+ THANKS\
+ MAINTAINERS\
+ src/lingot-background.xpm\
+ src/lingot-logo.xpm\
+ intltool-extract.in\
+ intltool-merge.in\
+ intltool-update.in
+
+EXTRA_DIST = $(lingotdoc_DATA)
+
+CLEANFILES =\
+ intltool-extract\
+ intltool-merge\
+ intltool-update
+
+gnomemenudir = $(prefix)/@NO_PREFIX_PACKAGE_MENU_DIR@
+gnomemenu_DATA = lingot.desktop
+
+
+
+# Copy all the spec files. Of cource, only one is actually used.
+dist-hook:
+ $(MAKE) -C "$(srcdir)/po" "$(GETTEXT_PACKAGE).pot"
+ cp "$(srcdir)/po/$(GETTEXT_PACKAGE).pot" "$(distdir)/po/"
+ for specfile in *.spec; do \
+ if test -f $$specfile; then \
+ cp -p $$specfile $(distdir); \
+ fi \
+ done
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..f2131ab
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,96 @@
+
+Lingot 0.9.0 (2011-02-21)
+-------------------------
+
+* Lingot is now an universal tuner, it can tune any instrument according to a
+ provided scale.
+ + Scale edition in a table.
+ + Importation of Scala .scl files (http://www.huygens-fokker.org/scala/)
+ + The gauge adapts its range to the scale.
+ + The deviation control has been moved to the scale tab.
+* Now it's possible to load and save configuration files from the GUI.
+* The graphic controllers in the audio capture section have been changed. The
+ user can choose now any hardware sampling rate, and is notified when the
+ rate is not available.
+* The GUI has been improved with tooltips and new notification messages.
+* Fixed bugs #31532 and #31369.
+
+
+Lingot 0.8.1 (2010-03-17)
+-------------------------
+
+* Added a graphic controller for the MIN_FREQUENCY parameter.
+* Fixed a SIGSEGV in the JACK thread management (bug #29090).
+* Fixed core hang up bug #29091 (#562425 in debian).
+* Fixed https://bugzilla.redhat.com/show_bug.cgi?id=517970#c9
+
+
+Lingot 0.8.0 (2010-02-26)
+-------------------------
+
+* Added JACK and ALSA support.
+* New configuration dialog layout.
+* Fixed memory leak in GUI.
+* Changed default sample rate to 44100 Hz instead of 8 KHz.
+* Added translations: cs, sv, de, it, pt_BR, zh_CN.
+
+
+Lingot 0.7.6 (2007-12-23)
+-------------------------
+
+* Fixed SEGFAULT bug on spectrum representation.
+* Changed Gnome menu ubication.
+
+
+Lingot 0.7.5 (2007-12-18)
+-------------------------
+
+* Now the spectrum section has a real grid, with axis labels referred to the
+ frequency and the signal power.
+* The spectrum section has also a dotted line indicating the noise threshold,
+ enabling a more accurate and easy manner of adjusting it.
+* There has been implemented some internal features, as internal computation of
+ filter coefficients and a Hamming window.
+* The source code has been "downgraded" from C++ to C as a first approach to
+ GNU coding standards.
+* Added Catalan translation, thanks to Raúl Cambeiro.
+
+
+Lingot 0.7.4 (2007-08-30)
+-------------------------
+
+* Added frequency legend, noise threshold and scroll bar to spectrum area
+* Reorganized Menu Items
+* Added a "View" menu item
+* Added translations: gl
+
+
+Lingot 0.7.4 (2007-08-23)
+-------------------------
+
+* Fixed UTF-8 charset problems
+* Added translations: es
+
+
+Lingot 0.7.3
+------------
+
+* Fixed two SIGSEGV bugs
+* Using GtkAboutDialog to show about info
+* Fixed size of the 'Note' frame on main window
+* Removed some gtk deprecated callings
+* Config dialog made more "GTK-compliant"
+
+
+Lingot 0.7.1
+------------
+
+* Files reorganized to a more "GNU-like" structure.
+* Added multilingual support
+
+
+Lingot 0.6.x
+------------
+
+* Start point.
+
diff --git a/README b/README
new file mode 100644
index 0000000..1184ddf
--- /dev/null
+++ b/README
@@ -0,0 +1,295 @@
+LINGOT - A musical instrument tuner.
+
+Written by:
+ Ibán Cereijo Graña <ibancg@gmail.com>
+ Jairo Chapela Martínez <jairochapela@gmail.com>
+
+Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez
+
+Description
+===========
+
+Lingot is a musical instrument tuner. It's accurate, easy to use, and highly
+configurable. Originally conceived to tune electric guitars, it can now be used
+to tune other instruments.
+
+It looks like an analog tuner, with a gauge indicating the relative shift to a
+certain note, found automatically as the closest note to the estimated frequency.
+
+
+Requisites
+==========
+
+ * Sound card.
+ * Linux kernel with audio support (OSS, ALSA, JACK).
+ * GTK+ library, version 2.0.
+
+Installation
+============
+
+ Type:
+
+ > configure
+ > make install
+
+ If you don't want ALSA or JACK support, use the options --enable-alsa=no and
+ --enable-jack=no in the configure script.
+
+ Please, see the INSTALL file.
+
+Synopsis
+========
+
+ lingot [-c config]
+
+The -c option causes the search of a file named {config}.conf in the ~/.lingot
+folder. For example:
+
+ lingot -c bass
+
+will take the configuration file ~/.lingot/bass.conf. This is useful for
+maintaining different configurations for different instruments. It's also
+possible to load and save configuration files from the GUI.
+
+Configuration file
+==================
+
+When lingot is launched, the configuration file ~/.lingot/lingot.conf will be
+created.
+
+The default values are optimized for electric guitar tuning, for other musical
+instruments these values must be slightly changed (a good practice would be
+to have a configuration file for each instrument). The options must be changed
+via GUI.
+
+There is a wide range of options, with the purpose of keeping the maximum
+configurability, and signal processing knowledge is needed for a good
+understanding of their effects.
+
+Next, we detail the main options that make up this file, and we recommend to
+make changes regarding the desired tuning precision and the demanded CPU time.
+If you don't understand the effects of any option, then just try different
+values or, even better, don't change it.
+
+
+ AUDIO_SYSTEM
+
+ Audio system switch. Possible values:
+
+ OSS
+ ALSA *
+ JACK
+
+ * default value
+
+
+ AUDIO_DEV (OSS sound device)
+
+ Selected sound device for the OSS audio system. The default value is
+ '/dev/dsp'.
+
+
+ AUDIO_DEV_ALSA (ALSA sound device)
+
+ Selected sound device for ALSA, the default value is 'plughw:0'.
+
+
+ SAMPLE_RATE ('physical' sampling rate)
+
+ With ALSA and OSS, the input signal will be sampled at this frequency by the
+ audio driver (in JACK, the sample rate is provided externally by the sound
+ server). Some cards don't support an arbitrary sampling rate, so we
+ recommend to choose one of the options that the GUI gives us, namely
+
+ 8000 Hz
+ 11025 Hz
+ 22050 Hz
+ 44100 Hz *
+
+ We will be able to find an effective sampling rate submultiple of this by
+ means of an oversampling factor.
+
+ In order to select a sampling rate, we must consider the maximum frequency
+ our instrument is able to produce (or the maximum one we want to tune), and
+ choose an effective sampling rate (already divided by the oversampling
+ factor) as, at least, the double of the former (Nyquist frequency). All the
+ spectral components over the half of the effective sampling rate will be
+ filtered out and they will not appear in the spectrum.
+
+ It must be an integer number, in Hertz.
+
+
+ OVERSAMPLING (oversampling factor)
+
+ The sampled signal will be decimated by this factor, producing the same
+ effect as if the sound card was using as sampling rate the effective
+ sampling rate f = SAMPLE_RATE/OVERSAMPLING.
+
+ For example, to obtain an effective sampling rate of 4 KHz (we can tune
+ tones up to 2 KHz), we can choose a sampling rate of 8 KHz and an
+ oversampling factor equals to 2, since 8 KHz / 2 = 4 KHz.
+
+ It must be an integer number, dimensionless. The default value is 25.
+
+
+ ROOT_FREQUENCY_ERROR ("A" reference note error)
+
+ This option is used when we want to tune with a certain amount of frequency
+ shift error.
+
+ This can be useful when tuning an instrument against a recording with a
+ shifted tuning. For example, if we hear an "A" note in a recording that
+ it's a quarter of a tone over the real note (440 Hz), we put here 50 cents
+ of error.
+
+ It must be a real number, expressed in cents. The default value is 0.
+
+
+ MIN_FREQUENCY (minimum valid frequency)
+
+ To avoid detecting the continuous component as the fundamental peak when
+ it has enough power, we consider a minimum valid frequency.
+
+ It must be a real number, in hertz. The default value is 15 Hz.
+
+
+ FFT_SIZE (Size of the FTT)
+
+ A high value gets more accuracy, especially more precision locking the
+ desired frequency, but it demands more CPU time.
+
+ We must consider the time interval involved on the calculus before
+ unnecessarily raising this value: having a buffer of 4096 samples for the
+ FFT, and a sampling rate of 8 KHz, each transform needs the last 512 ms
+ temporary values, so there is no point in putting a shorter temporal window.
+
+ Let's see a more extreme example:
+
+ Let us suppose we have an instrument able to generate low frequencies
+ (< 200 Hz), and therefore we choose an effective sampling rate of
+ 400 Hz (an audio card sampling rate of 8 KHz and an oversampling factor
+ of 20). With the aim of obtaining the best initial precision, we choose
+ a FFT buffer of 4096 samples. This implies that the minimal temporal window
+ size has to be 10.24 seconds, in other words, the sounds from the last 10.24
+ seconds are polluting the tuning taking. So, we've to wait 10.24 seconds
+ between note and note to avoid 'interferences'.
+
+ It must be an integer power of 2. The default value is 512 samples.
+
+
+ TEMPORAL_WINDOW
+
+ The length in time of the signal used to compute the final frequency. With
+ higher values, we'll obtain a more accurate result, but also a slower
+ response polluted by earlier notes.
+
+ As a practical rule, we say that if we've a temporal window of 1 second, we
+ must wait 1 second between two consecutive notes to obtain a correct tuning.
+ So, this parameter affects directly to the dynamic response of the tuner.
+
+ The temporal window size in samples (obtained as the multiplication of its
+ duration in seconds and the effective sampling rate) must be greater than
+ the FFT buffer size.
+
+ It must be a real number in seconds. The default value is 0.32 seconds.
+
+
+ NOISE_THRESHOLD
+
+ To avoid tuning noise, this threshold distinguish what is signal and what
+ is noise. Try to tune it empirically with the help of a sound mixer.
+
+ It's a real number whose units are dB.
+
+
+ CALCULATION_RATE
+
+ With higher calculations per second, the tuner gives us a better dynamic
+ sensation, but it'll need more CPU time.
+
+ It's a real number, in hertz, and the default value is 20 Hz.
+
+
+ VISUALIZATION_RATE
+
+ It has impact in the dynamism sensation achieved, but less in the
+ computation time.
+
+ There is no point having a calculation rate greater than the visualization
+ rate.
+
+ It's a real number, in hertz. The default value is 30 Hz.
+
+
+ PEAK_NUMBER (Number of peaks)
+
+ For the identification of the fundamental peak, depending on the timbre
+ generated by the instrument, we must consider the number of harmonics
+ (peaks in frequencies multiple of the fundamental one) which can be greater
+ than the fundamental peak (up to the relation remarked in the next option).
+
+ It's an integer, expressing an amount. The default value is 3 peaks.
+
+
+ PEAK_REJECTION_RELATION
+
+ Any peak with a relative amplitude (relative to the maximum peak) bigger
+ than this parameter will be ruled out.
+
+ It's a real number with dB units. The default value is 20 dB.
+
+
+ PEAK_HALF_WIDTH
+
+ Number of samples at each side needed for a peak to be accepted. The correct
+ tuning of this parameter will depend on the instrument, and mainly on the
+ spectral resolution obtained with the effective sampling rate and the FFT
+ size. Note that considering N samples of the FFT implies a variable
+ frequency interval that depends on those parameters.
+
+ It's an integer expressing a number of samples. The default value is 1
+ sample.
+
+
+ DFT_NUMBER (Number of DFTs)
+
+ After the fundamental peak is found on the FFT, a certain amount of DFTs
+ (localized in frequency domain) are computed to get close to the note
+ frequency. This is a previous step before launching a final approximation
+ with an iterative method (Newton-Raphson).
+
+ It's an integer expressing an amount of DFTs, and the default value is 2
+ DFTs.
+
+
+ DFT_SIZE
+
+ DTF size in samples. Bigger values gets more locking precision, but more
+ computing time is needed.
+
+ It's an integer. The default value is 15 samples.
+
+
+ GAIN
+
+ Real value indicating a scale factor for the input signal, that may help
+ in fitting the signal between certain desirable levels.
+
+ It's a real number expressed in logarithmic units (dB). The default value is
+ 0 dB.
+
+
+ SCALE
+
+ Definition of the scale used for the tuning. By default a 12 semitones
+ equal-tempered scale is used. It contains different parameters:
+
+ NAME: Scale name, only for your information.
+ BASE_FREQUENCY: The absolute frequency, in hertz, of the first note.
+ NOTE_COUNT: number of notes in the scale.
+ NOTES: list of notes, being them pairs of name and frequency shift. The
+ frequency shift can be expressed as a real number in cents or a
+ division of integer values, codifying a frequency ratio, like '3/2'
+ or '5/4'. Be careful with leaving wide gaps in frequency between each
+ pair of adjacent notes, as the gauge range will adapt to the maximum
+ of those distances. Try to use scales with at least 12 tones.
diff --git a/THANKS b/THANKS
new file mode 100644
index 0000000..49fa6b5
--- /dev/null
+++ b/THANKS
@@ -0,0 +1,4 @@
+
+* Niv Sardi Altivanik, for debian packaging and maintenance, and for man page.
+* Matthew Blissett (Logo design).
+* Graciano Carrillo, for helping in maintenance.
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TODO
diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644
index 0000000..7e553f3
--- /dev/null
+++ b/acinclude.m4
@@ -0,0 +1 @@
+AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
diff --git a/config.guess b/config.guess
new file mode 100755
index 0000000..f32079a
--- /dev/null
+++ b/config.guess
@@ -0,0 +1,1526 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
+
+timestamp='2008-01-23'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <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:*:[456])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <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 __LP64__ >/dev/null
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <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:*:*)
+ case ${UNAME_MACHINE} in
+ pc98)
+ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ *:Interix*:[3456]*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ EM64T | authenticamd)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ 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 ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ arm*:Linux:*:*)
+ 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-gnu
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux-gnu
+ exit ;;
+ crisv32:Linux:*:*)
+ echo crisv32-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+ echo frv-unknown-linux-gnu
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ mips:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips
+ #undef mipsel
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mipsel
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips64
+ #undef mips64el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mips64el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips64
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ or32:Linux:*:*)
+ echo or32-unknown-linux-gnu
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-gnu
+ exit ;;
+ x86_64:Linux:*:*)
+ echo x86_64-unknown-linux-gnu
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ i*86:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us. cd to the root directory to prevent
+ # problems with other programs or directories called `ld' in the path.
+ # Set LC_ALL=C to ensure ld outputs messages in English.
+ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+ | sed -ne '/supported targets:/!d
+ s/[ ][ ]*/ /g
+ s/.*supported targets: *//
+ s/ .*//
+ p'`
+ case "$ld_supported_targets" in
+ elf32-i386)
+ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+ ;;
+ a.out-i386-linux)
+ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+ exit ;;
+ coff-i386)
+ echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+ exit ;;
+ "")
+ # Either a pre-BFD a.out linker (linux-gnuoldld) or
+ # one that does not give us useful --help.
+ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+ exit ;;
+ esac
+ # Determine whether the default compiler is a.out or elf
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #ifdef __ELF__
+ # ifdef __GLIBC__
+ # if __GLIBC__ >= 2
+ LIBC=gnu
+ # else
+ LIBC=gnulibc1
+ # endif
+ # else
+ LIBC=gnulibc1
+ # endif
+ #else
+ #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+ LIBC=gnu
+ #else
+ LIBC=gnuaout
+ #endif
+ #endif
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^LIBC/{
+ s: ::g
+ p
+ }'`"
+ test x"${LIBC}" != x && {
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit
+ }
+ test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+ ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </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 i386.
+ echo i386-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ c34*)
+ echo c34-convex-bsd
+ exit ;;
+ c38*)
+ echo c38-convex-bsd
+ exit ;;
+ c4*)
+ echo c4-convex-bsd
+ exit ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 0000000..4c09f02
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,107 @@
+/* config.h.in. Generated from configure.in by autoheader. */
+
+/* always defined to indicate that i18n is enabled */
+#undef ENABLE_NLS
+
+/* lingot */
+#undef GETTEXT_PACKAGE
+
+/* Define to 1 if you have the `bind_textdomain_codeset' function. */
+#undef HAVE_BIND_TEXTDOMAIN_CODESET
+
+/* Define to 1 if you have the `dcgettext' function. */
+#undef HAVE_DCGETTEXT
+
+/* 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 to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define if your <locale.h> file defines LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
+
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
+/* 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. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Package data dir */
+#undef PACKAGE_DATA_DIR
+
+/* Package doc dir */
+#undef PACKAGE_DOC_DIR
+
+/* Help */
+#undef PACKAGE_HELP_DIR
+
+/* Package local directory */
+#undef PACKAGE_LOCALE_DIR
+
+/* Menu */
+#undef PACKAGE_MENU_DIR
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Pixmaps */
+#undef PACKAGE_PIXMAPS_DIR
+
+/* Source */
+#undef PACKAGE_SRC_DIR
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
diff --git a/config.sub b/config.sub
new file mode 100755
index 0000000..6759825
--- /dev/null
+++ b/config.sub
@@ -0,0 +1,1658 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
+
+timestamp='2008-01-16'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray)
+ os=
+ basic_machine=$1
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | bfin \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fido | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | mcore | mep \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64vr | mips64vrel \
+ | mips64orion | mips64orionel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | mt \
+ | msp430 \
+ | nios | nios2 \
+ | ns16k | ns32k \
+ | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu | strongarm \
+ | tahoe | thumb | tic4x | tic80 | tron \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | z8k)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nios-* | nios2-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tron-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-*)
+ ;;
+ # Recognize the 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
+ ;;
+ 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
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ 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
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ 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
+ ;;
+ mingw32)
+ basic_machine=i386-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
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ 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) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
+ tic55x | c55x*)
+ basic_machine=tic55x-unknown
+ os=-coff
+ ;;
+ tic6x | c6x*)
+ basic_machine=tic6x-unknown
+ os=-coff
+ ;;
+ tile*)
+ basic_machine=tile-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
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-haiku)
+ os=-haiku
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000..e872756
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,157 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl Created by Anjuta - will be overwritten
+dnl If you don't want it to overwrite it,
+dnl Please disable it in the Anjuta project configuration
+
+AC_INIT(configure.in)
+AM_INIT_AUTOMAKE(lingot, 0.9.1)
+AM_CONFIG_HEADER(config.h)
+AM_MAINTAINER_MODE
+
+AC_ISC_POSIX
+AC_PROG_CC
+AM_PROG_CC_STDC
+AC_HEADER_STDC
+
+AC_PROG_INTLTOOL([0.23])
+
+GETTEXT_PACKAGE=lingot
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [lingot])
+
+dnl Languages which your application supports
+ALL_LINGUAS="ca cs de es gl it pt_BR sv zh_CN fr"
+AM_GLIB_GNU_GETTEXT
+
+AM_PROG_LIBTOOL
+
+AC_CHECK_LIB(m, sin)
+
+PKG_CHECK_MODULES([GTK], [gtk+-2.0])
+AC_SUBST(GTK_CFLAGS)
+AC_SUBST(GTK_LIBS)
+
+usealsa=yes
+
+AC_ARG_ENABLE(
+ alsa,
+ AC_HELP_STRING([--enable-alsa], [use ALSA @<:@default=yes@:>@]),
+ [
+ if test "x$enableval" = "xno"; then
+ usealsa=no
+ fi
+ ])
+
+if test "x$usealsa" = "xyes"; then
+ PKG_CHECK_MODULES([ALSA], [alsa])
+ AC_SUBST(ALSA_CFLAGS)
+ AC_SUBST(ALSA_LIBS)
+ CFLAGS="$CFLAGS -DALSA"
+fi
+
+usejack=yes
+
+AC_ARG_ENABLE(
+ jack,
+ AC_HELP_STRING([--enable-jack], [use JACK @<:@default=yes@:>@]),
+ [
+ if test "x$enableval" = "xno"; then
+ usejack=no
+ fi
+ ])
+
+AM_CONDITIONAL(HAVE_JACK, test "x$usejack" = "xyes")
+
+if test "x$usejack" = "xyes"; then
+ PKG_CHECK_MODULES(JACK, jack >= 0.102.0)
+ AC_SUBST(JACK_CFLAGS)
+ AC_SUBST(JACK_LIBS)
+ CFLAGS="$CFLAGS -DJACK"
+fi
+
+
+PKG_CHECK_MODULES([GLADE], [libglade-2.0])
+AC_SUBST(GLADE_CFLAGS)
+AC_SUBST(GLADE_LIBS)
+
+dnl Set PACKAGE_LOCALE_DIR in config.h.
+if test "x${prefix}" = "xNONE"; then
+ AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale", [Package local directory])
+else
+ AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale", [Package local directory])
+fi
+
+dnl Set PACKAGE SOURCE DIR in config.h.
+packagesrcdir=`cd $srcdir && pwd`
+
+dnl Set PACKAGE PREFIX
+if test "x${prefix}" = "xNONE"; then
+ packageprefix=${ac_default_prefix}
+else
+ packageprefix=${prefix}
+fi
+
+dnl Set PACKAGE DATA & DOC DIR
+packagedatadir=share
+packagedocdir=doc/${PACKAGE}
+
+dnl Set PACKAGE DIRs in config.h.
+packagepixmapsdir=share/pixmaps/${PACKAGE}
+packagehelpdir=share/gnome/help/${PACKAGE}
+packagemenudir=share/applications
+
+dnl Subst PACKAGE_DATA_DIR.
+NO_PREFIX_PACKAGE_DATA_DIR="${packagedatadir}"
+AC_SUBST(NO_PREFIX_PACKAGE_DATA_DIR)
+PACKAGE_DATA_DIR="${packageprefix}/${packagedatadir}"
+AC_SUBST(PACKAGE_DATA_DIR)
+
+dnl Subst PACKAGE_DOC_DIR.
+NO_PREFIX_PACKAGE_DOC_DIR="${packagedocdir}"
+AC_SUBST(NO_PREFIX_PACKAGE_DOC_DIR)
+PACKAGE_DOC_DIR="${packageprefix}/${packagedocdir}"
+AC_SUBST(PACKAGE_DOC_DIR)
+
+dnl Subst PACKAGE_PIXMAPS_DIR.
+NO_PREFIX_PACKAGE_PIXMAPS_DIR="${packagepixmapsdir}"
+AC_SUBST(NO_PREFIX_PACKAGE_PIXMAPS_DIR)
+PACKAGE_PIXMAPS_DIR="${packageprefix}/${packagepixmapsdir}"
+AC_SUBST(PACKAGE_PIXMAPS_DIR)
+
+dnl Subst PACKAGE_HELP_DIR.
+NO_PREFIX_PACKAGE_HELP_DIR="${packagehelpdir}"
+AC_SUBST(NO_PREFIX_PACKAGE_HELP_DIR)
+PACKAGE_HELP_DIR="${packageprefix}/${packagehelpdir}"
+AC_SUBST(PACKAGE_HELP_DIR)
+
+dnl Subst PACKAGE_MENU_DIR.
+NO_PREFIX_PACKAGE_MENU_DIR="${packagemenudir}"
+AC_SUBST(NO_PREFIX_PACKAGE_MENU_DIR)
+PACKAGE_MENU_DIR="${packageprefix}/${packagemenudir}"
+AC_SUBST(PACKAGE_MENU_DIR)
+
+dnl AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${packageprefix}/${packagedatadir}")
+dnl AC_DEFINE_UNQUOTED(PACKAGE_DOC_DIR, "${packageprefix}/${packagedocdir}")
+dnl AC_DEFINE_UNQUOTED(PACKAGE_PIXMAPS_DIR, "${packageprefix}/${packagepixmapsdir}")
+dnl AC_DEFINE_UNQUOTED(PACKAGE_HELP_DIR, "${packageprefix}/${packagehelpdir}")
+dnl AC_DEFINE_UNQUOTED(PACKAGE_MENU_DIR, "${packageprefix}/${packagemenudir}")
+dnl AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}")
+
+
+AC_DEFINE([PACKAGE_DATA_DIR], [share], [Package data dir])
+AC_DEFINE([PACKAGE_DOC_DIR], [doc], [Package doc dir])
+AC_DEFINE([PACKAGE_HELP_DIR], [doc], [Help])
+AC_DEFINE([PACKAGE_MENU_DIR], [], [Menu])
+AC_DEFINE([PACKAGE_PIXMAPS_DIR], [pixmaps], [Pixmaps])
+AC_DEFINE([PACKAGE_SRC_DIR], [src], [Source])
+
+
+AC_OUTPUT([
+Makefile
+po/Makefile.in
+src/Makefile
+src/glade/Makefile
+pixmaps/Makefile
+lingot.desktop
+])
+
diff --git a/depcomp b/depcomp
new file mode 100755
index 0000000..04701da
--- /dev/null
+++ b/depcomp
@@ -0,0 +1,530 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2005-07-09.11
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# 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 <oliva@dcc.unicamp.br>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by `PROGRAMS ARGS'.
+ object Object file output by `PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputing dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+ "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like `#:fec' to the end of the
+ # dependency line.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr '
+' ' ' >> $depfile
+ echo >> $depfile
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> $depfile
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts `$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
+ tmpdepfile="$stripped.u"
+ if test "$libtool" = yes; then
+ "$@" -Wc,-M
+ else
+ "$@" -M
+ fi
+ stat=$?
+
+ if test -f "$tmpdepfile"; then :
+ else
+ stripped=`echo "$stripped" | sed 's,^.*/,,'`
+ tmpdepfile="$stripped.u"
+ fi
+
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile"; then
+ outname="$stripped.o"
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+ sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+icc)
+ # Intel's C compiler understands `-MD -MF file'. However on
+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # ICC 7.0 will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want:
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+ # ICC 7.1 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using \ :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+ sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in `foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+ if test "$libtool" = yes; then
+ # With Tru64 cc, shared objects can also be used to make a
+ # static library. This mecanism is used in libtool 1.4 series to
+ # handle both shared and static libraries in a single compilation.
+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+ #
+ # With libtool 1.5 this exception was removed, and libtool now
+ # generates 2 separate objects for the 2 libraries. These two
+ # compilations output dependencies in in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
+ tmpdepfile2=$dir$base.o.d # libtool 1.5
+ tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
+ tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.o.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ tmpdepfile4=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for `:'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+ "$@" $dashmflag |
+ sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no
+ for arg in "$@"; do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix="`echo $object | sed 's/^.*\././'`"
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E |
+ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ "$@" || exit $?
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ echo " " >> "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/install-sh b/install-sh
new file mode 100755
index 0000000..4d4a951
--- /dev/null
+++ b/install-sh
@@ -0,0 +1,323 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2005-05-14.22
+
+# 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. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+chmodcmd="$chmodprog 0755"
+chowncmd=
+chgrpcmd=
+stripcmd=
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=
+dst=
+dir_arg=
+dstarg=
+no_target_directory=
+
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+-c (ignored)
+-d create directories instead of installing files.
+-g GROUP $chgrpprog installed files to GROUP.
+-m MODE $chmodprog installed files to MODE.
+-o USER $chownprog installed files to USER.
+-s $stripprog installed files.
+-t DIRECTORY install into DIRECTORY.
+-T report an error if DSTFILE is a directory.
+--help display this help and exit.
+--version display version info and exit.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test -n "$1"; do
+ case $1 in
+ -c) shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd=$stripprog
+ shift
+ continue;;
+
+ -t) dstarg=$2
+ shift
+ shift
+ continue;;
+
+ -T) no_target_directory=true
+ shift
+ continue;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ *) # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ test -n "$dir_arg$dstarg" && break
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dstarg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dstarg"
+ shift # fnord
+ fi
+ shift # arg
+ dstarg=$arg
+ done
+ break;;
+ esac
+done
+
+if test -z "$1"; 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
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src ;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ src=
+
+ if test -d "$dst"; then
+ mkdircmd=:
+ chmodcmd=
+ else
+ mkdircmd=$mkdirprog
+ fi
+ else
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dstarg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dstarg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst ;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dstarg: Is a directory" >&2
+ exit 1
+ fi
+ dst=$dst/`basename "$src"`
+ fi
+ fi
+
+ # This sed command emulates the dirname command.
+ dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
+
+ # Make sure that the destination directory exists.
+
+ # Skip lots of stat calls in the usual case.
+ if test ! -d "$dstdir"; then
+ defaultIFS='
+ '
+ IFS="${IFS-$defaultIFS}"
+
+ oIFS=$IFS
+ # Some sh's can't handle IFS=/ for some reason.
+ IFS='%'
+ set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+ shift
+ IFS=$oIFS
+
+ pathcomp=
+
+ while test $# -ne 0 ; do
+ pathcomp=$pathcomp$1
+ shift
+ if test ! -d "$pathcomp"; then
+ $mkdirprog "$pathcomp"
+ # mkdir can fail with a `File exist' error in case several
+ # install-sh are creating the directory concurrently. This
+ # is OK.
+ test -d "$pathcomp" || exit
+ fi
+ pathcomp=$pathcomp/
+ done
+ fi
+
+ if test -n "$dir_arg"; then
+ $doit $mkdircmd "$dst" \
+ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
+
+ else
+ dstfile=`basename "$dst"`
+
+ # 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
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Copy the file name to the temp name.
+ $doit $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 "$dsttmp"; } &&
+
+ # Now rename the file to the real destination.
+ { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
+ || {
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ if test -f "$dstdir/$dstfile"; then
+ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+ || {
+ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+ (exit 1); exit 1
+ }
+ else
+ :
+ fi
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+ }
+ }
+ fi || { (exit 1); exit 1; }
+done
+
+# The final little trick to "correctly" pass the exit status to the exit trap.
+{
+ (exit 0); exit 0
+}
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/intltool-extract.in b/intltool-extract.in
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/intltool-extract.in
diff --git a/intltool-merge.in b/intltool-merge.in
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/intltool-merge.in
diff --git a/intltool-update.in b/intltool-update.in
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/intltool-update.in
diff --git a/lingot.desktop.in b/lingot.desktop.in
new file mode 100644
index 0000000..02e7c92
--- /dev/null
+++ b/lingot.desktop.in
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Lingot
+Comment=LINGOT Is Not a Guitar-Only Tuner
+Comment[cs]=(Nejen kytarová) ladička
+Exec=lingot
+Icon=@PACKAGE_PIXMAPS_DIR@/lingot-icon.svg
+Terminal=false
+Type=Application
+Categories=GNOME;GTK;AudioVideo;
diff --git a/ltmain.sh b/ltmain.sh
new file mode 100755
index 0000000..c7dd906
--- /dev/null
+++ b/ltmain.sh
@@ -0,0 +1,9642 @@
+
+# libtool (GNU libtool) 2.4
+# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008, 2009, 2010 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 http://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)
+# --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 Debian-2.4-3
+# automake: $automake_version
+# autoconf: $autoconf_version
+#
+# Report bugs to <bug-libtool@gnu.org>.
+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+# General help using GNU software: <http://www.gnu.org/gethelp/>.
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION="2.4 Debian-2.4-3"
+TIMESTAMP=""
+package_revision=1.3293
+
+# 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'}
+: ${EGREP="/bin/grep -E"}
+: ${FGREP="/bin/grep -F"}
+: ${GREP="/bin/grep"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SED="/bin/sed"}
+: ${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=:
+ 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'
+
+# 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 --version) 2>/dev/null |$SED 1q`"'/
+ s/\$autoconf_version/'"`(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_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-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 | *.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_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+ if test -n "$stripme" && test -n "$old_striplib"; then
+ func_show_eval "$old_striplib $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 ()
+{
+ for lt_wr_arg
+ do
+ case \$lt_wr_arg in
+ --lt-*) ;;
+ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+ esac
+ shift
+ done
+ 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 -e 's/\([\\"]\)/\\\1/g' \
+ -e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
+
+ 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)
+ 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)
+ 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
+ *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$dir"
+ # 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
+ 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)
+ 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"
+ ;;
+
+ *)
+ 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
+ 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_apped perm_rpath " $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ if test -n "$hardcode_libdir_flag_spec_ld"; then
+ eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ else
+ eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ fi
+ fi
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ 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 1q $export_symbols`" != 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
+ 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"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ 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/missing b/missing
new file mode 100755
index 0000000..894e786
--- /dev/null
+++ b/missing
@@ -0,0 +1,360 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2005-06-08.21
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case "$1" in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ # Exit code 63 means version mismatch. This often happens
+ # when the user try to use an ancient version of a tool on
+ # a file that requires a minimum version. In this case we
+ # we should proceed has if the program had been absent, or
+ # if --run hadn't been passed.
+ if test $? = 63; then
+ run=:
+ msg="probably too old"
+ fi
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ tar try tar, gnutar, gtar, then tar without non-portable flags
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake@gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case "$1" in
+ lex|yacc)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ tar)
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ exit 1
+ fi
+ ;;
+
+ *)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running `$TOOL --version' or `$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
+ fi
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+ aclocal*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`${configure_ac}'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case "$f" in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ autom4te)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+ test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
+ bison|yacc)
+ echo 1>&2 "\
+WARNING: \`$1' $msg. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f y.tab.h ]; then
+ echo >y.tab.h
+ fi
+ if [ ! -f y.tab.c ]; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex|flex)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f lex.yy.c ]; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ help2man)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+ fi
+ if [ -f "$file" ]; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit 1
+ fi
+ ;;
+
+ makeinfo)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ # The file to touch is that specified with -o ...
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+ fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
+ touch $file
+ ;;
+
+ tar)
+ shift
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar "$@" && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar "$@" && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case "$firstarg" in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ case "$firstarg" in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequisites for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/mkinstalldirs b/mkinstalldirs
new file mode 100755
index 0000000..4191a45
--- /dev/null
+++ b/mkinstalldirs
@@ -0,0 +1,162 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+
+scriptversion=2009-04-28.21; # UTC
+
+# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+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 <bug-automake@gnu.org>."
+
+# 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/pixmaps/Makefile.am b/pixmaps/Makefile.am
new file mode 100644
index 0000000..951aba5
--- /dev/null
+++ b/pixmaps/Makefile.am
@@ -0,0 +1,12 @@
+## Process this file with automake to produce Makefile.in
+
+## Created by Anjuta - will be overwritten
+## If you don't want it to overwrite it,
+## Please disable it in the Anjuta project configuration
+
+lingot_pixmapsdir = $(prefix)/@NO_PREFIX_PACKAGE_PIXMAPS_DIR@
+
+lingot_pixmaps_DATA = \
+ lingot-icon.svg
+
+EXTRA_DIST = $(lingot_pixmaps_DATA)
diff --git a/pixmaps/lingot-icon.svg b/pixmaps/lingot-icon.svg
new file mode 100644
index 0000000..065b120
--- /dev/null
+++ b/pixmaps/lingot-icon.svg
@@ -0,0 +1,284 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="128"
+ height="128"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.45"
+ version="1.0"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
+ sodipodi:docname="lingot-icon4.svg"
+ sodipodi:docbase="/home/home/Matthew/mycustomicons/inkscapesvgs"
+ sodipodi:modified="true">
+ <metadata
+ id="metadata40">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title>Lingot Icon</dc:title>
+ <dc:date>02/19/2007</dc:date>
+ <dc:creator>
+ <cc:Agent>
+ <dc:title>Matthew Blissett &lt;tehblunderbuss@gmail.com&gt;</dc:title>
+ </cc:Agent>
+ </dc:creator>
+ <dc:rights>
+ <cc:Agent>
+ <dc:title>GPL 2.0</dc:title>
+ </cc:Agent>
+ </dc:rights>
+ <cc:license
+ rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" />
+ <dc:relation>http://www.nongnu.org/lingot/</dc:relation>
+ <dc:source>http://download.savannah.gnu.org/releases/lingot/lingot-0.7.1.tar.gz</dc:source>
+ <dc:publisher>
+ <cc:Agent>
+ <dc:title>The Lingot Development Team</dc:title>
+ </cc:Agent>
+ </dc:publisher>
+ <dc:description>This icon was made using all GPL/Public Domain components.
+Inkscape &lt;http://inkscape.org&gt;
+Musical note by Nicu Buculei &lt;http://openclipart.org/clipart//recreation/music/musical_note_nicu_bucule_01.svg&gt;
+Font is admin's handfont2 &lt;http://openfontlibrary.org/?ccm=/media/files/admin/3&gt;</dc:description>
+ </cc:Work>
+ <cc:License
+ rdf:about="http://creativecommons.org/licenses/GPL/2.0/">
+ <cc:permits
+ rdf:resource="http://web.resource.org/cc/Reproduction" />
+ <cc:permits
+ rdf:resource="http://web.resource.org/cc/Distribution" />
+ <cc:requires
+ rdf:resource="http://web.resource.org/cc/Notice" />
+ <cc:permits
+ rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
+ <cc:requires
+ rdf:resource="http://web.resource.org/cc/ShareAlike" />
+ <cc:requires
+ rdf:resource="http://web.resource.org/cc/SourceCode" />
+ </cc:License>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient2828">
+ <stop
+ style="stop-color:#f6e6b1;stop-opacity:1;"
+ offset="0"
+ id="stop2830" />
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="1"
+ id="stop2832" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient1937">
+ <stop
+ style="stop-color:#afcc99;stop-opacity:1;"
+ offset="0"
+ id="stop1939" />
+ <stop
+ style="stop-color:white;stop-opacity:1;"
+ offset="1"
+ id="stop1941" />
+ </linearGradient>
+ <linearGradient
+ y2="20.792826"
+ y1="4.4250841"
+ xlink:href="#linearGradient3579"
+ x2="156.67999"
+ x1="95.224609"
+ inkscape:collect="always"
+ id="linearGradient10466"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(0.583097,1.71498)" />
+ <linearGradient
+ y2="37.16391"
+ y1="-6.6212053"
+ xlink:href="#linearGradient3579"
+ x2="97.343185"
+ x1="71.088333"
+ inkscape:collect="always"
+ id="linearGradient10464"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.60451,-6.271869e-2,0.1698,1.636615,0,0)" />
+ <linearGradient
+ y2="111.3392"
+ y1="52.71389"
+ xlink:href="#linearGradient3579"
+ x2="15.223759"
+ x1="-19.039936"
+ inkscape:collect="always"
+ id="linearGradient10462"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.269095,-0.13167,8.088146e-2,0.779571,0,0)" />
+ <linearGradient
+ y2="13.944632"
+ y1="81.05584"
+ xlink:href="#linearGradient900"
+ x2="18.903805"
+ x1="80.23925"
+ inkscape:collect="always"
+ id="linearGradient10460"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="scale(0.88267,1.132926)" />
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient3579">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0"
+ id="stop3581" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0;"
+ offset="1"
+ id="stop3583" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient900">
+ <stop
+ id="stop1014"
+ offset="0.000000"
+ style="stop-color:#83a67f;stop-opacity:1;" />
+ <stop
+ id="stop1015"
+ offset="1.000000"
+ style="stop-color:#46a046;stop-opacity:1;" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient2828"
+ id="linearGradient2197"
+ gradientUnits="userSpaceOnUse"
+ x1="56.374466"
+ y1="52.017021"
+ x2="22.876596"
+ y2="16.736267" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient1937"
+ id="linearGradient2201"
+ gradientUnits="userSpaceOnUse"
+ x1="49.838299"
+ y1="47.387234"
+ x2="13.072341"
+ y2="10.621277" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="2.7646503"
+ inkscape:cx="81.969147"
+ inkscape:cy="60.572563"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer2"
+ width="128px"
+ height="128px"
+ inkscape:showpageshadow="false"
+ borderlayer="false"
+ showgrid="false"
+ gridspacingx="4px"
+ gridspacingy="4px"
+ gridempspacing="2"
+ inkscape:window-width="1016"
+ inkscape:window-height="673"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ showguides="true"
+ inkscape:guide-bbox="true" />
+ <g
+ inkscape:groupmode="layer"
+ id="layer1"
+ inkscape:label="work"
+ style="display:inline">
+ <rect
+ style="fill:url(#linearGradient2201);fill-opacity:1;fill-rule:nonzero;stroke:#89725b;stroke-width:1.5;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ id="rect3752"
+ width="126.44514"
+ height="126.44513"
+ x="0.77743119"
+ y="0.77743119"
+ rx="21.540047"
+ ry="26.714514"
+ inkscape:export-filename="/usr/share/icons/mycustom/lingot_logo_01.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ style="fill:url(#linearGradient2197);fill-opacity:1;fill-rule:nonzero;stroke:#89725b;stroke-width:2.5;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ d="M 62.567397,18.002202 C 39.685968,18.478076 17.592826,29.62951 5.3205899,49.228111 L 45.662685,70.67941 C 51.519968,61.374457 64.490685,58.164436 74.60126,63.546589 C 77.961977,65.335598 80.392967,67.588069 82.337315,70.67941 L 122.67941,49.228111 C 116.44589,39.273266 108.6635,32.097676 97.86673,26.350245 C 86.732561,20.423205 74.552907,17.752934 62.567397,18.002202 z "
+ id="path3722"
+ inkscape:export-filename="/usr/share/icons/mycustom/lingot_logo_01.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <g
+ style="display:inline"
+ inkscape:label="Layer 1"
+ id="g8716"
+ transform="matrix(0.625546,0,0,0.625546,43.14788,26.89353)">
+ <g
+ transform="matrix(0.969271,0,0,0.969271,0.386994,2.064699)"
+ id="g10453">
+ <path
+ style="fill:#000000;fill-opacity:1;stroke:#89725b;stroke-width:1.25;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ id="path9681"
+ d="M 69,2.3125 C 64.818046,9.0354121 63.837632,17.88811 60.846437,25.398373 C 56.866375,37.984332 52.886312,50.570291 48.90625,63.15625 C 37.906654,50.659421 14.276585,58.407662 12.906446,75.114782 C 9.9696307,90.804562 28.317212,105.00207 42.8125,97.8125 C 56.486903,90.62452 56.8611,73.186414 61.794879,60.315804 C 65.363253,48.491786 68.931626,36.667768 72.5,24.84375 C 76.159103,34.410661 81.361443,47.872458 71.683314,55.640247 C 65.645234,58.489746 67.397967,69.674371 74.90625,67.375 C 88.046615,61.916344 92.919197,43.969073 86.961304,31.514799 C 82.542379,22.221655 76.949778,13.347625 71.740915,4.4320634 C 70.978304,3.7491674 70.475192,1.4019212 69,2.3125 z " />
+ <path
+ style="fill:url(#linearGradient10460);fill-opacity:1;stroke:#89725b;stroke-width:3.29856873;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ sodipodi:nodetypes="cccccccccccccccccc"
+ id="path1291"
+ d="M 69.65817,4.1010011 L 67.340851,11.441835 L 49.794969,67.017994 C 45.860887,61.473174 39.22111,58.092783 31.98132,58.843919 C 21.290982,59.953052 13.516429,69.526816 14.625634,80.217842 C 15.734838,90.908865 25.309219,98.682662 35.999557,97.573528 C 44.42823,96.699045 50.9595,90.523322 52.838415,82.725282 L 72.209318,18.670635 C 73.9001,21.632201 75.888741,28.515219 77.254417,32.499965 C 78.883694,37.253837 79.783359,42.295942 79.107648,46.728433 C 78.431938,51.160925 76.440635,55.062209 71.560942,58.476204 C 70.258639,59.236545 69.497554,60.662981 69.58767,62.168302 C 69.677782,63.673625 70.601677,64.995867 71.985389,65.595412 C 73.3691,66.194956 74.974497,65.971559 76.134407,65.007858 C 82.654666,60.446071 86.038829,54.223268 86.994807,47.952286 C 87.950784,41.681304 87.369037,35.385905 84.781691,30.887206 C 79.721848,22.996745 76.581231,16.662142 73.875164,12.147822 C 72.627633,9.449142 71.063835,6.7832748 69.65817,4.1010011 z " />
+ <path
+ style="fill:url(#linearGradient10462);fill-opacity:1;stroke:none;stroke-width:1.25;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ sodipodi:nodetypes="cccc"
+ id="path2057"
+ d="M 28.342805,60.415292 C 21.045761,62.770871 17.100078,68.146017 15.873992,74.643336 C 22.520884,103.10443 30.283543,63.263107 49.265582,68.455977 C 49.634465,66.46574 40.303454,56.88655 28.342805,60.415292 z " />
+ <path
+ style="fill:url(#linearGradient10464);fill-opacity:1;stroke:none;stroke-width:1.25;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ sodipodi:nodetypes="cccc"
+ id="path3587"
+ d="M 50.705627,66.934152 C 55.507174,64.661613 65.40981,16.593917 71.681064,16.580795 C 69.841104,16.151322 69.50979,13.340655 69.394962,6.789618 C 69.066935,7.8415256 50.921241,67.1565 50.705627,66.934152 z " />
+ <path
+ style="fill:url(#linearGradient10466);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ sodipodi:nodetypes="ccc"
+ id="path5873"
+ d="M 71.542131,16.852147 C 71.542131,16.852147 93.958665,50.715421 78.060414,52.782194 C 81.717011,48.489666 81.875994,36.248013 71.542131,16.852147 z " />
+ </g>
+ </g>
+ </g>
+ <g
+ inkscape:groupmode="layer"
+ id="layer2"
+ inkscape:label="text"
+ style="display:inline">
+ <g
+ style="display:inline"
+ inkscape:label="Layer 1"
+ id="g7584"
+ transform="matrix(0.481228,-0.139974,0.139974,0.481228,11.97751,80.80982)" />
+ <path
+ d="M 21.450208,112.02853 L 16.954214,111.25708 C 16.90115,111.25708 16.8481,111.25708 16.795063,111.25708 C 15.468799,111.06421 14.009923,111.04278 12.418431,111.19278 C 11.808348,111.68566 10.667772,111.87852 8.9967014,111.77138 C 8.9701706,111.77138 8.877333,111.76066 8.7181885,111.73923 C 7.8163326,111.73923 7.1797322,111.50351 6.8083856,111.03206 C 6.5961819,110.75348 6.5696569,110.44276 6.7288104,110.09989 C 7.3123572,109.22129 7.6041325,108.22483 7.6041368,107.1105 C 7.7898076,104.60328 7.8826451,100.81029 7.8826498,95.731529 L 7.9622248,93.095728 C 7.9356951,93.031462 7.9224326,92.967169 7.9224373,92.902867 L 7.683712,90.813507 C 7.7102325,90.449231 7.8295951,90.127792 8.0418,89.849185 C 8.6253454,89.184899 9.4476209,88.938462 10.508629,89.109873 C 11.251322,89.217043 11.795085,89.506339 12.139919,89.97776 C 12.537785,90.36351 12.590835,91.006387 12.299069,91.9064 C 12.19296,92.227856 12.126647,92.463583 12.100131,92.61357 L 11.861406,95.76368 C 11.861397,95.892266 11.834872,96.010129 11.781831,96.117261 L 11.503318,103.57467 L 11.46353,107.68909 C 11.490047,107.79624 11.50331,107.90339 11.503318,108.01053 C 11.848135,108.09625 12.72346,108.14982 14.129297,108.17125 C 14.421061,108.17126 14.686311,108.18197 14.925048,108.20339 C 15.800362,108.22483 17.617326,108.44983 20.375944,108.87842 L 22.683622,109.13557 C 23.108003,109.24272 23.373253,109.42487 23.479374,109.68202 C 23.585453,109.81059 23.625241,110.00346 23.598736,110.26061 C 23.57219,110.36776 23.704815,110.46419 23.996611,110.54991 C 24.633191,110.82849 24.659717,111.18207 24.076187,111.61066 C 23.51914,112.01782 22.975378,112.16782 22.444897,112.06067 C 21.993953,112.06067 21.662389,112.04996 21.450208,112.02853 M 33.255302,112.02853 C 31.982095,111.7928 31.531169,110.8392 31.902524,109.16772 C 31.929044,109.06057 31.968832,108.89985 32.021886,108.68556 C 32.021882,108.23554 32.220819,107.2498 32.6187,105.72831 C 32.777845,105.17115 32.870683,104.69971 32.897213,104.31397 C 32.923732,103.49967 33.414445,102.95322 34.369353,102.67464 C 35.324246,102.39606 36.133259,102.54607 36.796394,103.12465 C 36.955535,103.25323 37.074897,103.40323 37.154482,103.57467 C 37.472772,104.08898 37.419722,104.81757 36.995332,105.76045 C 36.730072,106.38191 36.584184,106.84264 36.557669,107.14264 C 36.398509,107.48552 36.279147,108.2784 36.199581,109.5213 C 36.146522,110.20704 36.013897,110.71062 35.801706,111.03206 C 35.722121,111.46065 35.244671,111.78209 34.369353,111.99639 C 33.91842,112.10353 33.54707,112.11424 33.255302,112.02853 M 34.966167,101.90317 C 34.037782,101.8389 33.467495,101.42102 33.255302,100.64956 C 33.043095,99.878115 33.268558,99.26738 33.93169,98.817355 C 34.435658,98.453069 35.244671,98.388785 36.35873,98.624494 C 37.180996,98.795936 37.671709,99.085232 37.830871,99.492374 C 38.46746,100.19955 38.268523,100.87458 37.234057,101.51745 C 36.730072,101.81747 36.212834,101.9889 35.682342,102.03175 C 35.602759,102.16034 35.364033,102.11748 34.966167,101.90317 M 56.648522,111.86781 C 56.038431,111.26779 55.693607,110.27132 55.614045,108.87842 C 55.560981,108.06411 55.49467,107.49623 55.415108,107.17479 C 55.521194,106.2319 55.282469,105.68545 54.698931,105.53545 C 54.115369,105.40687 53.571606,105.73903 53.067641,106.53191 C 52.69628,106.87478 52.192305,107.63552 51.555714,108.81413 C 51.263929,109.41416 50.958892,109.8856 50.6406,110.22847 C 50.481442,111.23565 49.738741,111.76066 48.412497,111.80352 C 47.72284,111.84638 47.033189,111.72852 46.343544,111.44994 C 45.813039,110.95707 45.680414,110.07846 45.945669,108.81413 C 46.18439,107.65695 46.250702,106.86407 46.144606,106.43548 L 46.423119,102.67464 C 46.476164,102.43892 46.529215,102.21391 46.582269,101.99961 C 46.92709,101.35674 47.563689,100.93887 48.492072,100.746 C 49.500016,100.57457 50.149879,100.79957 50.441662,101.42101 C 50.494704,101.57103 50.534491,101.73175 50.561026,101.90317 L 50.919113,103.3818 C 51.078254,103.66039 51.396554,103.49967 51.874014,102.89964 C 53.041105,101.95676 54.247994,101.53889 55.494683,101.64603 C 56.157795,101.68889 56.728082,101.93533 57.205548,102.38534 C 58.107383,103.09251 58.797033,104.34613 59.274501,106.14618 L 59.513226,107.14264 C 59.433634,107.46409 59.566259,108.24626 59.911102,109.48915 C 60.229384,110.71062 60.083496,111.48208 59.473439,111.80352 C 59.261221,111.91067 58.982708,111.98567 58.6379,112.02853 L 57.285123,112.22139 C 57.019857,112.19996 56.807657,112.0821 56.648522,111.86781 M 72.564166,118.10374 C 70.521731,117.88944 68.731292,117.11799 67.192845,115.78937 C 66.423615,115.18934 66.078791,114.46076 66.158369,113.60358 C 66.23794,112.83213 66.715391,112.34997 67.590721,112.15711 C 68.784342,111.94281 69.61988,112.43568 70.097336,113.63572 C 70.15038,113.7643 70.20343,113.9143 70.256487,114.08574 C 71.423581,115.07149 72.855931,115.53222 74.553544,115.46794 C 75.800208,115.48936 76.702058,115.11435 77.259097,114.34289 C 77.736534,113.70002 77.723271,113.02499 77.21931,112.31783 C 76.370496,110.38919 75.800208,109.18914 75.508445,108.7177 C 75.455383,108.61055 75.38907,108.50341 75.309508,108.39626 C 75.01772,108.33198 74.221969,108.35341 72.922253,108.46055 C 71.649043,108.54627 70.773718,108.29983 70.296275,107.72123 C 69.527042,107.05693 69.049592,105.97475 68.863922,104.4747 C 68.545616,102.80321 69.023067,101.29245 70.296275,99.94239 C 71.038968,99.149525 71.940819,98.592361 73.001828,98.270904 C 75.01772,97.99234 76.423546,98.270922 77.21931,99.106651 C 77.404972,99.278094 77.537597,99.481678 77.617186,99.717386 C 78.015047,100.18884 78.068097,100.93887 77.776336,101.96746 C 77.537597,102.84608 77.511071,103.47824 77.696761,103.86395 C 77.829372,104.09969 77.869159,104.63542 77.816123,105.47116 C 77.789584,106.1569 77.988521,106.68192 78.412937,107.04622 L 79.367839,109.45701 C 79.526973,109.75702 79.72591,110.03561 79.964652,110.29275 C 81.211311,111.70709 81.503086,113.44286 80.839978,115.50008 C 80.229886,116.33582 78.877109,117.0537 76.781647,117.65372 C 76.702058,117.67515 76.609222,117.69658 76.503134,117.71801 C 74.938145,118.16802 73.625157,118.2966 72.564166,118.10374 M 74.036305,103.73539 C 74.195445,103.1568 73.969982,102.77107 73.359917,102.5782 C 72.882457,102.4282 72.577418,102.5032 72.444803,102.8032 C 72.338694,103.01751 72.391744,103.29609 72.603953,103.63895 C 72.179543,104.04612 72.192806,104.35684 72.64374,104.57112 C 73.094657,104.76399 73.479269,104.72114 73.79758,104.44255 C 74.009769,104.27112 74.089344,104.03541 74.036305,103.73539 M 93.223863,112.06067 C 91.632353,111.88924 90.226528,110.87134 89.006382,109.007 C 87.680127,106.3712 87.613814,104.03541 88.807444,101.99961 C 88.86049,101.93533 88.91354,101.86032 88.966593,101.7746 C 89.23184,100.87458 90.253053,100.22099 92.030236,99.813822 C 93.78088,99.342387 95.611106,99.653111 97.520919,100.746 C 97.733107,100.87458 97.945307,101.01387 98.15752,101.16387 C 98.449282,101.44246 98.873682,102.12819 99.430723,103.22108 C 99.855108,104.09969 100.38561,104.69971 101.02222,105.02114 C 101.95058,106.49977 102.06995,107.82838 101.38031,109.007 C 101.24767,109.24272 101.07526,109.45701 100.86307,109.64987 C 100.04078,110.91421 98.595169,111.68566 96.526231,111.96424 C 95.969194,112.02853 95.412168,112.04996 94.855153,112.02853 L 93.223863,112.06067 M 95.133666,109.16772 C 96.168131,109.082 96.831256,108.58912 97.123044,107.68909 C 97.335232,106.93907 97.202607,106.26405 96.725168,105.66402 C 96.327281,105.49259 95.783518,104.95686 95.093879,104.05682 C 94.430742,103.22109 93.83393,102.81394 93.303439,102.83535 C 92.932079,102.83536 92.520941,103.0068 92.070023,103.34965 C 91.459941,105.25688 91.672142,107.05693 92.706624,108.74984 C 93.051441,109.22129 93.860454,109.36058 95.133666,109.16772 M 112.35049,111.6428 C 110.9977,111.10707 110.67941,109.9606 111.39558,108.20339 L 112.3107,101.96746 C 112.33722,101.77461 112.35048,101.57103 112.35049,101.35673 C 112.61573,100.19955 112.68205,99.481678 112.54943,99.203078 C 112.36374,98.774508 111.89956,98.678073 111.15686,98.91379 C 110.22848,99.192382 109.32663,99.095946 108.45131,98.624494 C 107.6025,98.174487 107.33725,97.58518 107.65556,96.856573 C 108.05343,96.127993 109.06138,95.613684 110.67941,95.313664 C 111.95261,95.056528 112.68205,94.895809 112.86772,94.831498 C 113.29212,93.652911 113.59715,92.935027 113.78284,92.677854 C 114.23376,92.034995 114.87035,91.702843 115.69265,91.681388 C 116.67406,91.681415 117.43002,92.227856 117.96054,93.320731 C 117.98705,93.385042 118.10641,93.631474 118.31863,94.060043 C 118.55734,94.252932 119.2072,94.349358 120.26821,94.34934 C 121.14352,94.349358 121.7536,94.467221 122.09844,94.702929 C 122.86764,94.938665 123.35836,95.431537 123.57058,96.181545 C 123.78276,97.01731 123.47773,97.563752 122.65547,97.820888 C 122.4963,97.88519 122.31063,97.928056 122.09844,97.949466 C 121.78013,98.056624 120.93132,98.088775 119.55203,98.045901 C 118.2523,98.003054 117.48307,98.23878 117.24436,98.753062 C 117.21782,98.838801 117.19129,98.935227 117.16478,99.042358 L 116.56797,103.02822 L 115.93137,107.56051 C 115.85178,107.75339 115.77221,108.4284 115.69265,109.58559 C 115.61306,110.69991 115.1754,111.3535 114.37965,111.54637 C 114.27354,111.5678 114.15418,111.58923 114.02157,111.61066 C 113.27886,111.78209 112.8014,111.83567 112.58922,111.77138 C 112.50963,111.72852 112.43005,111.68566 112.35049,111.6428"
+ id="text2053"
+ style="fill:#304321;fill-opacity:1;stroke:#836d55;stroke-opacity:1" />
+ </g>
+</svg>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
diff --git a/po/ChangeLog b/po/ChangeLog
new file mode 100644
index 0000000..85cf59d
--- /dev/null
+++ b/po/ChangeLog
@@ -0,0 +1,23 @@
+2007-02-26 gettextize <bug-gnu-gettext@gnu.org>
+
+ * Makefile.in.in: Upgrade to gettext-0.14.5.
+ * boldquot.sed: New file, from gettext-0.14.5.
+ * en@boldquot.header: New file, from gettext-0.14.5.
+ * en@quot.header: New file, from gettext-0.14.5.
+ * insert-header.sin: New file, from gettext-0.14.5.
+ * quot.sed: New file, from gettext-0.14.5.
+ * remove-potcdate.sin: New file, from gettext-0.14.5.
+ * Rules-quot: New file, from gettext-0.14.5.
+
+0.7.1
+-----
+
+* Files reorganized to a more "GNU-like" structure.
+* Added multilingual support
+
+
+
+0.6.x
+-----
+
+* Start point.
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644
index 0000000..2c1f4b8
--- /dev/null
+++ b/po/LINGUAS
@@ -0,0 +1,10 @@
+es
+gl
+ca
+de
+sv
+cs
+pt_BR
+it
+zh_CN
+fr
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
new file mode 100644
index 0000000..cc8a222
--- /dev/null
+++ b/po/Makefile.in.in
@@ -0,0 +1,217 @@
+# Makefile for program source directory in GNU NLS utilities package.
+# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+# Copyright (C) 2004-2008 Rodney Dawes <dobey.pwns@gmail.com>
+#
+# This file may be copied and used freely without restrictions. It may
+# be used in projects which are not available under a GNU Public License,
+# but which still want to provide support for the GNU gettext functionality.
+#
+# - Modified by Owen Taylor <otaylor@redhat.com> to use GETTEXT_PACKAGE
+# instead of PACKAGE and to look for po2tbl in ./ not in intl/
+#
+# - Modified by jacob berkman <jacob@ximian.com> to install
+# Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
+#
+# - Modified by Rodney Dawes <dobey.pwns@gmail.com> for use with intltool
+#
+# We have the following line for use by intltoolize:
+# INTLTOOL_MAKEFILE
+
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = @top_builddir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datadir = @datadir@
+datarootdir = @datarootdir@
+libdir = @libdir@
+DATADIRNAME = @DATADIRNAME@
+itlocaledir = $(prefix)/$(DATADIRNAME)/locale
+subdir = po
+install_sh = @install_sh@
+# Automake >= 1.8 provides @mkdir_p@.
+# Until it can be supposed, use the safe fallback:
+mkdir_p = $(install_sh) -d
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+GMSGFMT = @GMSGFMT@
+MSGFMT = @MSGFMT@
+XGETTEXT = @XGETTEXT@
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
+MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
+GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
+
+ALL_LINGUAS = @ALL_LINGUAS@
+
+PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi)
+
+USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep \^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi)
+
+USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
+
+POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
+
+DISTFILES = Makefile.in.in POTFILES.in $(POFILES)
+EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS
+
+POTFILES = \
+# This comment gets stripped out
+
+CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
+
+.SUFFIXES:
+.SUFFIXES: .po .pox .gmo .mo .msg .cat
+
+.po.pox:
+ $(MAKE) $(GETTEXT_PACKAGE).pot
+ $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
+
+.po.mo:
+ $(MSGFMT) -o $@ $<
+
+.po.gmo:
+ file=`echo $* | sed 's,.*/,,'`.gmo \
+ && rm -f $$file && $(GMSGFMT) -o $$file $<
+
+.po.cat:
+ sed -f ../intl/po2msg.sed < $< > $*.msg \
+ && rm -f $@ && gencat $@ $*.msg
+
+
+all: all-@USE_NLS@
+
+all-yes: $(CATALOGS)
+all-no:
+
+$(GETTEXT_PACKAGE).pot: $(POTFILES)
+ $(GENPOT)
+
+install: install-data
+install-data: install-data-@USE_NLS@
+install-data-no: all
+install-data-yes: all
+ linguas="$(USE_LINGUAS)"; \
+ for lang in $$linguas; do \
+ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
+ $(mkdir_p) $$dir; \
+ if test -r $$lang.gmo; then \
+ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
+ else \
+ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+ echo "installing $(srcdir)/$$lang.gmo as" \
+ "$$dir/$(GETTEXT_PACKAGE).mo"; \
+ fi; \
+ if test -r $$lang.gmo.m; then \
+ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
+ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
+ else \
+ if test -r $(srcdir)/$$lang.gmo.m ; then \
+ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
+ $$dir/$(GETTEXT_PACKAGE).mo.m; \
+ echo "installing $(srcdir)/$$lang.gmo.m as" \
+ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
+ else \
+ true; \
+ fi; \
+ fi; \
+ done
+
+# Empty stubs to satisfy archaic automake needs
+dvi info ctags tags CTAGS TAGS ID:
+
+# Define this as empty until I found a useful application.
+install-exec installcheck:
+
+uninstall:
+ linguas="$(USE_LINGUAS)"; \
+ for lang in $$linguas; do \
+ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
+ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
+ done
+
+check: all $(GETTEXT_PACKAGE).pot
+ rm -f missing notexist
+ srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
+ if [ -r missing -o -r notexist ]; then \
+ exit 1; \
+ fi
+
+mostlyclean:
+ rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
+ rm -f .intltool-merge-cache
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile Makefile.in POTFILES stamp-it
+ rm -f *.mo *.msg *.cat *.cat.m *.gmo
+
+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 Makefile.in.in
+
+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: $(DISTFILES)
+ dists="$(DISTFILES)"; \
+ extra_dists="$(EXTRA_DISTFILES)"; \
+ for file in $$extra_dists; do \
+ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
+ done; \
+ for file in $$dists; do \
+ test -f $$file || file="$(srcdir)/$$file"; \
+ ln $$file $(distdir) 2> /dev/null \
+ || cp -p $$file $(distdir); \
+ done
+
+update-po: Makefile
+ $(MAKE) $(GETTEXT_PACKAGE).pot
+ tmpdir=`pwd`; \
+ linguas="$(USE_LINGUAS)"; \
+ for lang in $$linguas; do \
+ echo "$$lang:"; \
+ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
+ if $$result; then \
+ if cmp $(srcdir)/$$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; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ exit 1; \
+ fi; \
+ fi; \
+ else \
+ echo "msgmerge for $$lang.gmo failed!"; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ fi; \
+ done
+
+Makefile POTFILES: stamp-it
+ @if test ! -f $@; then \
+ rm -f stamp-it; \
+ $(MAKE) stamp-it; \
+ fi
+
+stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
+ $(SHELL) ./config.status
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..ba8a93d
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,26 @@
+# List of source files containing translatable strings.
+
+## Created by Anjuta - will be overwritten
+## If you don't want it to overwrite it,
+## Please disable it in the Anjuta project configuration
+
+# Source files
+src/glade/lingot-config-dialog.glade
+src/glade/lingot-mainframe.glade
+src/lingot-fft.c
+src/lingot-audio.c
+src/lingot-audio-oss.c
+src/lingot-audio-alsa.c
+src/lingot-audio-jack.c
+src/lingot-config.c
+src/lingot-config-scale.c
+src/lingot-core.c
+src/lingot-gauge.c
+src/lingot-gui-mainframe.c
+src/lingot-gui-config-dialog.c
+src/lingot-gui-config-dialog-scale.c
+src/lingot-filter.c
+src/lingot-signal.c
+src/lingot.c
+
+
diff --git a/po/ca.po b/po/ca.po
new file mode 100644
index 0000000..dba72b3
--- /dev/null
+++ b/po/ca.po
@@ -0,0 +1,702 @@
+# Catalan translation for Lingot 0.7.4
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the lingot package.
+# Raül Cambeiro <rulet@menta.net>, 2007.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: lingot\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-02-21 17:10+0000\n"
+"PO-Revision-Date: 2007-10-02 19:00+0200\n"
+"Last-Translator: Raül Cambeiro <rulet@menta.net>\n"
+"Language-Team: Catalan <ca@li.org>\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../src/glade/lingot-config-dialog.glade.h:1
+msgid ""
+"Adds a new note to the list, just above the selected line, or appends it to "
+"the end if no line is selected. Is not possible to add a note before the "
+"reference (the first) one. You can also use the Insert key on the table "
+"beside."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:2
+msgid "Adjustments"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:3
+msgid "Advanced"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:4
+msgid ""
+"Advanced settings on the frequency finding algorithm. You should not modify "
+"these parameters unless you really need it and you have a good understanding "
+"of the algorithm. Use the 'Default' button if you get lost, and use those "
+"default parameters as your reference."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:5
+msgid ""
+"After having chosen the fundamental peak on the FFT, Lingot computes a "
+"series of N (being N this parameter) DFTs localized in frequency to enclose "
+"the fundamental frequency."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:6
+msgid ""
+"All the peaks with an amplitude difference with the highest one greater than "
+"this parameter will be rejected as a candidate to host the fundamental "
+"frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:7
+msgid ""
+"Allows you to adapt the signal levels without the aid of an external mixer."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:8
+msgid ""
+"Any signal level below this value will be considered as noise. This noise "
+"level is depicted in the spectrum area as a yellow dotted line."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:9
+msgid ""
+"Applies a shift in frequency to all the notes defined in the table above."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:10
+msgid "Apply the current changes and modify the congifuration file."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:11
+msgid ""
+"Apply the current changes to the running tuner, but doesn't modify the "
+"configuration file."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:12
+msgid "Audio device"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:13
+msgid "Audio input settings. Set here the source and hardware settings."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:14
+msgid "Audio system"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:15
+msgid "Basic"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:16
+msgid ""
+"Basic settings on the frequency finding algorithm. Come here to get better "
+"accuracy, frequency range or CPU usage. "
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:17
+msgid "Calculation rate"
+msgstr "Taxa de càlcul"
+
+#: ../src/glade/lingot-config-dialog.glade.h:18
+msgid "Capture"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:19
+msgid ""
+"Choose the audio device if you have more than one. You cannot modify this "
+"field if you are using JACK, but you can connect Lingot to a desired source "
+"externally."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:20
+msgid ""
+"Choose the hardware sample rate here. We give you some examples, but you can "
+"choose another one. Please, be aware that depending on the audio system and/"
+"or device, not all the sampling frequencies are available. Anyway, you can "
+"get close to your desired effective sample rate by combining this parameter "
+"with the oversampling factor (Basic tab). If you are using JACK, you cannot "
+"modify this field, but you can change it externally (in the JACK server "
+"configuration)."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:21
+msgid "DFT number"
+msgstr "Nombre de DFT"
+
+#: ../src/glade/lingot-config-dialog.glade.h:22
+msgid "DFT size"
+msgstr "Mida de la DFT"
+
+#: ../src/glade/lingot-config-dialog.glade.h:23
+msgid "DFTs"
+msgstr "DFT"
+
+#: ../src/glade/lingot-config-dialog.glade.h:24
+msgid "Default"
+msgstr "Configuració per defecte"
+
+#: ../src/glade/lingot-config-dialog.glade.h:25
+msgid "Delete"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:26
+msgid ""
+"Deletes the selected notes. The reference note, i.e., the first one, cannot "
+"be removed. You can also use the Delete key on the table beside."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:27
+#: ../src/glade/lingot-mainframe.glade.h:3
+msgid "Deviation"
+msgstr "Desviació"
+
+#: ../src/glade/lingot-config-dialog.glade.h:28
+msgid "Effective sample rate"
+msgstr "Taxa de mostreig"
+
+#: ../src/glade/lingot-config-dialog.glade.h:29
+msgid ""
+"Effective sampling frequency. The lower this parameter is, the more accurate "
+"the FFT will be, and hence the better is the hooking up to the correct peak. "
+"Remember, however, that your temporal window will increase, and the fact "
+"that you won't be able to tune frequencies above the half of this frequency "
+"(Nyquist-Shannon sampling theorem)."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:30
+msgid "FFT size"
+msgstr "Mida de l'FFT"
+
+#: ../src/glade/lingot-config-dialog.glade.h:31
+msgid "Gain"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:32
+msgid "Hardware sampling frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:33
+msgid "Here you can pick the sound system."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:34
+msgid "Hz"
+msgstr "Hz"
+
+#: ../src/glade/lingot-config-dialog.glade.h:35
+msgid "Import"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:36
+msgid ""
+"Imports the scale from an external .scl file, with the Scala project format "
+"(http://www.huygens-fokker.org/scala/)"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:37
+msgid "Insert"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:38
+msgid ""
+"Lingot is an universal tuner, it can tune any instrument according to the "
+"scale you define here."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:39
+msgid "Lingot only considers frequencies above this one."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:40
+msgid "Minimum frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:41
+#: ../src/lingot-gui-config-dialog-scale.c:322
+msgid "Name"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:42
+msgid "Noise threshold"
+msgstr "Llindar de soroll"
+
+#: ../src/glade/lingot-config-dialog.glade.h:43
+msgid "Number of calculations of the fundamental frequency per second."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:44
+msgid ""
+"Number of main peaks considered over the FFT. Remember that sometimes the "
+"first harmonics can have a higher amplitude than the fundamental component, "
+"depending on your instrument."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:45
+msgid ""
+"Number of samples needed by a peak at each side, lower in amplitude than the "
+"sample at the center, to be considered as a peak. You should not consider "
+"more than 1 or 2 samples, unless you have a really big FFT buffer."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:46
+msgid "Number of samples of each DFT."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:47
+msgid ""
+"Number of visualizations per second of the (last) computed frequency, error "
+"and spectrum. "
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:48
+msgid "Oversampling factor"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:49
+msgid "Peak half-width"
+msgstr "Ordre de pic"
+
+#: ../src/glade/lingot-config-dialog.glade.h:50
+msgid "Peak number"
+msgstr "Nombre de pics"
+
+#: ../src/glade/lingot-config-dialog.glade.h:51
+msgid "Peak rejection relation"
+msgstr "Relació de rebuig entre pics"
+
+#: ../src/glade/lingot-config-dialog.glade.h:52
+msgid "Quick adjusments on the dynamic response and the signal levels."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:53
+msgid "Resets the built-in settings, without applying them."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:54
+msgid ""
+"Rolls back all the previous applied changes and closes the configuration "
+"dialog."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:55
+msgid "Sample rate"
+msgstr "Taxa de mostreig"
+
+#: ../src/glade/lingot-config-dialog.glade.h:56
+msgid "Scale"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:57
+msgid "Scale name, only for your information."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:58
+msgid "Temporal window"
+msgstr "Finestra temporal"
+
+#: ../src/glade/lingot-config-dialog.glade.h:59
+msgid ""
+"The FFT buffer gives Lingot a first look to the spectrum. Higher values can "
+"help Lingot to hook up the correct peak, but it's also computationally more "
+"expensive. Don't use high values here unless you have an equally high "
+"effective sample rate."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:60
+msgid ""
+"This is the most recent amount of data considered for tuning. The longer it "
+"is, the more accuracy you can obtain, but also the dynamic response gets "
+"lower, because you are considering older parts of the signal. Also, if you "
+"raise this parameter, the computational cost increases. This value, in "
+"samples (depending on the effective sample rate), must be greater or equal "
+"to the FFT buffer size."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:61
+msgid "Visualization rate"
+msgstr "Taxa de visualització"
+
+#: ../src/glade/lingot-config-dialog.glade.h:62
+msgid "cents"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:63
+msgid "dB"
+msgstr "dB"
+
+#: ../src/glade/lingot-config-dialog.glade.h:64
+msgid "lingot configuration"
+msgstr "Configuració del Lingot"
+
+#: ../src/glade/lingot-config-dialog.glade.h:65
+msgid "peaks"
+msgstr "pics"
+
+#: ../src/glade/lingot-config-dialog.glade.h:66
+msgid "samples"
+msgstr "mostres"
+
+#: ../src/glade/lingot-config-dialog.glade.h:67
+msgid "seconds"
+msgstr "segons"
+
+#: ../src/glade/lingot-mainframe.glade.h:1
+msgid "---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:2
+msgid ""
+"Closest note to the estimated frequency, according to the scale defined in "
+"the Lingot settings."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:4
+msgid ""
+"Error in cents between the estimated frequency and the closest note "
+"according to the scale defined in the Lingot settings."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:5
+msgid "Estimated fundamental frequency in hertzs."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:6
+msgid "Opens an external configuration file."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:7
+msgid "Saves the running configuration to an external file."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:8
+#, fuzzy
+msgid "Show spectrum"
+msgstr "Espectre"
+
+#: ../src/glade/lingot-mainframe.glade.h:9
+msgid ""
+"Shows the error in cents in a visual way. The range will depend on the "
+"maximum distance between each two notes in the scale defined in the Lingot "
+"settings (try to provide scales with low maximum distance, i.e. with many "
+"notes, to have a higher resolution in this gauge),"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:10
+msgid "Spectrum"
+msgstr "Espectre"
+
+#: ../src/glade/lingot-mainframe.glade.h:11
+msgid ""
+"This area shows the spectral power density of the captured signal. The "
+"fundamental frequency is shown with a red dot, and the noise threshold with "
+"a horizontal dotted yellow line. If you have a large FFT buffer (with more "
+"than 512 samples), you can browse through the whole spectrum with a "
+"horizontal scrollbar."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:12
+msgid "Tone"
+msgstr "Nota"
+
+#: ../src/glade/lingot-mainframe.glade.h:13
+#, fuzzy
+msgid "_Edit"
+msgstr "_Edita"
+
+#: ../src/glade/lingot-mainframe.glade.h:14
+msgid "_File"
+msgstr "_Fitxer"
+
+#: ../src/glade/lingot-mainframe.glade.h:15
+msgid "_Help"
+msgstr "A_juda"
+
+#: ../src/glade/lingot-mainframe.glade.h:16
+msgid "_View"
+msgstr "_Visualitza"
+
+#: ../src/glade/lingot-mainframe.glade.h:17
+msgid "e = ---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:18
+msgid "f = ---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:19
+msgid "lingot"
+msgstr "Lingot"
+
+#: ../src/lingot-audio-oss.c:56
+#, c-format
+msgid ""
+"Unable to open audio device %s.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:63
+#, c-format
+msgid ""
+"Error setting number of channels.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:71
+#, c-format
+msgid ""
+"Error setting bits per sample.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:86
+#, c-format
+msgid ""
+"Error setting DMA buffer size.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:92
+#, fuzzy, c-format
+msgid ""
+"Error setting sample rate.\n"
+"%s."
+msgstr "Taxa de mostreig"
+
+#: ../src/lingot-audio-oss.c:132 ../src/lingot-audio-alsa.c:167
+#, c-format
+msgid ""
+"Read from audio interface failed.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-alsa.c:139
+msgid "The application has not been built with ALSA support"
+msgstr ""
+
+#: ../src/lingot-audio-jack.c:61
+msgid "Missing connection with JACK audio server"
+msgstr ""
+
+#: ../src/lingot-audio-jack.c:90 ../src/lingot-audio-jack.c:190
+msgid "Unable to connect to JACK server"
+msgstr ""
+
+#: ../src/lingot-audio-jack.c:115
+msgid "No more JACK ports available"
+msgstr ""
+
+#: ../src/lingot-audio-jack.c:133 ../src/lingot-audio-jack.c:247
+#: ../src/lingot-audio-jack.c:314 ../src/lingot-audio-jack.c:346
+msgid "The application has not been built with JACK support"
+msgstr ""
+
+#: ../src/lingot-audio-jack.c:265
+msgid "Cannot activate client"
+msgstr ""
+
+#: ../src/lingot-audio-jack.c:271
+msgid "No active capture ports"
+msgstr ""
+
+#: ../src/lingot-audio-jack.c:282 ../src/lingot-audio-jack.c:302
+msgid "Cannot connect input ports"
+msgstr ""
+
+#: ../src/lingot-audio-jack.c:297
+msgid "No physical capture ports"
+msgstr ""
+
+#: ../src/lingot-config.c:436
+#, c-format
+msgid ""
+"Error parsing the configuration file, line %i: unrecognized audio system "
+"'%s', assuming default audio system.\n"
+msgstr ""
+
+#: ../src/lingot-config.c:452
+msgid ""
+"The configuration file contains errors, and hence some default values have "
+"been chosen. Consider checking the settings and fixing the problem using the "
+"configuration dialog."
+msgstr ""
+
+#: ../src/lingot-core.c:86
+#, c-format
+msgid ""
+"The requested sample rate is not available, the real sample rate has been "
+"set to %d Hz"
+msgstr ""
+
+#: ../src/lingot-core.c:99
+#, c-format
+msgid ""
+"The temporal buffer is smaller than FFT size. It has been increased to %0.3f "
+"seconds"
+msgstr ""
+"La memòria intermèdia temporal és menor que la mida de l'FFT. S'ha augmentat "
+"a %0.3f segons."
+
+#: ../src/lingot-gui-mainframe.c:100
+msgid "Accurate and easy to use musical instrument tuner"
+msgstr "Afinador d'instruments musicals precís i fàcil de fer anar"
+
+#: ../src/lingot-gui-mainframe.c:104
+msgid "translator-credits"
+msgstr "Raúl Cambeiro <rulet@menta.net>, 2007"
+
+#: ../src/lingot-gui-mainframe.c:247
+msgid "Error"
+msgstr ""
+
+#: ../src/lingot-gui-mainframe.c:248
+msgid "Warning"
+msgstr ""
+
+#: ../src/lingot-gui-mainframe.c:248
+msgid "Info"
+msgstr ""
+
+#: ../src/lingot-gui-mainframe.c:267
+#, fuzzy
+msgid "Open Configuration File"
+msgstr "Configuració del Lingot"
+
+#: ../src/lingot-gui-mainframe.c:275 ../src/lingot-gui-mainframe.c:318
+#, fuzzy
+msgid "Lingot configuration files"
+msgstr "Configuració del Lingot"
+
+#: ../src/lingot-gui-mainframe.c:307
+#, fuzzy
+msgid "Save Configuration File"
+msgstr "Configuració del Lingot"
+
+#: ../src/lingot-gui-config-dialog.c:311
+msgid ""
+"The provided scale contains wide gaps in frequency that increase the gauge "
+"range and produce a loss of visual accuracy. Consider providing scales with "
+"at least 12 tones, or with a maximum distance between adjacent notes below "
+"200 cents."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:84
+msgid "You cannot insert before the reference note."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:210
+msgid "Do not use space characters for the note names."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:213
+msgid "The name contains illegal characters."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:230
+msgid "You cannot change the first shift, it must be 1/1."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:237
+msgid "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:339
+msgid "Shift"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:360
+msgid "Frequency [Hz]"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:417
+msgid "There are notes with the same name"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:431
+msgid ""
+"There are invalid values in the scale: the notes should be ordered by "
+"frequency / shift"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:438
+msgid ""
+"There are invalid values in the scale: all the notes should be in the same "
+"octave"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:447
+msgid "There are notes without name"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:511
+msgid "Open Scale File"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:519
+msgid "Scala files"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:539
+msgid "The scale cannot be imported: file format error"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:605
+msgid ""
+"Note identifier, free text that will be displayed in the main window when "
+"tuning close to the given note. Don't use space characters here."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:610
+msgid ""
+"Shift. You can define it as a deviation in cents from the reference note "
+"(the first one), or as a frequency ratio, like '3/2' or '5/4'. All the "
+"values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all "
+"the notes must be in the same octave), and they must be well ordered."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:615
+msgid ""
+"Frequency. You can enter here the absolute frequency for a given note as a "
+"reference, and all the other frequencies will shift according to the "
+"deviations specified in the 'Shift' column. You can use an absolute numeric "
+"value or the keywords 'mid-C' (261.625565 Hz) and 'mid-A' (440 Hz)."
+msgstr ""
+
+#~ msgid "Root frequency"
+#~ msgstr "Freqüència base"
+
+#~ msgid "freq"
+#~ msgstr "freq"
+
+#~ msgid "err"
+#~ msgstr "err"
+
+#, fuzzy
+#~ msgid "440 (A) +"
+#~ msgstr " A (440 Hz) + "
+
+#~ msgid "General parameters"
+#~ msgstr "Paràmetres generals"
+
+#~ msgid "Advanced parameters"
+#~ msgstr "Paràmetres avançats"
+
+#~ msgid "Options"
+#~ msgstr "Opcions"
+
+#~ msgid "Quit"
+#~ msgstr "Surt"
+
+#~ msgid "About"
+#~ msgstr "Quant a"
+
+#~ msgid "Tuner"
+#~ msgstr "Afinador"
diff --git a/po/cs.po b/po/cs.po
new file mode 100644
index 0000000..b4b0ce0
--- /dev/null
+++ b/po/cs.po
@@ -0,0 +1,698 @@
+# translation of cs.po to Czech
+# Copyright (C) 2008 Karel Volný
+# This file is distributed under the same license as the lingot package.
+#
+# Karel Volný <kavol@seznam.cz>, 2008, 2009.
+msgid ""
+msgstr ""
+"Project-Id-Version: cs\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-02-21 17:10+0000\n"
+"PO-Revision-Date: 2009-08-14 17:00+0200\n"
+"Last-Translator: Karel Volný <kavol@seznam.cz>\n"
+"Language-Team: Czech <diskuze@lists.l10n.cz>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Lokalize 1.0\n"
+"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
+
+#: ../src/glade/lingot-config-dialog.glade.h:1
+msgid ""
+"Adds a new note to the list, just above the selected line, or appends it to "
+"the end if no line is selected. Is not possible to add a note before the "
+"reference (the first) one. You can also use the Insert key on the table "
+"beside."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:2
+msgid "Adjustments"
+msgstr "Nastavení"
+
+#: ../src/glade/lingot-config-dialog.glade.h:3
+msgid "Advanced"
+msgstr "Pokročilé"
+
+#: ../src/glade/lingot-config-dialog.glade.h:4
+msgid ""
+"Advanced settings on the frequency finding algorithm. You should not modify "
+"these parameters unless you really need it and you have a good understanding "
+"of the algorithm. Use the 'Default' button if you get lost, and use those "
+"default parameters as your reference."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:5
+msgid ""
+"After having chosen the fundamental peak on the FFT, Lingot computes a "
+"series of N (being N this parameter) DFTs localized in frequency to enclose "
+"the fundamental frequency."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:6
+msgid ""
+"All the peaks with an amplitude difference with the highest one greater than "
+"this parameter will be rejected as a candidate to host the fundamental "
+"frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:7
+msgid ""
+"Allows you to adapt the signal levels without the aid of an external mixer."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:8
+msgid ""
+"Any signal level below this value will be considered as noise. This noise "
+"level is depicted in the spectrum area as a yellow dotted line."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:9
+msgid ""
+"Applies a shift in frequency to all the notes defined in the table above."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:10
+msgid "Apply the current changes and modify the congifuration file."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:11
+msgid ""
+"Apply the current changes to the running tuner, but doesn't modify the "
+"configuration file."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:12
+#, fuzzy
+msgid "Audio device"
+msgstr "Zvukové zařízení"
+
+#: ../src/glade/lingot-config-dialog.glade.h:13
+msgid "Audio input settings. Set here the source and hardware settings."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:14
+msgid "Audio system"
+msgstr "Ovladač"
+
+#: ../src/glade/lingot-config-dialog.glade.h:15
+msgid "Basic"
+msgstr "Základní"
+
+#: ../src/glade/lingot-config-dialog.glade.h:16
+msgid ""
+"Basic settings on the frequency finding algorithm. Come here to get better "
+"accuracy, frequency range or CPU usage. "
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:17
+msgid "Calculation rate"
+msgstr "Frekvence výpočtů"
+
+#: ../src/glade/lingot-config-dialog.glade.h:18
+msgid "Capture"
+msgstr "Vstup"
+
+#: ../src/glade/lingot-config-dialog.glade.h:19
+msgid ""
+"Choose the audio device if you have more than one. You cannot modify this "
+"field if you are using JACK, but you can connect Lingot to a desired source "
+"externally."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:20
+msgid ""
+"Choose the hardware sample rate here. We give you some examples, but you can "
+"choose another one. Please, be aware that depending on the audio system and/"
+"or device, not all the sampling frequencies are available. Anyway, you can "
+"get close to your desired effective sample rate by combining this parameter "
+"with the oversampling factor (Basic tab). If you are using JACK, you cannot "
+"modify this field, but you can change it externally (in the JACK server "
+"configuration)."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:21
+msgid "DFT number"
+msgstr "Počet DFT"
+
+#: ../src/glade/lingot-config-dialog.glade.h:22
+msgid "DFT size"
+msgstr "Rozsah DFT"
+
+#: ../src/glade/lingot-config-dialog.glade.h:23
+msgid "DFTs"
+msgstr "DFT"
+
+#: ../src/glade/lingot-config-dialog.glade.h:24
+msgid "Default"
+msgstr "Výchozí nastavení"
+
+#: ../src/glade/lingot-config-dialog.glade.h:25
+msgid "Delete"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:26
+msgid ""
+"Deletes the selected notes. The reference note, i.e., the first one, cannot "
+"be removed. You can also use the Delete key on the table beside."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:27
+#: ../src/glade/lingot-mainframe.glade.h:3
+msgid "Deviation"
+msgstr "Odchylka"
+
+#: ../src/glade/lingot-config-dialog.glade.h:28
+msgid "Effective sample rate"
+msgstr "Vzorkovací kmitočet"
+
+#: ../src/glade/lingot-config-dialog.glade.h:29
+msgid ""
+"Effective sampling frequency. The lower this parameter is, the more accurate "
+"the FFT will be, and hence the better is the hooking up to the correct peak. "
+"Remember, however, that your temporal window will increase, and the fact "
+"that you won't be able to tune frequencies above the half of this frequency "
+"(Nyquist-Shannon sampling theorem)."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:30
+msgid "FFT size"
+msgstr "Rozsah FFT"
+
+#: ../src/glade/lingot-config-dialog.glade.h:31
+msgid "Gain"
+msgstr "Zisk"
+
+#: ../src/glade/lingot-config-dialog.glade.h:32
+msgid "Hardware sampling frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:33
+msgid "Here you can pick the sound system."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:34
+msgid "Hz"
+msgstr "Hz"
+
+#: ../src/glade/lingot-config-dialog.glade.h:35
+msgid "Import"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:36
+msgid ""
+"Imports the scale from an external .scl file, with the Scala project format "
+"(http://www.huygens-fokker.org/scala/)"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:37
+msgid "Insert"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:38
+msgid ""
+"Lingot is an universal tuner, it can tune any instrument according to the "
+"scale you define here."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:39
+msgid "Lingot only considers frequencies above this one."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:40
+#, fuzzy
+msgid "Minimum frequency"
+msgstr "Nejnižší kmitočet"
+
+#: ../src/glade/lingot-config-dialog.glade.h:41
+#: ../src/lingot-gui-config-dialog-scale.c:322
+msgid "Name"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:42
+msgid "Noise threshold"
+msgstr "Práh šumu"
+
+#: ../src/glade/lingot-config-dialog.glade.h:43
+msgid "Number of calculations of the fundamental frequency per second."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:44
+msgid ""
+"Number of main peaks considered over the FFT. Remember that sometimes the "
+"first harmonics can have a higher amplitude than the fundamental component, "
+"depending on your instrument."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:45
+msgid ""
+"Number of samples needed by a peak at each side, lower in amplitude than the "
+"sample at the center, to be considered as a peak. You should not consider "
+"more than 1 or 2 samples, unless you have a really big FFT buffer."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:46
+msgid "Number of samples of each DFT."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:47
+msgid ""
+"Number of visualizations per second of the (last) computed frequency, error "
+"and spectrum. "
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:48
+msgid "Oversampling factor"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:49
+msgid "Peak half-width"
+msgstr "Trvání špičky"
+
+#: ../src/glade/lingot-config-dialog.glade.h:50
+msgid "Peak number"
+msgstr "Počet špiček"
+
+#: ../src/glade/lingot-config-dialog.glade.h:51
+msgid "Peak rejection relation"
+msgstr "Maximální rozdíl špiček"
+
+#: ../src/glade/lingot-config-dialog.glade.h:52
+msgid "Quick adjusments on the dynamic response and the signal levels."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:53
+msgid "Resets the built-in settings, without applying them."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:54
+msgid ""
+"Rolls back all the previous applied changes and closes the configuration "
+"dialog."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:55
+msgid "Sample rate"
+msgstr "Vzorkovací kmitočet"
+
+#: ../src/glade/lingot-config-dialog.glade.h:56
+msgid "Scale"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:57
+msgid "Scale name, only for your information."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:58
+msgid "Temporal window"
+msgstr "Interval pro analýzu"
+
+#: ../src/glade/lingot-config-dialog.glade.h:59
+msgid ""
+"The FFT buffer gives Lingot a first look to the spectrum. Higher values can "
+"help Lingot to hook up the correct peak, but it's also computationally more "
+"expensive. Don't use high values here unless you have an equally high "
+"effective sample rate."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:60
+msgid ""
+"This is the most recent amount of data considered for tuning. The longer it "
+"is, the more accuracy you can obtain, but also the dynamic response gets "
+"lower, because you are considering older parts of the signal. Also, if you "
+"raise this parameter, the computational cost increases. This value, in "
+"samples (depending on the effective sample rate), must be greater or equal "
+"to the FFT buffer size."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:61
+msgid "Visualization rate"
+msgstr "Obnovovací frekvence"
+
+#: ../src/glade/lingot-config-dialog.glade.h:62
+msgid "cents"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:63
+msgid "dB"
+msgstr "dB"
+
+#: ../src/glade/lingot-config-dialog.glade.h:64
+msgid "lingot configuration"
+msgstr "Nastavení lingot"
+
+#: ../src/glade/lingot-config-dialog.glade.h:65
+msgid "peaks"
+msgstr "špiček"
+
+#: ../src/glade/lingot-config-dialog.glade.h:66
+msgid "samples"
+msgstr "vzorků"
+
+#: ../src/glade/lingot-config-dialog.glade.h:67
+msgid "seconds"
+msgstr "s"
+
+#: ../src/glade/lingot-mainframe.glade.h:1
+msgid "---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:2
+msgid ""
+"Closest note to the estimated frequency, according to the scale defined in "
+"the Lingot settings."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:4
+msgid ""
+"Error in cents between the estimated frequency and the closest note "
+"according to the scale defined in the Lingot settings."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:5
+msgid "Estimated fundamental frequency in hertzs."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:6
+msgid "Opens an external configuration file."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:7
+msgid "Saves the running configuration to an external file."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:8
+#, fuzzy
+msgid "Show spectrum"
+msgstr "Spektrum"
+
+#: ../src/glade/lingot-mainframe.glade.h:9
+msgid ""
+"Shows the error in cents in a visual way. The range will depend on the "
+"maximum distance between each two notes in the scale defined in the Lingot "
+"settings (try to provide scales with low maximum distance, i.e. with many "
+"notes, to have a higher resolution in this gauge),"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:10
+msgid "Spectrum"
+msgstr "Spektrum"
+
+#: ../src/glade/lingot-mainframe.glade.h:11
+msgid ""
+"This area shows the spectral power density of the captured signal. The "
+"fundamental frequency is shown with a red dot, and the noise threshold with "
+"a horizontal dotted yellow line. If you have a large FFT buffer (with more "
+"than 512 samples), you can browse through the whole spectrum with a "
+"horizontal scrollbar."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:12
+msgid "Tone"
+msgstr "Tón"
+
+#: ../src/glade/lingot-mainframe.glade.h:13
+#, fuzzy
+msgid "_Edit"
+msgstr "Úp_ravy"
+
+#: ../src/glade/lingot-mainframe.glade.h:14
+msgid "_File"
+msgstr "_Soubor"
+
+#: ../src/glade/lingot-mainframe.glade.h:15
+msgid "_Help"
+msgstr "_Nápověda"
+
+#: ../src/glade/lingot-mainframe.glade.h:16
+msgid "_View"
+msgstr "_Zobrazení"
+
+#: ../src/glade/lingot-mainframe.glade.h:17
+msgid "e = ---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:18
+msgid "f = ---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:19
+msgid "lingot"
+msgstr "lingot"
+
+#: ../src/lingot-audio-oss.c:56
+#, c-format
+msgid ""
+"Unable to open audio device %s.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:63
+#, c-format
+msgid ""
+"Error setting number of channels.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:71
+#, c-format
+msgid ""
+"Error setting bits per sample.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:86
+#, c-format
+msgid ""
+"Error setting DMA buffer size.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:92
+#, fuzzy, c-format
+msgid ""
+"Error setting sample rate.\n"
+"%s."
+msgstr "Vzorkovací kmitočet"
+
+#: ../src/lingot-audio-oss.c:132 ../src/lingot-audio-alsa.c:167
+#, c-format
+msgid ""
+"Read from audio interface failed.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-alsa.c:139
+msgid "The application has not been built with ALSA support"
+msgstr "Aplikace nebyla sestavena s podporou pro ALSA"
+
+#: ../src/lingot-audio-jack.c:61
+msgid "Missing connection with JACK audio server"
+msgstr "Chybí spojení se zvukovým serverem JACK"
+
+#: ../src/lingot-audio-jack.c:90 ../src/lingot-audio-jack.c:190
+msgid "Unable to connect to JACK server"
+msgstr "Nelze se připojit k serveru JACK"
+
+#: ../src/lingot-audio-jack.c:115
+msgid "No more JACK ports available"
+msgstr "Nejsou dostupné žádné další porty systému JACK"
+
+#: ../src/lingot-audio-jack.c:133 ../src/lingot-audio-jack.c:247
+#: ../src/lingot-audio-jack.c:314 ../src/lingot-audio-jack.c:346
+msgid "The application has not been built with JACK support"
+msgstr "Aplikace nebyla sestavena s podporou pro JACK"
+
+#: ../src/lingot-audio-jack.c:265
+msgid "Cannot activate client"
+msgstr "Nelze aktivovat klienta"
+
+#: ../src/lingot-audio-jack.c:271
+#, fuzzy
+msgid "No active capture ports"
+msgstr "Žádné fyzické vstupní porty"
+
+#: ../src/lingot-audio-jack.c:282 ../src/lingot-audio-jack.c:302
+msgid "Cannot connect input ports"
+msgstr "Nelze připojit vstupní porty"
+
+#: ../src/lingot-audio-jack.c:297
+msgid "No physical capture ports"
+msgstr "Žádné fyzické vstupní porty"
+
+#: ../src/lingot-config.c:436
+#, c-format
+msgid ""
+"Error parsing the configuration file, line %i: unrecognized audio system "
+"'%s', assuming default audio system.\n"
+msgstr ""
+
+#: ../src/lingot-config.c:452
+msgid ""
+"The configuration file contains errors, and hence some default values have "
+"been chosen. Consider checking the settings and fixing the problem using the "
+"configuration dialog."
+msgstr ""
+
+#: ../src/lingot-core.c:86
+#, c-format
+msgid ""
+"The requested sample rate is not available, the real sample rate has been "
+"set to %d Hz"
+msgstr ""
+
+#: ../src/lingot-core.c:99
+#, c-format
+msgid ""
+"The temporal buffer is smaller than FFT size. It has been increased to %0.3f "
+"seconds"
+msgstr ""
+"Interval pro analýzu je menší než je třeba pro FFT, a proto byl zvýšen na "
+"%0.3f s."
+
+#: ../src/lingot-gui-mainframe.c:100
+msgid "Accurate and easy to use musical instrument tuner"
+msgstr "Přesná a snadno použitelná ladička hudebních nástrojů"
+
+#: ../src/lingot-gui-mainframe.c:104
+msgid "translator-credits"
+msgstr "Karel Volný <kavol@seznam.cz>"
+
+#: ../src/lingot-gui-mainframe.c:247
+msgid "Error"
+msgstr "Chyba"
+
+#: ../src/lingot-gui-mainframe.c:248
+msgid "Warning"
+msgstr "Upozornění"
+
+#: ../src/lingot-gui-mainframe.c:248
+msgid "Info"
+msgstr ""
+
+#: ../src/lingot-gui-mainframe.c:267
+#, fuzzy
+msgid "Open Configuration File"
+msgstr "Nastavení lingot"
+
+#: ../src/lingot-gui-mainframe.c:275 ../src/lingot-gui-mainframe.c:318
+#, fuzzy
+msgid "Lingot configuration files"
+msgstr "Nastavení lingot"
+
+#: ../src/lingot-gui-mainframe.c:307
+#, fuzzy
+msgid "Save Configuration File"
+msgstr "Nastavení lingot"
+
+#: ../src/lingot-gui-config-dialog.c:311
+msgid ""
+"The provided scale contains wide gaps in frequency that increase the gauge "
+"range and produce a loss of visual accuracy. Consider providing scales with "
+"at least 12 tones, or with a maximum distance between adjacent notes below "
+"200 cents."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:84
+msgid "You cannot insert before the reference note."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:210
+msgid "Do not use space characters for the note names."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:213
+msgid "The name contains illegal characters."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:230
+msgid "You cannot change the first shift, it must be 1/1."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:237
+msgid "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:339
+msgid "Shift"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:360
+msgid "Frequency [Hz]"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:417
+msgid "There are notes with the same name"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:431
+msgid ""
+"There are invalid values in the scale: the notes should be ordered by "
+"frequency / shift"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:438
+msgid ""
+"There are invalid values in the scale: all the notes should be in the same "
+"octave"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:447
+msgid "There are notes without name"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:511
+msgid "Open Scale File"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:519
+msgid "Scala files"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:539
+msgid "The scale cannot be imported: file format error"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:605
+msgid ""
+"Note identifier, free text that will be displayed in the main window when "
+"tuning close to the given note. Don't use space characters here."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:610
+msgid ""
+"Shift. You can define it as a deviation in cents from the reference note "
+"(the first one), or as a frequency ratio, like '3/2' or '5/4'. All the "
+"values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all "
+"the notes must be in the same octave), and they must be well ordered."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:615
+msgid ""
+"Frequency. You can enter here the absolute frequency for a given note as a "
+"reference, and all the other frequencies will shift according to the "
+"deviations specified in the 'Shift' column. You can use an absolute numeric "
+"value or the keywords 'mid-C' (261.625565 Hz) and 'mid-A' (440 Hz)."
+msgstr ""
+
+#~ msgid "Root frequency"
+#~ msgstr "Základní kmitočet"
+
+#~ msgid "freq"
+#~ msgstr "frekvence"
+
+#~ msgid "err"
+#~ msgstr "chyba"
+
+#, fuzzy
+#~ msgid "440 (A) +"
+#~ msgstr " a' (440 Hz) +"
+
+#~ msgid "General parameters"
+#~ msgstr "Obecné"
+
+#~ msgid "Advanced parameters"
+#~ msgstr "Pokročilé"
+
+#~ msgid "Matthew Blissett (Logo design)"
+#~ msgstr "Matthew Blissett (Design loga)"
diff --git a/po/de.po b/po/de.po
new file mode 100644
index 0000000..e33439e
--- /dev/null
+++ b/po/de.po
@@ -0,0 +1,689 @@
+# German translation of lingot
+# Copyright (C) 2008 Ibán Cereijo Graña
+# This file is distributed under the same license as the lingot package.
+# Roland Stigge <stigge@antcom.de>, 2008.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: 0.7.6\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-02-21 17:10+0000\n"
+"PO-Revision-Date: 2008-01-12 17:23:00+0100\n"
+"Last-Translator: Roland Stigge <stigge@antcom.de>\n"
+"Language-Team: German <de@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../src/glade/lingot-config-dialog.glade.h:1
+msgid ""
+"Adds a new note to the list, just above the selected line, or appends it to "
+"the end if no line is selected. Is not possible to add a note before the "
+"reference (the first) one. You can also use the Insert key on the table "
+"beside."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:2
+msgid "Adjustments"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:3
+msgid "Advanced"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:4
+msgid ""
+"Advanced settings on the frequency finding algorithm. You should not modify "
+"these parameters unless you really need it and you have a good understanding "
+"of the algorithm. Use the 'Default' button if you get lost, and use those "
+"default parameters as your reference."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:5
+msgid ""
+"After having chosen the fundamental peak on the FFT, Lingot computes a "
+"series of N (being N this parameter) DFTs localized in frequency to enclose "
+"the fundamental frequency."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:6
+msgid ""
+"All the peaks with an amplitude difference with the highest one greater than "
+"this parameter will be rejected as a candidate to host the fundamental "
+"frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:7
+msgid ""
+"Allows you to adapt the signal levels without the aid of an external mixer."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:8
+msgid ""
+"Any signal level below this value will be considered as noise. This noise "
+"level is depicted in the spectrum area as a yellow dotted line."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:9
+msgid ""
+"Applies a shift in frequency to all the notes defined in the table above."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:10
+msgid "Apply the current changes and modify the congifuration file."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:11
+msgid ""
+"Apply the current changes to the running tuner, but doesn't modify the "
+"configuration file."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:12
+msgid "Audio device"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:13
+msgid "Audio input settings. Set here the source and hardware settings."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:14
+msgid "Audio system"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:15
+msgid "Basic"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:16
+msgid ""
+"Basic settings on the frequency finding algorithm. Come here to get better "
+"accuracy, frequency range or CPU usage. "
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:17
+msgid "Calculation rate"
+msgstr "Berechnungstempo"
+
+#: ../src/glade/lingot-config-dialog.glade.h:18
+msgid "Capture"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:19
+msgid ""
+"Choose the audio device if you have more than one. You cannot modify this "
+"field if you are using JACK, but you can connect Lingot to a desired source "
+"externally."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:20
+msgid ""
+"Choose the hardware sample rate here. We give you some examples, but you can "
+"choose another one. Please, be aware that depending on the audio system and/"
+"or device, not all the sampling frequencies are available. Anyway, you can "
+"get close to your desired effective sample rate by combining this parameter "
+"with the oversampling factor (Basic tab). If you are using JACK, you cannot "
+"modify this field, but you can change it externally (in the JACK server "
+"configuration)."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:21
+msgid "DFT number"
+msgstr "DFT-Zahl"
+
+#: ../src/glade/lingot-config-dialog.glade.h:22
+msgid "DFT size"
+msgstr "DFT-Größe"
+
+#: ../src/glade/lingot-config-dialog.glade.h:23
+msgid "DFTs"
+msgstr "DFTs"
+
+#: ../src/glade/lingot-config-dialog.glade.h:24
+msgid "Default"
+msgstr "Standardeinstellung"
+
+#: ../src/glade/lingot-config-dialog.glade.h:25
+msgid "Delete"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:26
+msgid ""
+"Deletes the selected notes. The reference note, i.e., the first one, cannot "
+"be removed. You can also use the Delete key on the table beside."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:27
+#: ../src/glade/lingot-mainframe.glade.h:3
+msgid "Deviation"
+msgstr "Abweichung"
+
+#: ../src/glade/lingot-config-dialog.glade.h:28
+msgid "Effective sample rate"
+msgstr "Samplerate"
+
+#: ../src/glade/lingot-config-dialog.glade.h:29
+msgid ""
+"Effective sampling frequency. The lower this parameter is, the more accurate "
+"the FFT will be, and hence the better is the hooking up to the correct peak. "
+"Remember, however, that your temporal window will increase, and the fact "
+"that you won't be able to tune frequencies above the half of this frequency "
+"(Nyquist-Shannon sampling theorem)."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:30
+msgid "FFT size"
+msgstr "FFT-Größe"
+
+#: ../src/glade/lingot-config-dialog.glade.h:31
+msgid "Gain"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:32
+msgid "Hardware sampling frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:33
+msgid "Here you can pick the sound system."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:34
+msgid "Hz"
+msgstr "Hz"
+
+#: ../src/glade/lingot-config-dialog.glade.h:35
+msgid "Import"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:36
+msgid ""
+"Imports the scale from an external .scl file, with the Scala project format "
+"(http://www.huygens-fokker.org/scala/)"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:37
+msgid "Insert"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:38
+msgid ""
+"Lingot is an universal tuner, it can tune any instrument according to the "
+"scale you define here."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:39
+msgid "Lingot only considers frequencies above this one."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:40
+msgid "Minimum frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:41
+#: ../src/lingot-gui-config-dialog-scale.c:322
+msgid "Name"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:42
+msgid "Noise threshold"
+msgstr "Rausch-Schwellwert"
+
+#: ../src/glade/lingot-config-dialog.glade.h:43
+msgid "Number of calculations of the fundamental frequency per second."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:44
+msgid ""
+"Number of main peaks considered over the FFT. Remember that sometimes the "
+"first harmonics can have a higher amplitude than the fundamental component, "
+"depending on your instrument."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:45
+msgid ""
+"Number of samples needed by a peak at each side, lower in amplitude than the "
+"sample at the center, to be considered as a peak. You should not consider "
+"more than 1 or 2 samples, unless you have a really big FFT buffer."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:46
+msgid "Number of samples of each DFT."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:47
+msgid ""
+"Number of visualizations per second of the (last) computed frequency, error "
+"and spectrum. "
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:48
+msgid "Oversampling factor"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:49
+msgid "Peak half-width"
+msgstr "Peak-Reihenfolge"
+
+#: ../src/glade/lingot-config-dialog.glade.h:50
+msgid "Peak number"
+msgstr "Peak-Wert"
+
+#: ../src/glade/lingot-config-dialog.glade.h:51
+msgid "Peak rejection relation"
+msgstr "Verhältnis Aussteuerung Spitze"
+
+#: ../src/glade/lingot-config-dialog.glade.h:52
+msgid "Quick adjusments on the dynamic response and the signal levels."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:53
+msgid "Resets the built-in settings, without applying them."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:54
+msgid ""
+"Rolls back all the previous applied changes and closes the configuration "
+"dialog."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:55
+msgid "Sample rate"
+msgstr "Samplerate"
+
+#: ../src/glade/lingot-config-dialog.glade.h:56
+msgid "Scale"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:57
+msgid "Scale name, only for your information."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:58
+msgid "Temporal window"
+msgstr "Zeitfenster"
+
+#: ../src/glade/lingot-config-dialog.glade.h:59
+msgid ""
+"The FFT buffer gives Lingot a first look to the spectrum. Higher values can "
+"help Lingot to hook up the correct peak, but it's also computationally more "
+"expensive. Don't use high values here unless you have an equally high "
+"effective sample rate."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:60
+msgid ""
+"This is the most recent amount of data considered for tuning. The longer it "
+"is, the more accuracy you can obtain, but also the dynamic response gets "
+"lower, because you are considering older parts of the signal. Also, if you "
+"raise this parameter, the computational cost increases. This value, in "
+"samples (depending on the effective sample rate), must be greater or equal "
+"to the FFT buffer size."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:61
+msgid "Visualization rate"
+msgstr "Darstellungsrate"
+
+#: ../src/glade/lingot-config-dialog.glade.h:62
+msgid "cents"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:63
+msgid "dB"
+msgstr "dB"
+
+#: ../src/glade/lingot-config-dialog.glade.h:64
+msgid "lingot configuration"
+msgstr "Lingot-Konfiguration"
+
+#: ../src/glade/lingot-config-dialog.glade.h:65
+msgid "peaks"
+msgstr "Peaks"
+
+#: ../src/glade/lingot-config-dialog.glade.h:66
+msgid "samples"
+msgstr "Samples"
+
+#: ../src/glade/lingot-config-dialog.glade.h:67
+msgid "seconds"
+msgstr "Sekunden"
+
+#: ../src/glade/lingot-mainframe.glade.h:1
+msgid "---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:2
+msgid ""
+"Closest note to the estimated frequency, according to the scale defined in "
+"the Lingot settings."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:4
+msgid ""
+"Error in cents between the estimated frequency and the closest note "
+"according to the scale defined in the Lingot settings."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:5
+msgid "Estimated fundamental frequency in hertzs."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:6
+msgid "Opens an external configuration file."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:7
+msgid "Saves the running configuration to an external file."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:8
+#, fuzzy
+msgid "Show spectrum"
+msgstr "Spektrum"
+
+#: ../src/glade/lingot-mainframe.glade.h:9
+msgid ""
+"Shows the error in cents in a visual way. The range will depend on the "
+"maximum distance between each two notes in the scale defined in the Lingot "
+"settings (try to provide scales with low maximum distance, i.e. with many "
+"notes, to have a higher resolution in this gauge),"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:10
+msgid "Spectrum"
+msgstr "Spektrum"
+
+#: ../src/glade/lingot-mainframe.glade.h:11
+msgid ""
+"This area shows the spectral power density of the captured signal. The "
+"fundamental frequency is shown with a red dot, and the noise threshold with "
+"a horizontal dotted yellow line. If you have a large FFT buffer (with more "
+"than 512 samples), you can browse through the whole spectrum with a "
+"horizontal scrollbar."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:12
+msgid "Tone"
+msgstr "Note"
+
+#: ../src/glade/lingot-mainframe.glade.h:13
+#, fuzzy
+msgid "_Edit"
+msgstr "_Bearbeiten"
+
+#: ../src/glade/lingot-mainframe.glade.h:14
+msgid "_File"
+msgstr "_Datei"
+
+#: ../src/glade/lingot-mainframe.glade.h:15
+msgid "_Help"
+msgstr "_Hilfe"
+
+#: ../src/glade/lingot-mainframe.glade.h:16
+msgid "_View"
+msgstr "_Anzeige"
+
+#: ../src/glade/lingot-mainframe.glade.h:17
+msgid "e = ---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:18
+msgid "f = ---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:19
+msgid "lingot"
+msgstr "Lingot"
+
+#: ../src/lingot-audio-oss.c:56
+#, c-format
+msgid ""
+"Unable to open audio device %s.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:63
+#, c-format
+msgid ""
+"Error setting number of channels.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:71
+#, c-format
+msgid ""
+"Error setting bits per sample.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:86
+#, c-format
+msgid ""
+"Error setting DMA buffer size.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:92
+#, fuzzy, c-format
+msgid ""
+"Error setting sample rate.\n"
+"%s."
+msgstr "Samplerate"
+
+#: ../src/lingot-audio-oss.c:132 ../src/lingot-audio-alsa.c:167
+#, c-format
+msgid ""
+"Read from audio interface failed.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-alsa.c:139
+msgid "The application has not been built with ALSA support"
+msgstr ""
+
+#: ../src/lingot-audio-jack.c:61
+msgid "Missing connection with JACK audio server"
+msgstr ""
+
+#: ../src/lingot-audio-jack.c:90 ../src/lingot-audio-jack.c:190
+msgid "Unable to connect to JACK server"
+msgstr ""
+
+#: ../src/lingot-audio-jack.c:115
+msgid "No more JACK ports available"
+msgstr ""
+
+#: ../src/lingot-audio-jack.c:133 ../src/lingot-audio-jack.c:247
+#: ../src/lingot-audio-jack.c:314 ../src/lingot-audio-jack.c:346
+msgid "The application has not been built with JACK support"
+msgstr ""
+
+#: ../src/lingot-audio-jack.c:265
+msgid "Cannot activate client"
+msgstr ""
+
+#: ../src/lingot-audio-jack.c:271
+msgid "No active capture ports"
+msgstr ""
+
+#: ../src/lingot-audio-jack.c:282 ../src/lingot-audio-jack.c:302
+msgid "Cannot connect input ports"
+msgstr ""
+
+#: ../src/lingot-audio-jack.c:297
+msgid "No physical capture ports"
+msgstr ""
+
+#: ../src/lingot-config.c:436
+#, c-format
+msgid ""
+"Error parsing the configuration file, line %i: unrecognized audio system "
+"'%s', assuming default audio system.\n"
+msgstr ""
+
+#: ../src/lingot-config.c:452
+msgid ""
+"The configuration file contains errors, and hence some default values have "
+"been chosen. Consider checking the settings and fixing the problem using the "
+"configuration dialog."
+msgstr ""
+
+#: ../src/lingot-core.c:86
+#, c-format
+msgid ""
+"The requested sample rate is not available, the real sample rate has been "
+"set to %d Hz"
+msgstr ""
+
+#: ../src/lingot-core.c:99
+#, c-format
+msgid ""
+"The temporal buffer is smaller than FFT size. It has been increased to %0.3f "
+"seconds"
+msgstr ""
+"Zeitfenster ist kleiner als FFT-Größe. Es wurde auf %0.3f Sekunden erhöht."
+
+#: ../src/lingot-gui-mainframe.c:100
+msgid "Accurate and easy to use musical instrument tuner"
+msgstr "Genaues und einfach zu bedienendes Stimmgerät für Musikinstrumente"
+
+#: ../src/lingot-gui-mainframe.c:104
+msgid "translator-credits"
+msgstr "Roland Stigge <stigge@antcom.de>"
+
+#: ../src/lingot-gui-mainframe.c:247
+msgid "Error"
+msgstr ""
+
+#: ../src/lingot-gui-mainframe.c:248
+msgid "Warning"
+msgstr ""
+
+#: ../src/lingot-gui-mainframe.c:248
+msgid "Info"
+msgstr ""
+
+#: ../src/lingot-gui-mainframe.c:267
+#, fuzzy
+msgid "Open Configuration File"
+msgstr "Lingot-Konfiguration"
+
+#: ../src/lingot-gui-mainframe.c:275 ../src/lingot-gui-mainframe.c:318
+#, fuzzy
+msgid "Lingot configuration files"
+msgstr "Lingot-Konfiguration"
+
+#: ../src/lingot-gui-mainframe.c:307
+#, fuzzy
+msgid "Save Configuration File"
+msgstr "Lingot-Konfiguration"
+
+#: ../src/lingot-gui-config-dialog.c:311
+msgid ""
+"The provided scale contains wide gaps in frequency that increase the gauge "
+"range and produce a loss of visual accuracy. Consider providing scales with "
+"at least 12 tones, or with a maximum distance between adjacent notes below "
+"200 cents."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:84
+msgid "You cannot insert before the reference note."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:210
+msgid "Do not use space characters for the note names."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:213
+msgid "The name contains illegal characters."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:230
+msgid "You cannot change the first shift, it must be 1/1."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:237
+msgid "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:339
+msgid "Shift"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:360
+msgid "Frequency [Hz]"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:417
+msgid "There are notes with the same name"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:431
+msgid ""
+"There are invalid values in the scale: the notes should be ordered by "
+"frequency / shift"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:438
+msgid ""
+"There are invalid values in the scale: all the notes should be in the same "
+"octave"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:447
+msgid "There are notes without name"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:511
+msgid "Open Scale File"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:519
+msgid "Scala files"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:539
+msgid "The scale cannot be imported: file format error"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:605
+msgid ""
+"Note identifier, free text that will be displayed in the main window when "
+"tuning close to the given note. Don't use space characters here."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:610
+msgid ""
+"Shift. You can define it as a deviation in cents from the reference note "
+"(the first one), or as a frequency ratio, like '3/2' or '5/4'. All the "
+"values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all "
+"the notes must be in the same octave), and they must be well ordered."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:615
+msgid ""
+"Frequency. You can enter here the absolute frequency for a given note as a "
+"reference, and all the other frequencies will shift according to the "
+"deviations specified in the 'Shift' column. You can use an absolute numeric "
+"value or the keywords 'mid-C' (261.625565 Hz) and 'mid-A' (440 Hz)."
+msgstr ""
+
+#~ msgid "Root frequency"
+#~ msgstr "Grundfrequenz"
+
+#~ msgid "freq"
+#~ msgstr "Freq"
+
+#~ msgid "err"
+#~ msgstr "Fehler"
+
+#, fuzzy
+#~ msgid "440 (A) +"
+#~ msgstr " A (440 Hz) + "
+
+#~ msgid "General parameters"
+#~ msgstr "Einstellungen"
+
+#~ msgid "Advanced parameters"
+#~ msgstr "Erweiterte Einstellungen"
diff --git a/po/es.po b/po/es.po
new file mode 100644
index 0000000..df2f363
--- /dev/null
+++ b/po/es.po
@@ -0,0 +1,794 @@
+# Spanish translations for Lingot.
+# Copyright (C) 2004-2011 Ibán Cereijo Graña, 2004-2011 Jairo Chapela Martínez
+# This file is distributed under the same license as the lingot package.
+# Jairo Chapela Martínez <jairochapela@gmail.com>, 2007.
+# Ibán Cereijo Graña <ibancg@gmail.com>, 2007-2011.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: lingot\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-02-21 17:10+0000\n"
+"PO-Revision-Date: 2007-08-23 17:46+0200\n"
+"Last-Translator: Ibán Cereijo <ibancg@gmail.com>\n"
+"Language-Team: Spanish <LL@li.org>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../src/glade/lingot-config-dialog.glade.h:1
+msgid ""
+"Adds a new note to the list, just above the selected line, or appends it to "
+"the end if no line is selected. Is not possible to add a note before the "
+"reference (the first) one. You can also use the Insert key on the table "
+"beside."
+msgstr ""
+"Añade una nota a la lista, justo encima de la línea seleccionada, o la añade "
+"al final si no hay ninguna línea seleccionada. No es posible añadir una nota "
+"antes de la nota de referencia (la primera). Se pueden usar también las "
+"teclas Insertar y Suprimir sobre la tabla de al lado."
+
+#: ../src/glade/lingot-config-dialog.glade.h:2
+msgid "Adjustments"
+msgstr "Ajustes"
+
+#: ../src/glade/lingot-config-dialog.glade.h:3
+msgid "Advanced"
+msgstr "Avanzado"
+
+#: ../src/glade/lingot-config-dialog.glade.h:4
+msgid ""
+"Advanced settings on the frequency finding algorithm. You should not modify "
+"these parameters unless you really need it and you have a good understanding "
+"of the algorithm. Use the 'Default' button if you get lost, and use those "
+"default parameters as your reference."
+msgstr ""
+"Configuración avanzada del algoritmo de cálculo de la frecuencia "
+"fundamental. No debería manipular estos parámetros a no ser que realmente lo "
+"necesite y tenga un buen conocimiento del algoritmo. Use el botón 'Predet.' "
+"si se pierde, y use esos valores predeterminados como su referencia."
+
+#: ../src/glade/lingot-config-dialog.glade.h:5
+msgid ""
+"After having chosen the fundamental peak on the FFT, Lingot computes a "
+"series of N (being N this parameter) DFTs localized in frequency to enclose "
+"the fundamental frequency."
+msgstr ""
+"Tras haber escogido el pico fundamental en la FFT, Lingot calcula una serie "
+"de N (siendo N este parámetro) DFTs localizadas en frecuencia para cercar la "
+"frecuencia fundamental."
+
+#: ../src/glade/lingot-config-dialog.glade.h:6
+msgid ""
+"All the peaks with an amplitude difference with the highest one greater than "
+"this parameter will be rejected as a candidate to host the fundamental "
+"frequency"
+msgstr ""
+"Todos los picos con una diferencia en amplitud con el pico más alto que sea "
+"mayor que este parámetro serán descartados como candidatos a portar la "
+"frecuencia fundamental."
+
+#: ../src/glade/lingot-config-dialog.glade.h:7
+msgid ""
+"Allows you to adapt the signal levels without the aid of an external mixer."
+msgstr "Permite adaptar el nivel de señal sin recurrir a un mezclador externo."
+
+#: ../src/glade/lingot-config-dialog.glade.h:8
+msgid ""
+"Any signal level below this value will be considered as noise. This noise "
+"level is depicted in the spectrum area as a yellow dotted line."
+msgstr ""
+"Cualquier nivel de señal por debajo de este valor será considerado como "
+"ruido. Dicho nivel se dibujará en el gráfico del espectro como una línea "
+"amarilla discontínua."
+
+#: ../src/glade/lingot-config-dialog.glade.h:9
+msgid ""
+"Applies a shift in frequency to all the notes defined in the table above."
+msgstr ""
+"Aplica un desplazamiento en frecuencia a todas las notas definidas en la "
+"tabla de arriba."
+
+#: ../src/glade/lingot-config-dialog.glade.h:10
+msgid "Apply the current changes and modify the congifuration file."
+msgstr "Aplica los cambios actuales y modifica el fichero de configuración."
+
+#: ../src/glade/lingot-config-dialog.glade.h:11
+msgid ""
+"Apply the current changes to the running tuner, but doesn't modify the "
+"configuration file."
+msgstr ""
+"Aplica los cambios actuales al afinador en ejecución, pero no modifica el "
+"fichero de configuración."
+
+#: ../src/glade/lingot-config-dialog.glade.h:12
+msgid "Audio device"
+msgstr "Dispositivo audio"
+
+#: ../src/glade/lingot-config-dialog.glade.h:13
+msgid "Audio input settings. Set here the source and hardware settings."
+msgstr ""
+"Configuración de entrada de sonido. Defina aquí la fuente de audio y la "
+"configuración relativa al hardware."
+
+#: ../src/glade/lingot-config-dialog.glade.h:14
+msgid "Audio system"
+msgstr "Sistema audio"
+
+#: ../src/glade/lingot-config-dialog.glade.h:15
+msgid "Basic"
+msgstr "Básico"
+
+#: ../src/glade/lingot-config-dialog.glade.h:16
+msgid ""
+"Basic settings on the frequency finding algorithm. Come here to get better "
+"accuracy, frequency range or CPU usage. "
+msgstr ""
+"Configuración básica del algoritmo de cálculo de la frecuencia fundamental. "
+"Acuda aquí para obtener una mejor precisión, rango de frecuencia o uso de "
+"procesador."
+
+#: ../src/glade/lingot-config-dialog.glade.h:17
+msgid "Calculation rate"
+msgstr "Tasa de cálculo"
+
+#: ../src/glade/lingot-config-dialog.glade.h:18
+msgid "Capture"
+msgstr "Captura"
+
+#: ../src/glade/lingot-config-dialog.glade.h:19
+msgid ""
+"Choose the audio device if you have more than one. You cannot modify this "
+"field if you are using JACK, but you can connect Lingot to a desired source "
+"externally."
+msgstr ""
+"Escoja el dispositivo de entrada si dispone de más de uno. Este campo no "
+"puede ser modificado si se está usando JACK, pero puede conectar Lingot al "
+"origen de audio deseado de forma externa."
+
+#: ../src/glade/lingot-config-dialog.glade.h:20
+msgid ""
+"Choose the hardware sample rate here. We give you some examples, but you can "
+"choose another one. Please, be aware that depending on the audio system and/"
+"or device, not all the sampling frequencies are available. Anyway, you can "
+"get close to your desired effective sample rate by combining this parameter "
+"with the oversampling factor (Basic tab). If you are using JACK, you cannot "
+"modify this field, but you can change it externally (in the JACK server "
+"configuration)."
+msgstr ""
+"Escoja aquí la tasa de muestreo hardware. Le damos algunos ejemplos, pero "
+"puede escoger cualquier otra. Tenga en cuenta que, dependiendo del sistema "
+"de audio seleccionado y/o el dispositivo, no todas las frecuencias estarán "
+"disponibles. De cualquier forma, usted puede acercarse a la frecuencia "
+"deseada combinando este parámetro con el factor de sobremuestreo (pestaña "
+"'Básico'). Si usa JACK, no podrá modificar este campo, pero podrá hacerlo "
+"externamente en la configuración del servidor JACK."
+
+#: ../src/glade/lingot-config-dialog.glade.h:21
+msgid "DFT number"
+msgstr "Nº de DFTs"
+
+#: ../src/glade/lingot-config-dialog.glade.h:22
+msgid "DFT size"
+msgstr "Tamaño de DFT"
+
+#: ../src/glade/lingot-config-dialog.glade.h:23
+msgid "DFTs"
+msgstr "DFTs"
+
+#: ../src/glade/lingot-config-dialog.glade.h:24
+msgid "Default"
+msgstr "Predet."
+
+#: ../src/glade/lingot-config-dialog.glade.h:25
+msgid "Delete"
+msgstr "Eliminar"
+
+#: ../src/glade/lingot-config-dialog.glade.h:26
+msgid ""
+"Deletes the selected notes. The reference note, i.e., the first one, cannot "
+"be removed. You can also use the Delete key on the table beside."
+msgstr ""
+"Elimina las notas seleccionadas. La nota de referencia (la primera), no "
+"puede ser eliminada. Puede usted utilizar también la tecla Suprimir sobre la "
+"tabla de la izquierda."
+
+#: ../src/glade/lingot-config-dialog.glade.h:27
+#: ../src/glade/lingot-mainframe.glade.h:3
+msgid "Deviation"
+msgstr "Desviación"
+
+#: ../src/glade/lingot-config-dialog.glade.h:28
+msgid "Effective sample rate"
+msgstr "Tasa de muestreo efectiva"
+
+#: ../src/glade/lingot-config-dialog.glade.h:29
+msgid ""
+"Effective sampling frequency. The lower this parameter is, the more accurate "
+"the FFT will be, and hence the better is the hooking up to the correct peak. "
+"Remember, however, that your temporal window will increase, and the fact "
+"that you won't be able to tune frequencies above the half of this frequency "
+"(Nyquist-Shannon sampling theorem)."
+msgstr ""
+"Frecuencia efectiva de muestreo. Cuanto más bajo es este parámetro, más "
+"precisisión tendrá la FFT, y por tanto mejor será su enganche con el pico "
+"correcto. Recuerde, sin embargo, que su ventana temporal crecerá, y el hecho "
+"de que no será posible afinar frecuencias por encima de la mitad de ésta "
+"(teorema del muestreo de Nyquist-Shannon)."
+
+#: ../src/glade/lingot-config-dialog.glade.h:30
+msgid "FFT size"
+msgstr "Tamaño de FFT"
+
+#: ../src/glade/lingot-config-dialog.glade.h:31
+msgid "Gain"
+msgstr "Ganancia"
+
+#: ../src/glade/lingot-config-dialog.glade.h:32
+msgid "Hardware sampling frequency"
+msgstr "Frecuencia de muestreo hardware"
+
+#: ../src/glade/lingot-config-dialog.glade.h:33
+msgid "Here you can pick the sound system."
+msgstr "Aquí puede escoger el sistema de sonido"
+
+#: ../src/glade/lingot-config-dialog.glade.h:34
+msgid "Hz"
+msgstr "Hz"
+
+#: ../src/glade/lingot-config-dialog.glade.h:35
+msgid "Import"
+msgstr "Importar"
+
+#: ../src/glade/lingot-config-dialog.glade.h:36
+msgid ""
+"Imports the scale from an external .scl file, with the Scala project format "
+"(http://www.huygens-fokker.org/scala/)"
+msgstr ""
+"Importa la escala desde un archivo externo .scl, con el formato utilizado en "
+"el proyecto Scala (http://www.huygens-fokker.org/scala/)"
+
+#: ../src/glade/lingot-config-dialog.glade.h:37
+msgid "Insert"
+msgstr "Insertar"
+
+#: ../src/glade/lingot-config-dialog.glade.h:38
+msgid ""
+"Lingot is an universal tuner, it can tune any instrument according to the "
+"scale you define here."
+msgstr ""
+"Lingot es un afinador universal, puede afinar cualquier instrumento de "
+"acuerdo a la escala que defina aquí."
+
+#: ../src/glade/lingot-config-dialog.glade.h:39
+msgid "Lingot only considers frequencies above this one."
+msgstr "Lingot sólo considera frecuencias por encima de ésta."
+
+#: ../src/glade/lingot-config-dialog.glade.h:40
+msgid "Minimum frequency"
+msgstr "Frecuencia mínima"
+
+#: ../src/glade/lingot-config-dialog.glade.h:41
+#: ../src/lingot-gui-config-dialog-scale.c:322
+msgid "Name"
+msgstr "Nombre"
+
+#: ../src/glade/lingot-config-dialog.glade.h:42
+msgid "Noise threshold"
+msgstr "Umbral de ruido"
+
+#: ../src/glade/lingot-config-dialog.glade.h:43
+msgid "Number of calculations of the fundamental frequency per second."
+msgstr "Número de clalculos por segundo de la frecuencia fundamental."
+
+#: ../src/glade/lingot-config-dialog.glade.h:44
+msgid ""
+"Number of main peaks considered over the FFT. Remember that sometimes the "
+"first harmonics can have a higher amplitude than the fundamental component, "
+"depending on your instrument."
+msgstr ""
+"Número de picos principales considerados sobre la FFT. Recuerde que en "
+"ciertas ocasiones los primeros armónicos pueden tener mayor amplitud que el "
+"pico fundamental, dependiendo del instrumento musical."
+
+#: ../src/glade/lingot-config-dialog.glade.h:45
+msgid ""
+"Number of samples needed by a peak at each side, lower in amplitude than the "
+"sample at the center, to be considered as a peak. You should not consider "
+"more than 1 or 2 samples, unless you have a really big FFT buffer."
+msgstr ""
+"Número de muestras que debe tener un pico a cada lado, menores en amplitud "
+"que la muestra central, para ser considerado como pico. No debería usar más "
+"de una o dos muestras, a no ser que esté utilizando una FFT realmente grande."
+
+#: ../src/glade/lingot-config-dialog.glade.h:46
+msgid "Number of samples of each DFT."
+msgstr "Número de muestras de cada DFT."
+
+#: ../src/glade/lingot-config-dialog.glade.h:47
+msgid ""
+"Number of visualizations per second of the (last) computed frequency, error "
+"and spectrum. "
+msgstr ""
+"Número de visualizaciones por segundo de la (última) frecuencia calculada, "
+"error y espectro."
+
+#: ../src/glade/lingot-config-dialog.glade.h:48
+msgid "Oversampling factor"
+msgstr "Factor de sobremuestreo"
+
+#: ../src/glade/lingot-config-dialog.glade.h:49
+msgid "Peak half-width"
+msgstr "Ancho de pico"
+
+#: ../src/glade/lingot-config-dialog.glade.h:50
+msgid "Peak number"
+msgstr "Nº de picos"
+
+#: ../src/glade/lingot-config-dialog.glade.h:51
+msgid "Peak rejection relation"
+msgstr "Relación rechazo picos"
+
+#: ../src/glade/lingot-config-dialog.glade.h:52
+msgid "Quick adjusments on the dynamic response and the signal levels."
+msgstr "Ajustes rápicos sobre la respuesta dinámica y los niveles de señal."
+
+#: ../src/glade/lingot-config-dialog.glade.h:53
+msgid "Resets the built-in settings, without applying them."
+msgstr "Restaura la configuración por defecto, sin aplicarla."
+
+#: ../src/glade/lingot-config-dialog.glade.h:54
+msgid ""
+"Rolls back all the previous applied changes and closes the configuration "
+"dialog."
+msgstr ""
+"Anula los cambios aplicados previamente y cierra el diálogo de configuración."
+
+#: ../src/glade/lingot-config-dialog.glade.h:55
+msgid "Sample rate"
+msgstr "Tasa de muestreo"
+
+#: ../src/glade/lingot-config-dialog.glade.h:56
+msgid "Scale"
+msgstr "Escala"
+
+#: ../src/glade/lingot-config-dialog.glade.h:57
+msgid "Scale name, only for your information."
+msgstr "Nombre de la escala, sólo para su información."
+
+#: ../src/glade/lingot-config-dialog.glade.h:58
+msgid "Temporal window"
+msgstr "Ventana temporal"
+
+#: ../src/glade/lingot-config-dialog.glade.h:59
+msgid ""
+"The FFT buffer gives Lingot a first look to the spectrum. Higher values can "
+"help Lingot to hook up the correct peak, but it's also computationally more "
+"expensive. Don't use high values here unless you have an equally high "
+"effective sample rate."
+msgstr ""
+"El búfer de FFT permite a Lingot tener un primer vistazo del espectro de la "
+"señal. Valores más altos ayudan a tener un mejor enganche con el pico "
+"correcto, pero suponen además un mayor coste computacional. No use valores "
+"muy elevados a no ser que tenga una tasa efectiva de muestreo igualmente "
+"elevada."
+
+#: ../src/glade/lingot-config-dialog.glade.h:60
+msgid ""
+"This is the most recent amount of data considered for tuning. The longer it "
+"is, the more accuracy you can obtain, but also the dynamic response gets "
+"lower, because you are considering older parts of the signal. Also, if you "
+"raise this parameter, the computational cost increases. This value, in "
+"samples (depending on the effective sample rate), must be greater or equal "
+"to the FFT buffer size."
+msgstr ""
+"Ésta es la porción más reciente de señal considerada en la afinación. Cuanto "
+"más largo sea, más precisión podemos obtener, pero a la vez la respuesta "
+"dinámica es más lenta, ya que estamos considerando partes más viejas de la "
+"señal. Además, si usted sube este parámetro, el coste computacional aumenta. "
+"Este valor, en muestras (que depende de la tasa efectiva de muestreo), debe "
+"ser mayor o igual que el tamaño de la FFT."
+
+#: ../src/glade/lingot-config-dialog.glade.h:61
+msgid "Visualization rate"
+msgstr "Tasa de visualización"
+
+#: ../src/glade/lingot-config-dialog.glade.h:62
+msgid "cents"
+msgstr "cents"
+
+#: ../src/glade/lingot-config-dialog.glade.h:63
+msgid "dB"
+msgstr "dB"
+
+#: ../src/glade/lingot-config-dialog.glade.h:64
+msgid "lingot configuration"
+msgstr "configuración de lingot"
+
+#: ../src/glade/lingot-config-dialog.glade.h:65
+msgid "peaks"
+msgstr "picos"
+
+#: ../src/glade/lingot-config-dialog.glade.h:66
+msgid "samples"
+msgstr "muestras"
+
+#: ../src/glade/lingot-config-dialog.glade.h:67
+msgid "seconds"
+msgstr "segundos"
+
+#: ../src/glade/lingot-mainframe.glade.h:1
+msgid "---"
+msgstr "---"
+
+#: ../src/glade/lingot-mainframe.glade.h:2
+msgid ""
+"Closest note to the estimated frequency, according to the scale defined in "
+"the Lingot settings."
+msgstr ""
+"Nota más cercana a la frecuencia estimada, de acuerdo a la escala definida "
+"en la configuración."
+
+#: ../src/glade/lingot-mainframe.glade.h:4
+msgid ""
+"Error in cents between the estimated frequency and the closest note "
+"according to the scale defined in the Lingot settings."
+msgstr ""
+"Error en cents entre la frecuencia estimada y la nota más cercana según la "
+"configuración del afinador."
+
+#: ../src/glade/lingot-mainframe.glade.h:5
+msgid "Estimated fundamental frequency in hertzs."
+msgstr "Frecuencia fundamental estimada, en hercios."
+
+#: ../src/glade/lingot-mainframe.glade.h:6
+msgid "Opens an external configuration file."
+msgstr "Abre un archivo de configuración externo."
+
+#: ../src/glade/lingot-mainframe.glade.h:7
+msgid "Saves the running configuration to an external file."
+msgstr "Guarda la configuración en ejecución en un fichero externo."
+
+#: ../src/glade/lingot-mainframe.glade.h:8
+msgid "Show spectrum"
+msgstr "Espectro"
+
+#: ../src/glade/lingot-mainframe.glade.h:9
+msgid ""
+"Shows the error in cents in a visual way. The range will depend on the "
+"maximum distance between each two notes in the scale defined in the Lingot "
+"settings (try to provide scales with low maximum distance, i.e. with many "
+"notes, to have a higher resolution in this gauge),"
+msgstr ""
+"Muestra el error en cents de una manera visual. El rango dependerá de la "
+"distancia máxima entre pares de notas en la escala definida en la "
+"configuración de Lingot (intente proveer escalas con baja distancia máxima, "
+"por ejemplo escalas con muchas notas, para obtener una mejor resolución en "
+"esta aguja)."
+
+#: ../src/glade/lingot-mainframe.glade.h:10
+msgid "Spectrum"
+msgstr "Espectro"
+
+#: ../src/glade/lingot-mainframe.glade.h:11
+msgid ""
+"This area shows the spectral power density of the captured signal. The "
+"fundamental frequency is shown with a red dot, and the noise threshold with "
+"a horizontal dotted yellow line. If you have a large FFT buffer (with more "
+"than 512 samples), you can browse through the whole spectrum with a "
+"horizontal scrollbar."
+msgstr ""
+"Este área muestra la densidad espectral de potencia de la señal capturada. "
+"La frecuencia fundamental se muestra con una bolita roja, y el umbral de "
+"ruido mediante una línea amarilla horizontal y discontínua. Si tiene un "
+"tamaño de FFT de más de 512 muestras, puede navegar por todo el espectro "
+"utilizando la barra de desplazamiento horizontal."
+
+#: ../src/glade/lingot-mainframe.glade.h:12
+msgid "Tone"
+msgstr "Tono"
+
+#: ../src/glade/lingot-mainframe.glade.h:13
+msgid "_Edit"
+msgstr "_Editar"
+
+#: ../src/glade/lingot-mainframe.glade.h:14
+msgid "_File"
+msgstr "_Archivo"
+
+#: ../src/glade/lingot-mainframe.glade.h:15
+msgid "_Help"
+msgstr "A_yuda"
+
+#: ../src/glade/lingot-mainframe.glade.h:16
+msgid "_View"
+msgstr "_Ver"
+
+#: ../src/glade/lingot-mainframe.glade.h:17
+msgid "e = ---"
+msgstr "e = ---"
+
+#: ../src/glade/lingot-mainframe.glade.h:18
+msgid "f = ---"
+msgstr "f = ---"
+
+#: ../src/glade/lingot-mainframe.glade.h:19
+msgid "lingot"
+msgstr "lingot"
+
+#: ../src/lingot-audio-oss.c:56
+#, c-format
+msgid ""
+"Unable to open audio device %s.\n"
+"%s."
+msgstr ""
+"Imposible abrir el dispositivo de audio %s.\n"
+"%s."
+
+#: ../src/lingot-audio-oss.c:63
+#, c-format
+msgid ""
+"Error setting number of channels.\n"
+"%s."
+msgstr ""
+"Error estableciendo el número de canales.\n"
+"%s."
+
+#: ../src/lingot-audio-oss.c:71
+#, c-format
+msgid ""
+"Error setting bits per sample.\n"
+"%s."
+msgstr ""
+"Error estableciendo los bits por muestra.\n"
+"%s."
+
+#: ../src/lingot-audio-oss.c:86
+#, c-format
+msgid ""
+"Error setting DMA buffer size.\n"
+"%s."
+msgstr ""
+"Error estableciendo el tamaño del búfer DMA.\n"
+"%s."
+
+#: ../src/lingot-audio-oss.c:92
+#, c-format
+msgid ""
+"Error setting sample rate.\n"
+"%s."
+msgstr ""
+"Error estableciendo tasa de muestreo.\n"
+"%s."
+
+#: ../src/lingot-audio-oss.c:132 ../src/lingot-audio-alsa.c:167
+#, c-format
+msgid ""
+"Read from audio interface failed.\n"
+"%s."
+msgstr ""
+"La lectura del dispositivo ha fallado.\n"
+"%s."
+
+#: ../src/lingot-audio-alsa.c:139
+msgid "The application has not been built with ALSA support"
+msgstr "La aplicación no ha sido construída con soporte para ALSA"
+
+#: ../src/lingot-audio-jack.c:61
+msgid "Missing connection with JACK audio server"
+msgstr "Perdida conexión con el servidor JACK"
+
+#: ../src/lingot-audio-jack.c:90 ../src/lingot-audio-jack.c:190
+msgid "Unable to connect to JACK server"
+msgstr "No es posible conectar con el servidor JACK"
+
+#: ../src/lingot-audio-jack.c:115
+msgid "No more JACK ports available"
+msgstr "No hay más puertos JACK disponibles"
+
+#: ../src/lingot-audio-jack.c:133 ../src/lingot-audio-jack.c:247
+#: ../src/lingot-audio-jack.c:314 ../src/lingot-audio-jack.c:346
+msgid "The application has not been built with JACK support"
+msgstr "La aplicación no ha sido construída con soporte para JACK"
+
+#: ../src/lingot-audio-jack.c:265
+msgid "Cannot activate client"
+msgstr "No es posible activar el cliente"
+
+#: ../src/lingot-audio-jack.c:271
+msgid "No active capture ports"
+msgstr "No hay puertos físicos de captura"
+
+#: ../src/lingot-audio-jack.c:282 ../src/lingot-audio-jack.c:302
+msgid "Cannot connect input ports"
+msgstr "No es posible conectar los puertos de entrada"
+
+#: ../src/lingot-audio-jack.c:297
+msgid "No physical capture ports"
+msgstr "No hay puertos físicos de captura"
+
+#: ../src/lingot-config.c:436
+#, c-format
+msgid ""
+"Error parsing the configuration file, line %i: unrecognized audio system "
+"'%s', assuming default audio system.\n"
+msgstr ""
+"Error leyendo el archivo de configuración, línea %i: sistema de audio "
+"desconocido '%s', asumiendo valor por defecto.\n"
+
+#: ../src/lingot-config.c:452
+msgid ""
+"The configuration file contains errors, and hence some default values have "
+"been chosen. Consider checking the settings and fixing the problem using the "
+"configuration dialog."
+msgstr ""
+"El fichero de configuración contiene errores, y por tanto se usarán valores "
+"por defecto en ciertos parámetros. Considere comprobar dichos valores y "
+"solucionar el problema en el diálogo de configuración."
+
+#: ../src/lingot-core.c:86
+#, c-format
+msgid ""
+"The requested sample rate is not available, the real sample rate has been "
+"set to %d Hz"
+msgstr ""
+"La tasa de muestreo solicitada no está disponible, la tasa real ha sido "
+"cambiada a %d Hz"
+
+#: ../src/lingot-core.c:99
+#, c-format
+msgid ""
+"The temporal buffer is smaller than FFT size. It has been increased to %0.3f "
+"seconds"
+msgstr ""
+"El búfer de la ventana temporal es menor que el de FFT, se ha incrementado a "
+"%0.3f segundos"
+
+#: ../src/lingot-gui-mainframe.c:100
+msgid "Accurate and easy to use musical instrument tuner"
+msgstr "Afinador de instrumentos preciso y fácil de usar"
+
+#: ../src/lingot-gui-mainframe.c:104
+msgid "translator-credits"
+msgstr ""
+
+#: ../src/lingot-gui-mainframe.c:247
+msgid "Error"
+msgstr "Error"
+
+#: ../src/lingot-gui-mainframe.c:248
+msgid "Warning"
+msgstr "Aviso"
+
+#: ../src/lingot-gui-mainframe.c:248
+msgid "Info"
+msgstr "Información"
+
+#: ../src/lingot-gui-mainframe.c:267
+msgid "Open Configuration File"
+msgstr "Abrir archivo de configuración"
+
+#: ../src/lingot-gui-mainframe.c:275 ../src/lingot-gui-mainframe.c:318
+msgid "Lingot configuration files"
+msgstr "Archivos de configuración de lingot"
+
+#: ../src/lingot-gui-mainframe.c:307
+msgid "Save Configuration File"
+msgstr "Guardar archivo de configuración"
+
+#: ../src/lingot-gui-config-dialog.c:311
+msgid ""
+"The provided scale contains wide gaps in frequency that increase the gauge "
+"range and produce a loss of visual accuracy. Consider providing scales with "
+"at least 12 tones, or with a maximum distance between adjacent notes below "
+"200 cents."
+msgstr ""
+"La escala suministrada contiene grandes huecos en frecuencia que incrementan "
+"el rango de la aguja y provocan una pérdida de precisión visual. Considere "
+"proveer escalas con al menos 12 tonos, o con una distancia máxima entre "
+"notas adyacentes no superior a 200 cents."
+
+#: ../src/lingot-gui-config-dialog-scale.c:84
+msgid "You cannot insert before the reference note."
+msgstr "No puede insertar una nota encima de la nota de referencia."
+
+#: ../src/lingot-gui-config-dialog-scale.c:210
+msgid "Do not use space characters for the note names."
+msgstr "No use caracteres vacíos para los nombres de las notas."
+
+#: ../src/lingot-gui-config-dialog-scale.c:213
+msgid "The name contains illegal characters."
+msgstr "El nombre contiene caracteres inválidos."
+
+#: ../src/lingot-gui-config-dialog-scale.c:230
+msgid "You cannot change the first shift, it must be 1/1."
+msgstr ""
+"No puede cambiar el desplazamiento en frecuencia en la nota de referencia, "
+"debe estar fijado a 1/1."
+
+#: ../src/lingot-gui-config-dialog-scale.c:237
+msgid "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1."
+msgstr ""
+"El desplazamiento en frecuencia debe estar entre 0 y 1200 cents, o entre 1/1 "
+"y 2/1."
+
+#: ../src/lingot-gui-config-dialog-scale.c:339
+msgid "Shift"
+msgstr "Desplazamiento"
+
+#: ../src/lingot-gui-config-dialog-scale.c:360
+msgid "Frequency [Hz]"
+msgstr "Frecuencia [Hz]"
+
+#: ../src/lingot-gui-config-dialog-scale.c:417
+msgid "There are notes with the same name"
+msgstr "Hay notas con el mismo nombre"
+
+#: ../src/lingot-gui-config-dialog-scale.c:431
+msgid ""
+"There are invalid values in the scale: the notes should be ordered by "
+"frequency / shift"
+msgstr ""
+"Hay valores inválidos en la escala: las notas deberían estar ordenadas por "
+"frecuencia / desplazamiento"
+
+#: ../src/lingot-gui-config-dialog-scale.c:438
+msgid ""
+"There are invalid values in the scale: all the notes should be in the same "
+"octave"
+msgstr ""
+"Hay valores inválidos en la escala: todas las notas deben estar en la misma "
+"octava"
+
+#: ../src/lingot-gui-config-dialog-scale.c:447
+msgid "There are notes without name"
+msgstr "Hay notas sin nombre"
+
+#: ../src/lingot-gui-config-dialog-scale.c:511
+msgid "Open Scale File"
+msgstr "Abrir archivo de escala"
+
+#: ../src/lingot-gui-config-dialog-scale.c:519
+msgid "Scala files"
+msgstr "Ficheros de Scala"
+
+#: ../src/lingot-gui-config-dialog-scale.c:539
+msgid "The scale cannot be imported: file format error"
+msgstr ""
+"La escala no puede ser importada: el fichero contiene errores de formato"
+
+#: ../src/lingot-gui-config-dialog-scale.c:605
+msgid ""
+"Note identifier, free text that will be displayed in the main window when "
+"tuning close to the given note. Don't use space characters here."
+msgstr ""
+"Identificador de la nota, texto libre que será mostrado en la ventana "
+"principal cuando se encuentre afinando cerca de la nota dada. No use "
+"caracteres en blanco aquí."
+
+#: ../src/lingot-gui-config-dialog-scale.c:610
+msgid ""
+"Shift. You can define it as a deviation in cents from the reference note "
+"(the first one), or as a frequency ratio, like '3/2' or '5/4'. All the "
+"values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all "
+"the notes must be in the same octave), and they must be well ordered."
+msgstr ""
+"Desplazamiento en frecuencia. Puede definirlo como una desviación en cents "
+"con respecto a la nota de referencia (la primera), o como un múltiplo de su "
+"frecuencia, tal como '3/2' o '5/4'. Todos los valores deben estar entre 0 y "
+"1200 cents, o entre 1/1 y 2/1 (es decir, todas las notas deben estar en la "
+"misma octava), y deben estar todos ellos bien ordenados."
+
+#: ../src/lingot-gui-config-dialog-scale.c:615
+msgid ""
+"Frequency. You can enter here the absolute frequency for a given note as a "
+"reference, and all the other frequencies will shift according to the "
+"deviations specified in the 'Shift' column. You can use an absolute numeric "
+"value or the keywords 'mid-C' (261.625565 Hz) and 'mid-A' (440 Hz)."
+msgstr ""
+"Frecuencia. Puede definir aquí la frecuencia absoluta de una nota concreta "
+"como referencia, y el resto de frecuencias se establecerán en base a este "
+"valor y el desplazamiento en frecuencia de cada nota (definido en la columna "
+"'Desplazamiento'). Puede usar tanto un valor numérico, o las palabras clave "
+"'mid-C' (261.625565 Hz) y 'mid-A' (440 Hz)."
diff --git a/po/fr.po b/po/fr.po
new file mode 100644
index 0000000..e5b394f
--- /dev/null
+++ b/po/fr.po
@@ -0,0 +1,682 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-02-21 17:10+0000\n"
+"PO-Revision-Date: 2010-11-25 03:41+0100\n"
+"Last-Translator: Olivier HUMBERT <humbert.olivier.1@free.fr>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../src/glade/lingot-config-dialog.glade.h:1
+msgid ""
+"Adds a new note to the list, just above the selected line, or appends it to "
+"the end if no line is selected. Is not possible to add a note before the "
+"reference (the first) one. You can also use the Insert key on the table "
+"beside."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:2
+msgid "Adjustments"
+msgstr "Ajustements"
+
+#: ../src/glade/lingot-config-dialog.glade.h:3
+msgid "Advanced"
+msgstr "Avancés"
+
+#: ../src/glade/lingot-config-dialog.glade.h:4
+msgid ""
+"Advanced settings on the frequency finding algorithm. You should not modify "
+"these parameters unless you really need it and you have a good understanding "
+"of the algorithm. Use the 'Default' button if you get lost, and use those "
+"default parameters as your reference."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:5
+msgid ""
+"After having chosen the fundamental peak on the FFT, Lingot computes a "
+"series of N (being N this parameter) DFTs localized in frequency to enclose "
+"the fundamental frequency."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:6
+msgid ""
+"All the peaks with an amplitude difference with the highest one greater than "
+"this parameter will be rejected as a candidate to host the fundamental "
+"frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:7
+msgid ""
+"Allows you to adapt the signal levels without the aid of an external mixer."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:8
+msgid ""
+"Any signal level below this value will be considered as noise. This noise "
+"level is depicted in the spectrum area as a yellow dotted line."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:9
+msgid ""
+"Applies a shift in frequency to all the notes defined in the table above."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:10
+msgid "Apply the current changes and modify the congifuration file."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:11
+msgid ""
+"Apply the current changes to the running tuner, but doesn't modify the "
+"configuration file."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:12
+#, fuzzy
+msgid "Audio device"
+msgstr "Périphérique audio"
+
+#: ../src/glade/lingot-config-dialog.glade.h:13
+msgid "Audio input settings. Set here the source and hardware settings."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:14
+msgid "Audio system"
+msgstr "Système audio"
+
+#: ../src/glade/lingot-config-dialog.glade.h:15
+msgid "Basic"
+msgstr "Basique"
+
+#: ../src/glade/lingot-config-dialog.glade.h:16
+msgid ""
+"Basic settings on the frequency finding algorithm. Come here to get better "
+"accuracy, frequency range or CPU usage. "
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:17
+msgid "Calculation rate"
+msgstr "Taux de calcul"
+
+#: ../src/glade/lingot-config-dialog.glade.h:18
+msgid "Capture"
+msgstr "Capture"
+
+#: ../src/glade/lingot-config-dialog.glade.h:19
+msgid ""
+"Choose the audio device if you have more than one. You cannot modify this "
+"field if you are using JACK, but you can connect Lingot to a desired source "
+"externally."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:20
+msgid ""
+"Choose the hardware sample rate here. We give you some examples, but you can "
+"choose another one. Please, be aware that depending on the audio system and/"
+"or device, not all the sampling frequencies are available. Anyway, you can "
+"get close to your desired effective sample rate by combining this parameter "
+"with the oversampling factor (Basic tab). If you are using JACK, you cannot "
+"modify this field, but you can change it externally (in the JACK server "
+"configuration)."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:21
+msgid "DFT number"
+msgstr "Nombre DFT"
+
+#: ../src/glade/lingot-config-dialog.glade.h:22
+msgid "DFT size"
+msgstr "taille DFT"
+
+#: ../src/glade/lingot-config-dialog.glade.h:23
+msgid "DFTs"
+msgstr "DFTs"
+
+#: ../src/glade/lingot-config-dialog.glade.h:24
+msgid "Default"
+msgstr "Défaut"
+
+#: ../src/glade/lingot-config-dialog.glade.h:25
+msgid "Delete"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:26
+msgid ""
+"Deletes the selected notes. The reference note, i.e., the first one, cannot "
+"be removed. You can also use the Delete key on the table beside."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:27
+#: ../src/glade/lingot-mainframe.glade.h:3
+msgid "Deviation"
+msgstr "Déviation"
+
+#: ../src/glade/lingot-config-dialog.glade.h:28
+msgid "Effective sample rate"
+msgstr "Taux d'échantillonage effectif"
+
+#: ../src/glade/lingot-config-dialog.glade.h:29
+msgid ""
+"Effective sampling frequency. The lower this parameter is, the more accurate "
+"the FFT will be, and hence the better is the hooking up to the correct peak. "
+"Remember, however, that your temporal window will increase, and the fact "
+"that you won't be able to tune frequencies above the half of this frequency "
+"(Nyquist-Shannon sampling theorem)."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:30
+msgid "FFT size"
+msgstr "Taille FFT"
+
+#: ../src/glade/lingot-config-dialog.glade.h:31
+msgid "Gain"
+msgstr "Gain"
+
+#: ../src/glade/lingot-config-dialog.glade.h:32
+msgid "Hardware sampling frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:33
+msgid "Here you can pick the sound system."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:34
+msgid "Hz"
+msgstr "Hz"
+
+#: ../src/glade/lingot-config-dialog.glade.h:35
+msgid "Import"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:36
+msgid ""
+"Imports the scale from an external .scl file, with the Scala project format "
+"(http://www.huygens-fokker.org/scala/)"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:37
+msgid "Insert"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:38
+msgid ""
+"Lingot is an universal tuner, it can tune any instrument according to the "
+"scale you define here."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:39
+msgid "Lingot only considers frequencies above this one."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:40
+msgid "Minimum frequency"
+msgstr "Fréquence minimale"
+
+#: ../src/glade/lingot-config-dialog.glade.h:41
+#: ../src/lingot-gui-config-dialog-scale.c:322
+msgid "Name"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:42
+msgid "Noise threshold"
+msgstr "Seuil de bruit"
+
+#: ../src/glade/lingot-config-dialog.glade.h:43
+msgid "Number of calculations of the fundamental frequency per second."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:44
+msgid ""
+"Number of main peaks considered over the FFT. Remember that sometimes the "
+"first harmonics can have a higher amplitude than the fundamental component, "
+"depending on your instrument."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:45
+msgid ""
+"Number of samples needed by a peak at each side, lower in amplitude than the "
+"sample at the center, to be considered as a peak. You should not consider "
+"more than 1 or 2 samples, unless you have a really big FFT buffer."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:46
+msgid "Number of samples of each DFT."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:47
+msgid ""
+"Number of visualizations per second of the (last) computed frequency, error "
+"and spectrum. "
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:48
+msgid "Oversampling factor"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:49
+msgid "Peak half-width"
+msgstr "Pic de milieu"
+
+#: ../src/glade/lingot-config-dialog.glade.h:50
+msgid "Peak number"
+msgstr "Nombre de pic"
+
+#: ../src/glade/lingot-config-dialog.glade.h:51
+msgid "Peak rejection relation"
+msgstr "Relation de rejet maximale"
+
+#: ../src/glade/lingot-config-dialog.glade.h:52
+msgid "Quick adjusments on the dynamic response and the signal levels."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:53
+msgid "Resets the built-in settings, without applying them."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:54
+msgid ""
+"Rolls back all the previous applied changes and closes the configuration "
+"dialog."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:55
+msgid "Sample rate"
+msgstr "Taux d'échantillonnage"
+
+#: ../src/glade/lingot-config-dialog.glade.h:56
+msgid "Scale"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:57
+msgid "Scale name, only for your information."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:58
+msgid "Temporal window"
+msgstr "Fenêtre temporelle"
+
+#: ../src/glade/lingot-config-dialog.glade.h:59
+msgid ""
+"The FFT buffer gives Lingot a first look to the spectrum. Higher values can "
+"help Lingot to hook up the correct peak, but it's also computationally more "
+"expensive. Don't use high values here unless you have an equally high "
+"effective sample rate."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:60
+msgid ""
+"This is the most recent amount of data considered for tuning. The longer it "
+"is, the more accuracy you can obtain, but also the dynamic response gets "
+"lower, because you are considering older parts of the signal. Also, if you "
+"raise this parameter, the computational cost increases. This value, in "
+"samples (depending on the effective sample rate), must be greater or equal "
+"to the FFT buffer size."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:61
+msgid "Visualization rate"
+msgstr "Taux de visualisation"
+
+#: ../src/glade/lingot-config-dialog.glade.h:62
+msgid "cents"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:63
+msgid "dB"
+msgstr "dB"
+
+#: ../src/glade/lingot-config-dialog.glade.h:64
+msgid "lingot configuration"
+msgstr "configuration de lingot"
+
+#: ../src/glade/lingot-config-dialog.glade.h:65
+msgid "peaks"
+msgstr "pics"
+
+#: ../src/glade/lingot-config-dialog.glade.h:66
+msgid "samples"
+msgstr "échantillons"
+
+#: ../src/glade/lingot-config-dialog.glade.h:67
+msgid "seconds"
+msgstr "secondes"
+
+#: ../src/glade/lingot-mainframe.glade.h:1
+msgid "---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:2
+msgid ""
+"Closest note to the estimated frequency, according to the scale defined in "
+"the Lingot settings."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:4
+msgid ""
+"Error in cents between the estimated frequency and the closest note "
+"according to the scale defined in the Lingot settings."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:5
+msgid "Estimated fundamental frequency in hertzs."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:6
+msgid "Opens an external configuration file."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:7
+msgid "Saves the running configuration to an external file."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:8
+#, fuzzy
+msgid "Show spectrum"
+msgstr "Spectre"
+
+#: ../src/glade/lingot-mainframe.glade.h:9
+msgid ""
+"Shows the error in cents in a visual way. The range will depend on the "
+"maximum distance between each two notes in the scale defined in the Lingot "
+"settings (try to provide scales with low maximum distance, i.e. with many "
+"notes, to have a higher resolution in this gauge),"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:10
+msgid "Spectrum"
+msgstr "Spectre"
+
+#: ../src/glade/lingot-mainframe.glade.h:11
+msgid ""
+"This area shows the spectral power density of the captured signal. The "
+"fundamental frequency is shown with a red dot, and the noise threshold with "
+"a horizontal dotted yellow line. If you have a large FFT buffer (with more "
+"than 512 samples), you can browse through the whole spectrum with a "
+"horizontal scrollbar."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:12
+msgid "Tone"
+msgstr "Note"
+
+#: ../src/glade/lingot-mainframe.glade.h:13
+#, fuzzy
+msgid "_Edit"
+msgstr "_Edition"
+
+#: ../src/glade/lingot-mainframe.glade.h:14
+msgid "_File"
+msgstr "_Fichier"
+
+#: ../src/glade/lingot-mainframe.glade.h:15
+msgid "_Help"
+msgstr "_H Aide"
+
+#: ../src/glade/lingot-mainframe.glade.h:16
+msgid "_View"
+msgstr "_Vue"
+
+#: ../src/glade/lingot-mainframe.glade.h:17
+msgid "e = ---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:18
+msgid "f = ---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:19
+msgid "lingot"
+msgstr "lingot"
+
+#: ../src/lingot-audio-oss.c:56
+#, c-format
+msgid ""
+"Unable to open audio device %s.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:63
+#, c-format
+msgid ""
+"Error setting number of channels.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:71
+#, c-format
+msgid ""
+"Error setting bits per sample.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:86
+#, c-format
+msgid ""
+"Error setting DMA buffer size.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:92
+#, fuzzy, c-format
+msgid ""
+"Error setting sample rate.\n"
+"%s."
+msgstr "Taux d'échantillonage effectif"
+
+#: ../src/lingot-audio-oss.c:132 ../src/lingot-audio-alsa.c:167
+#, c-format
+msgid ""
+"Read from audio interface failed.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-alsa.c:139
+msgid "The application has not been built with ALSA support"
+msgstr "L'application n'a pas été construite avec le support ALSA"
+
+#: ../src/lingot-audio-jack.c:61
+msgid "Missing connection with JACK audio server"
+msgstr "Il manque une connexion avec le serveur audio JACK"
+
+#: ../src/lingot-audio-jack.c:90 ../src/lingot-audio-jack.c:190
+msgid "Unable to connect to JACK server"
+msgstr "Ne parvient pas à se connecter au serveur JACK"
+
+#: ../src/lingot-audio-jack.c:115
+msgid "No more JACK ports available"
+msgstr "Plus de ports JACK disponibles"
+
+#: ../src/lingot-audio-jack.c:133 ../src/lingot-audio-jack.c:247
+#: ../src/lingot-audio-jack.c:314 ../src/lingot-audio-jack.c:346
+msgid "The application has not been built with JACK support"
+msgstr "L'application n'a pas été construite avec le support JACK"
+
+#: ../src/lingot-audio-jack.c:265
+msgid "Cannot activate client"
+msgstr "Ne peut pas activer le client"
+
+#: ../src/lingot-audio-jack.c:271
+#, fuzzy
+msgid "No active capture ports"
+msgstr "Pas de ports de capture physique"
+
+#: ../src/lingot-audio-jack.c:282 ../src/lingot-audio-jack.c:302
+msgid "Cannot connect input ports"
+msgstr "Ne peut pas se connecter aux ports d'entrées"
+
+#: ../src/lingot-audio-jack.c:297
+msgid "No physical capture ports"
+msgstr "Pas de ports de capture physique"
+
+#: ../src/lingot-config.c:436
+#, c-format
+msgid ""
+"Error parsing the configuration file, line %i: unrecognized audio system "
+"'%s', assuming default audio system.\n"
+msgstr ""
+
+#: ../src/lingot-config.c:452
+msgid ""
+"The configuration file contains errors, and hence some default values have "
+"been chosen. Consider checking the settings and fixing the problem using the "
+"configuration dialog."
+msgstr ""
+
+#: ../src/lingot-core.c:86
+#, c-format
+msgid ""
+"The requested sample rate is not available, the real sample rate has been "
+"set to %d Hz"
+msgstr ""
+
+#: ../src/lingot-core.c:99
+#, fuzzy, c-format
+msgid ""
+"The temporal buffer is smaller than FFT size. It has been increased to %0.3f "
+"seconds"
+msgstr ""
+"Le tampon temporel est plus petit que la taille FFT. Il a été augmenté à "
+"%0.3f secondes"
+
+#: ../src/lingot-gui-mainframe.c:100
+msgid "Accurate and easy to use musical instrument tuner"
+msgstr "Accordeur d'instruments de musique précis et facile à utiliser"
+
+#: ../src/lingot-gui-mainframe.c:104
+msgid "translator-credits"
+msgstr "crédits de traducteurs"
+
+#: ../src/lingot-gui-mainframe.c:247
+msgid "Error"
+msgstr "Erreur"
+
+#: ../src/lingot-gui-mainframe.c:248
+msgid "Warning"
+msgstr "Attention"
+
+#: ../src/lingot-gui-mainframe.c:248
+msgid "Info"
+msgstr ""
+
+#: ../src/lingot-gui-mainframe.c:267
+#, fuzzy
+msgid "Open Configuration File"
+msgstr "configuration de lingot"
+
+#: ../src/lingot-gui-mainframe.c:275 ../src/lingot-gui-mainframe.c:318
+#, fuzzy
+msgid "Lingot configuration files"
+msgstr "configuration de lingot"
+
+#: ../src/lingot-gui-mainframe.c:307
+#, fuzzy
+msgid "Save Configuration File"
+msgstr "configuration de lingot"
+
+#: ../src/lingot-gui-config-dialog.c:311
+msgid ""
+"The provided scale contains wide gaps in frequency that increase the gauge "
+"range and produce a loss of visual accuracy. Consider providing scales with "
+"at least 12 tones, or with a maximum distance between adjacent notes below "
+"200 cents."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:84
+msgid "You cannot insert before the reference note."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:210
+msgid "Do not use space characters for the note names."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:213
+msgid "The name contains illegal characters."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:230
+msgid "You cannot change the first shift, it must be 1/1."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:237
+msgid "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:339
+msgid "Shift"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:360
+msgid "Frequency [Hz]"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:417
+msgid "There are notes with the same name"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:431
+msgid ""
+"There are invalid values in the scale: the notes should be ordered by "
+"frequency / shift"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:438
+msgid ""
+"There are invalid values in the scale: all the notes should be in the same "
+"octave"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:447
+msgid "There are notes without name"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:511
+msgid "Open Scale File"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:519
+msgid "Scala files"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:539
+msgid "The scale cannot be imported: file format error"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:605
+msgid ""
+"Note identifier, free text that will be displayed in the main window when "
+"tuning close to the given note. Don't use space characters here."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:610
+msgid ""
+"Shift. You can define it as a deviation in cents from the reference note "
+"(the first one), or as a frequency ratio, like '3/2' or '5/4'. All the "
+"values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all "
+"the notes must be in the same octave), and they must be well ordered."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:615
+msgid ""
+"Frequency. You can enter here the absolute frequency for a given note as a "
+"reference, and all the other frequencies will shift according to the "
+"deviations specified in the 'Shift' column. You can use an absolute numeric "
+"value or the keywords 'mid-C' (261.625565 Hz) and 'mid-A' (440 Hz)."
+msgstr ""
+
+#~ msgid "Root frequency"
+#~ msgstr "Fréquence fondamentale"
+
+#~ msgid "freq"
+#~ msgstr "fréq"
+
+#~ msgid "err"
+#~ msgstr "err"
diff --git a/po/gl.po b/po/gl.po
new file mode 100644
index 0000000..1986571
--- /dev/null
+++ b/po/gl.po
@@ -0,0 +1,790 @@
+# Spanish translations for Lingot.
+# Copyright (C) 2004-2011 Ibán Cereijo Graña, 2004-2011 Jairo Chapela Martínez
+# This file is distributed under the same license as the lingot package.
+# Ibán Cereijo Graña <ibancg@gmail.com>, 2007-2011.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: lingot\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-02-21 17:10+0000\n"
+"PO-Revision-Date: 2007-08-23 17:46+0200\n"
+"Last-Translator: Ibán Cereijo <ibancg@gmail.com>\n"
+"Language-Team: Galician <LL@li.org>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../src/glade/lingot-config-dialog.glade.h:1
+msgid ""
+"Adds a new note to the list, just above the selected line, or appends it to "
+"the end if no line is selected. Is not possible to add a note before the "
+"reference (the first) one. You can also use the Insert key on the table "
+"beside."
+msgstr ""
+"Engade unha nota á lista, xusto enriba da nota seleccionada, ou engádea ao "
+"final no caso de non haber liñas seleccionadas. Non é posible engadir unha "
+"nota antes da nota de referencia (a primeira). Pode tamén usar as teclas "
+"Insertar e Suprimir sobre a táboa da esquerda."
+
+#: ../src/glade/lingot-config-dialog.glade.h:2
+msgid "Adjustments"
+msgstr "Axustes"
+
+#: ../src/glade/lingot-config-dialog.glade.h:3
+msgid "Advanced"
+msgstr "Avanzado"
+
+#: ../src/glade/lingot-config-dialog.glade.h:4
+msgid ""
+"Advanced settings on the frequency finding algorithm. You should not modify "
+"these parameters unless you really need it and you have a good understanding "
+"of the algorithm. Use the 'Default' button if you get lost, and use those "
+"default parameters as your reference."
+msgstr ""
+"Configuración avanzada do algoritmo de cálculo da frecuencia fundamental. "
+"Non debería modificar estos parámetros a non ser que realmente o precise, e "
+"que teña un bo coñecemento do algoritmo. Empregue o botón 'Predet.' no caso "
+"de atope perdido, e use esos parámetros por defecto como a súa referencia."
+
+#: ../src/glade/lingot-config-dialog.glade.h:5
+msgid ""
+"After having chosen the fundamental peak on the FFT, Lingot computes a "
+"series of N (being N this parameter) DFTs localized in frequency to enclose "
+"the fundamental frequency."
+msgstr ""
+"Tras escoller o pico fundamental na FFT, Lingot calcula unha serie de N "
+"(sendo N este parámetro) DFTs localizadas en frecuencia para cercar a "
+"frecuencia fundamental."
+
+#: ../src/glade/lingot-config-dialog.glade.h:6
+msgid ""
+"All the peaks with an amplitude difference with the highest one greater than "
+"this parameter will be rejected as a candidate to host the fundamental "
+"frequency"
+msgstr ""
+"Tódolos picos cunha diferencia en amplitude, con respecto ó pico "
+"fundamental, maior que este parámetro serán rexeitados como candidatos a "
+"portar a frecuencia fundamental."
+
+#: ../src/glade/lingot-config-dialog.glade.h:7
+msgid ""
+"Allows you to adapt the signal levels without the aid of an external mixer."
+msgstr "Permite adaptar os niveis de sinal sen axuda dun mezcrador externo."
+
+#: ../src/glade/lingot-config-dialog.glade.h:8
+msgid ""
+"Any signal level below this value will be considered as noise. This noise "
+"level is depicted in the spectrum area as a yellow dotted line."
+msgstr ""
+"Calqueira nivel de sinal por debaixo de este valor será considerado coma "
+"ruido. Este umbral debúxase na zona do espectro coma unha liña amarela "
+"discontínua."
+
+#: ../src/glade/lingot-config-dialog.glade.h:9
+msgid ""
+"Applies a shift in frequency to all the notes defined in the table above."
+msgstr ""
+"Aplica un desprazamento en frecuencia a tódalas notas definidas na táboa de "
+"arriba."
+
+#: ../src/glade/lingot-config-dialog.glade.h:10
+msgid "Apply the current changes and modify the congifuration file."
+msgstr "Aplica os cambios actuais e modifica o ficheiro de configuración."
+
+#: ../src/glade/lingot-config-dialog.glade.h:11
+msgid ""
+"Apply the current changes to the running tuner, but doesn't modify the "
+"configuration file."
+msgstr ""
+"Aplica os cambios actuais ao afinador en execución, pero non modifica o "
+"ficheiro de configuración."
+
+#: ../src/glade/lingot-config-dialog.glade.h:12
+msgid "Audio device"
+msgstr "Dispositivo audio"
+
+#: ../src/glade/lingot-config-dialog.glade.h:13
+msgid "Audio input settings. Set here the source and hardware settings."
+msgstr ""
+"Configuración da entrada de sonido. Defina aquí a fonte de audio e a "
+"configuración relativa ó hardware."
+
+#: ../src/glade/lingot-config-dialog.glade.h:14
+msgid "Audio system"
+msgstr "Sistema audio"
+
+#: ../src/glade/lingot-config-dialog.glade.h:15
+msgid "Basic"
+msgstr "Básico"
+
+#: ../src/glade/lingot-config-dialog.glade.h:16
+msgid ""
+"Basic settings on the frequency finding algorithm. Come here to get better "
+"accuracy, frequency range or CPU usage. "
+msgstr ""
+"Configuración básica do algoritmo de cálculo da frecuencia fundamental. "
+"Acuda aquí para obter unha mellor precisión, rango de frecuencia ou uso de "
+"procesador."
+
+#: ../src/glade/lingot-config-dialog.glade.h:17
+msgid "Calculation rate"
+msgstr "Tasa de cálculo"
+
+#: ../src/glade/lingot-config-dialog.glade.h:18
+msgid "Capture"
+msgstr "Captura"
+
+#: ../src/glade/lingot-config-dialog.glade.h:19
+msgid ""
+"Choose the audio device if you have more than one. You cannot modify this "
+"field if you are using JACK, but you can connect Lingot to a desired source "
+"externally."
+msgstr ""
+"Escolla o dispositivo de entrada se dispón de máis de un. Este campo non "
+"pode ser modificado se está usando JACK, pero pode conectar Lingot á orixe "
+"de audio deseada de forma externa."
+
+#: ../src/glade/lingot-config-dialog.glade.h:20
+msgid ""
+"Choose the hardware sample rate here. We give you some examples, but you can "
+"choose another one. Please, be aware that depending on the audio system and/"
+"or device, not all the sampling frequencies are available. Anyway, you can "
+"get close to your desired effective sample rate by combining this parameter "
+"with the oversampling factor (Basic tab). If you are using JACK, you cannot "
+"modify this field, but you can change it externally (in the JACK server "
+"configuration)."
+msgstr ""
+"Escolla aquí a tasa de mostreo hardware. Dámoslle algúns exemplos, pero pode "
+"escoller calqueira outra. Percátese de que, dependendo don sistema de audio "
+"seleccionado e/ou o dispositivo, non todas as frecuencias estarán "
+"dispoñibles. De calquer xeito, vostede pode achegarse á frecuencia desexada "
+"combinando este parámetro có factor de sobremostreo (pestaña 'Básico'). Se "
+"usa JACK, non poderá modificar este campo, pero podderá facelo externamente "
+"na configuración do servidor JACK."
+
+#: ../src/glade/lingot-config-dialog.glade.h:21
+msgid "DFT number"
+msgstr "Nº de DFTs"
+
+#: ../src/glade/lingot-config-dialog.glade.h:22
+msgid "DFT size"
+msgstr "Tamaño de DFT"
+
+#: ../src/glade/lingot-config-dialog.glade.h:23
+msgid "DFTs"
+msgstr "DFTs"
+
+#: ../src/glade/lingot-config-dialog.glade.h:24
+msgid "Default"
+msgstr "Predet."
+
+#: ../src/glade/lingot-config-dialog.glade.h:25
+msgid "Delete"
+msgstr "Eliminar"
+
+#: ../src/glade/lingot-config-dialog.glade.h:26
+msgid ""
+"Deletes the selected notes. The reference note, i.e., the first one, cannot "
+"be removed. You can also use the Delete key on the table beside."
+msgstr ""
+"Elimina as notas seleccionadas. A nota de referencia (a primeira), non pode "
+"ser eliminada. Pode vostede empregar tamén a tecla Suprimir sobre a táboa da "
+"esquerda."
+
+#: ../src/glade/lingot-config-dialog.glade.h:27
+#: ../src/glade/lingot-mainframe.glade.h:3
+msgid "Deviation"
+msgstr "Desviación"
+
+#: ../src/glade/lingot-config-dialog.glade.h:28
+msgid "Effective sample rate"
+msgstr "Tasa de mostreo efectiva"
+
+#: ../src/glade/lingot-config-dialog.glade.h:29
+msgid ""
+"Effective sampling frequency. The lower this parameter is, the more accurate "
+"the FFT will be, and hence the better is the hooking up to the correct peak. "
+"Remember, however, that your temporal window will increase, and the fact "
+"that you won't be able to tune frequencies above the half of this frequency "
+"(Nyquist-Shannon sampling theorem)."
+msgstr ""
+"Frecuencia efectiva de mostreo. Cuanto máis baixa sexa, máis precisisión "
+"terá a FFT, e por tanto mellor será o enganche có pico axeitado. Lembre, sen "
+"embargo, que a súa ventá temporal medrará, e o feito de que non será posible "
+"afinar frecuencias por riba da metade de ésta (teorema do mostreo de Nyquist-"
+"Shannon)."
+
+#: ../src/glade/lingot-config-dialog.glade.h:30
+msgid "FFT size"
+msgstr "Tamaño de FFT"
+
+#: ../src/glade/lingot-config-dialog.glade.h:31
+msgid "Gain"
+msgstr "Ganancia"
+
+#: ../src/glade/lingot-config-dialog.glade.h:32
+msgid "Hardware sampling frequency"
+msgstr "Frecuencia de mostreo hardware"
+
+#: ../src/glade/lingot-config-dialog.glade.h:33
+msgid "Here you can pick the sound system."
+msgstr "Aquí pode escoller o sistema de sonido"
+
+#: ../src/glade/lingot-config-dialog.glade.h:34
+msgid "Hz"
+msgstr "Hz"
+
+#: ../src/glade/lingot-config-dialog.glade.h:35
+msgid "Import"
+msgstr "Importar"
+
+#: ../src/glade/lingot-config-dialog.glade.h:36
+msgid ""
+"Imports the scale from an external .scl file, with the Scala project format "
+"(http://www.huygens-fokker.org/scala/)"
+msgstr ""
+"Importa a escala dende un arquivo externo .scl, có formato empregado no "
+"proxecto Scala (http://www.huygens-fokker.org/scala/)"
+
+#: ../src/glade/lingot-config-dialog.glade.h:37
+msgid "Insert"
+msgstr "Insertar"
+
+#: ../src/glade/lingot-config-dialog.glade.h:38
+msgid ""
+"Lingot is an universal tuner, it can tune any instrument according to the "
+"scale you define here."
+msgstr ""
+"Lingot é un afinador universal, pode afinar calqueira instrumento de acordo "
+"á escala que defina aquí."
+
+#: ../src/glade/lingot-config-dialog.glade.h:39
+msgid "Lingot only considers frequencies above this one."
+msgstr "Lingot sólo considera frecuencias por riba desta."
+
+#: ../src/glade/lingot-config-dialog.glade.h:40
+msgid "Minimum frequency"
+msgstr "Frecuencia mínima"
+
+#: ../src/glade/lingot-config-dialog.glade.h:41
+#: ../src/lingot-gui-config-dialog-scale.c:322
+msgid "Name"
+msgstr "Nome"
+
+#: ../src/glade/lingot-config-dialog.glade.h:42
+msgid "Noise threshold"
+msgstr "Umbral de ruido"
+
+#: ../src/glade/lingot-config-dialog.glade.h:43
+msgid "Number of calculations of the fundamental frequency per second."
+msgstr "Número de cálculos por segundo da frecuencia fundamental."
+
+#: ../src/glade/lingot-config-dialog.glade.h:44
+msgid ""
+"Number of main peaks considered over the FFT. Remember that sometimes the "
+"first harmonics can have a higher amplitude than the fundamental component, "
+"depending on your instrument."
+msgstr ""
+"Número de picos principais considerados sobre a FFT. Lembre que en certas "
+"ocasións os primeiros armónicos poden ter maior amplitude que o pico "
+"fundamental, dependendo do instrumento musical empregado."
+
+#: ../src/glade/lingot-config-dialog.glade.h:45
+msgid ""
+"Number of samples needed by a peak at each side, lower in amplitude than the "
+"sample at the center, to be considered as a peak. You should not consider "
+"more than 1 or 2 samples, unless you have a really big FFT buffer."
+msgstr ""
+"Número de mostras que debe ter un pico a cada lado, menores en amplitude que "
+"a mostra central, para ser considerado coma pico. Non debería usar máis de "
+"unha ou dúas mostras, a no ser que esté empregando unha FFT realmente grande."
+
+#: ../src/glade/lingot-config-dialog.glade.h:46
+msgid "Number of samples of each DFT."
+msgstr "Número de mostras de cada DFT."
+
+#: ../src/glade/lingot-config-dialog.glade.h:47
+msgid ""
+"Number of visualizations per second of the (last) computed frequency, error "
+"and spectrum. "
+msgstr ""
+"Número de visualizacións por segundo da (última) frecuencia calculada, error "
+"e espectro."
+
+#: ../src/glade/lingot-config-dialog.glade.h:48
+msgid "Oversampling factor"
+msgstr "Factor de sobremostreo"
+
+#: ../src/glade/lingot-config-dialog.glade.h:49
+msgid "Peak half-width"
+msgstr "Ancho de pico"
+
+#: ../src/glade/lingot-config-dialog.glade.h:50
+msgid "Peak number"
+msgstr "Nº de picos"
+
+#: ../src/glade/lingot-config-dialog.glade.h:51
+msgid "Peak rejection relation"
+msgstr "Relación rexeite picos"
+
+#: ../src/glade/lingot-config-dialog.glade.h:52
+msgid "Quick adjusments on the dynamic response and the signal levels."
+msgstr "Axustes rápicos sobre a resposta dinámica e os niveis de sinal."
+
+#: ../src/glade/lingot-config-dialog.glade.h:53
+msgid "Resets the built-in settings, without applying them."
+msgstr "Restaura a configuración por defecto, sen aplicala."
+
+#: ../src/glade/lingot-config-dialog.glade.h:54
+msgid ""
+"Rolls back all the previous applied changes and closes the configuration "
+"dialog."
+msgstr ""
+"Anula los cambios aplicados previamente e pecha o diálogo de configuración."
+
+#: ../src/glade/lingot-config-dialog.glade.h:55
+msgid "Sample rate"
+msgstr "Tasa de mostreo"
+
+#: ../src/glade/lingot-config-dialog.glade.h:56
+msgid "Scale"
+msgstr "Escala"
+
+#: ../src/glade/lingot-config-dialog.glade.h:57
+msgid "Scale name, only for your information."
+msgstr "Nome da escala, sólo para a súa información."
+
+#: ../src/glade/lingot-config-dialog.glade.h:58
+msgid "Temporal window"
+msgstr "Ventá temporal"
+
+#: ../src/glade/lingot-config-dialog.glade.h:59
+msgid ""
+"The FFT buffer gives Lingot a first look to the spectrum. Higher values can "
+"help Lingot to hook up the correct peak, but it's also computationally more "
+"expensive. Don't use high values here unless you have an equally high "
+"effective sample rate."
+msgstr ""
+"O búfer de FFT permite a Lingot botar unha primeira ollada ó espectro do "
+"sinal. Valores máis altos axudan a ter un mellor enganche có pico correcto, "
+"pero supoñen ademáis un maior coste computacional. Non use valores moi "
+"elevados a no ser que teña unha tasa efectiva de mostreo igualmente elevada."
+
+#: ../src/glade/lingot-config-dialog.glade.h:60
+msgid ""
+"This is the most recent amount of data considered for tuning. The longer it "
+"is, the more accuracy you can obtain, but also the dynamic response gets "
+"lower, because you are considering older parts of the signal. Also, if you "
+"raise this parameter, the computational cost increases. This value, in "
+"samples (depending on the effective sample rate), must be greater or equal "
+"to the FFT buffer size."
+msgstr ""
+"Ésta é a porción máis recente de sinal considerada na afinación. Canto máis "
+"largo sexa, máis precisión podemos obter, pero ao mesmo tempo a resposta "
+"dinámica será máis lenta, xa que estamos considerando partes máis vellas do "
+"sinal. Ademáis, se vostede sube este parámetro, o coste computacional "
+"aumenta. Este valor, en mostras (que depende da tasa efectiva de mostreo), "
+"debe ser maior ou igual que o tamaño da FFT."
+
+#: ../src/glade/lingot-config-dialog.glade.h:61
+msgid "Visualization rate"
+msgstr "Tasa de visualización"
+
+#: ../src/glade/lingot-config-dialog.glade.h:62
+msgid "cents"
+msgstr "cents"
+
+#: ../src/glade/lingot-config-dialog.glade.h:63
+msgid "dB"
+msgstr "dB"
+
+#: ../src/glade/lingot-config-dialog.glade.h:64
+msgid "lingot configuration"
+msgstr "configuración de lingot"
+
+#: ../src/glade/lingot-config-dialog.glade.h:65
+msgid "peaks"
+msgstr "picos"
+
+#: ../src/glade/lingot-config-dialog.glade.h:66
+msgid "samples"
+msgstr "mostras"
+
+#: ../src/glade/lingot-config-dialog.glade.h:67
+msgid "seconds"
+msgstr "segundos"
+
+#: ../src/glade/lingot-mainframe.glade.h:1
+msgid "---"
+msgstr "---"
+
+#: ../src/glade/lingot-mainframe.glade.h:2
+msgid ""
+"Closest note to the estimated frequency, according to the scale defined in "
+"the Lingot settings."
+msgstr ""
+"Nota máis cercana á frecuencia estimada, de acordo á escala definida na "
+"configuración."
+
+#: ../src/glade/lingot-mainframe.glade.h:4
+msgid ""
+"Error in cents between the estimated frequency and the closest note "
+"according to the scale defined in the Lingot settings."
+msgstr ""
+"Error en cents entre a frecuencia estimada e a nota máis cercana segundo a "
+"configuración do afinador."
+
+#: ../src/glade/lingot-mainframe.glade.h:5
+msgid "Estimated fundamental frequency in hertzs."
+msgstr "Frecuencia fundamental estimada, en hercios."
+
+#: ../src/glade/lingot-mainframe.glade.h:6
+msgid "Opens an external configuration file."
+msgstr "Abre un arquivo de configuración externo."
+
+#: ../src/glade/lingot-mainframe.glade.h:7
+msgid "Saves the running configuration to an external file."
+msgstr "Garda a configuración en execución nun ficheiro externo."
+
+#: ../src/glade/lingot-mainframe.glade.h:8
+msgid "Show spectrum"
+msgstr "Espectro"
+
+#: ../src/glade/lingot-mainframe.glade.h:9
+msgid ""
+"Shows the error in cents in a visual way. The range will depend on the "
+"maximum distance between each two notes in the scale defined in the Lingot "
+"settings (try to provide scales with low maximum distance, i.e. with many "
+"notes, to have a higher resolution in this gauge),"
+msgstr ""
+"Amosa o erro en cents dunha maneira visual. O rango dependerá da distancia "
+"máxima entre pares de notas na escala definida na configuración de Lingot "
+"(intente proveer escalas con baixa distancia máxima, por exemplo escalas con "
+"moitas notas, para obtener unha mellor resolución nesta esta agulla)."
+
+#: ../src/glade/lingot-mainframe.glade.h:10
+msgid "Spectrum"
+msgstr "Espectro"
+
+#: ../src/glade/lingot-mainframe.glade.h:11
+msgid ""
+"This area shows the spectral power density of the captured signal. The "
+"fundamental frequency is shown with a red dot, and the noise threshold with "
+"a horizontal dotted yellow line. If you have a large FFT buffer (with more "
+"than 512 samples), you can browse through the whole spectrum with a "
+"horizontal scrollbar."
+msgstr ""
+"Este área amosa a densidade espectral de potencia do sinal capturado. A "
+"frecuencia fundamental móstrase cunha bola vermella, e o umbral de ruido "
+"mediante unha liña amarela horizontal e discontínua. Se ten un tamaño de FFT "
+"de máis de 512 mostras, pode navegar por todo o espectro empregando a barra "
+"de desprazamento horizontal."
+
+#: ../src/glade/lingot-mainframe.glade.h:12
+msgid "Tone"
+msgstr "Tono"
+
+#: ../src/glade/lingot-mainframe.glade.h:13
+msgid "_Edit"
+msgstr "_Editar"
+
+#: ../src/glade/lingot-mainframe.glade.h:14
+msgid "_File"
+msgstr "_Arquivo"
+
+#: ../src/glade/lingot-mainframe.glade.h:15
+msgid "_Help"
+msgstr "A_xuda"
+
+#: ../src/glade/lingot-mainframe.glade.h:16
+msgid "_View"
+msgstr "_Ver"
+
+#: ../src/glade/lingot-mainframe.glade.h:17
+msgid "e = ---"
+msgstr "e = ---"
+
+#: ../src/glade/lingot-mainframe.glade.h:18
+msgid "f = ---"
+msgstr "f = ---"
+
+#: ../src/glade/lingot-mainframe.glade.h:19
+msgid "lingot"
+msgstr "lingot"
+
+#: ../src/lingot-audio-oss.c:56
+#, c-format
+msgid ""
+"Unable to open audio device %s.\n"
+"%s."
+msgstr ""
+"Imposible abrir o dispositivo de audio %s.\n"
+"%s."
+
+#: ../src/lingot-audio-oss.c:63
+#, c-format
+msgid ""
+"Error setting number of channels.\n"
+"%s."
+msgstr ""
+"Erro establecendo o número de canles.\n"
+"%s."
+
+#: ../src/lingot-audio-oss.c:71
+#, c-format
+msgid ""
+"Error setting bits per sample.\n"
+"%s."
+msgstr ""
+"Error establecendo os bits por mostra.\n"
+"%s."
+
+#: ../src/lingot-audio-oss.c:86
+#, c-format
+msgid ""
+"Error setting DMA buffer size.\n"
+"%s."
+msgstr ""
+"Error establecendo o tamaño do búfer DMA.\n"
+"%s."
+
+#: ../src/lingot-audio-oss.c:92
+#, c-format
+msgid ""
+"Error setting sample rate.\n"
+"%s."
+msgstr ""
+"Error establecendo tasa de mostreo.\n"
+"%s."
+
+#: ../src/lingot-audio-oss.c:132 ../src/lingot-audio-alsa.c:167
+#, c-format
+msgid ""
+"Read from audio interface failed.\n"
+"%s."
+msgstr ""
+"A lectura do dispositivo fallou.\n"
+"%s."
+
+#: ../src/lingot-audio-alsa.c:139
+msgid "The application has not been built with ALSA support"
+msgstr "A aplicación non foi construída con soporte para ALSA"
+
+#: ../src/lingot-audio-jack.c:61
+msgid "Missing connection with JACK audio server"
+msgstr "Perdida a conexión có servidor JACK"
+
+#: ../src/lingot-audio-jack.c:90 ../src/lingot-audio-jack.c:190
+msgid "Unable to connect to JACK server"
+msgstr "Non é posible conectar có servidor JACK"
+
+#: ../src/lingot-audio-jack.c:115
+msgid "No more JACK ports available"
+msgstr "No hai máis portos JACK disponibles"
+
+#: ../src/lingot-audio-jack.c:133 ../src/lingot-audio-jack.c:247
+#: ../src/lingot-audio-jack.c:314 ../src/lingot-audio-jack.c:346
+msgid "The application has not been built with JACK support"
+msgstr "A aplicación non foi construída con soporte para JACK"
+
+#: ../src/lingot-audio-jack.c:265
+msgid "Cannot activate client"
+msgstr "No é posible activar o cliente"
+
+#: ../src/lingot-audio-jack.c:271
+msgid "No active capture ports"
+msgstr "Non hai portos físicos de captura"
+
+#: ../src/lingot-audio-jack.c:282 ../src/lingot-audio-jack.c:302
+msgid "Cannot connect input ports"
+msgstr "Non é posible conectar os portos de entrada"
+
+#: ../src/lingot-audio-jack.c:297
+msgid "No physical capture ports"
+msgstr "No hai portos físicos de captura"
+
+#: ../src/lingot-config.c:436
+#, c-format
+msgid ""
+"Error parsing the configuration file, line %i: unrecognized audio system "
+"'%s', assuming default audio system.\n"
+msgstr ""
+"Erro lendo o arquivo de configuración, liña %i: sistema de audio descoñecido "
+"'%s', asumindo valor por defecto.\n"
+
+#: ../src/lingot-config.c:452
+msgid ""
+"The configuration file contains errors, and hence some default values have "
+"been chosen. Consider checking the settings and fixing the problem using the "
+"configuration dialog."
+msgstr ""
+"O ficheiro de configuración contén erros, e por tanto usaránse valores por "
+"defecto en certos parámetros. Considere comprobar os devanditos valores e "
+"solucionar o problema no diálogo de configuración."
+
+#: ../src/lingot-core.c:86
+#, c-format
+msgid ""
+"The requested sample rate is not available, the real sample rate has been "
+"set to %d Hz"
+msgstr ""
+"A tasa de mostreo solicitada non está dispoñible, a tasa real foi cambiada a "
+"%d Hz"
+
+#: ../src/lingot-core.c:99
+#, c-format
+msgid ""
+"The temporal buffer is smaller than FFT size. It has been increased to %0.3f "
+"seconds"
+msgstr ""
+"O búfer da ventá temporal é menor que o de FFT, foi incrementado a %0.3f "
+"segundos"
+
+#: ../src/lingot-gui-mainframe.c:100
+msgid "Accurate and easy to use musical instrument tuner"
+msgstr "Afinador de instrumentos preciso e fácil de usar"
+
+#: ../src/lingot-gui-mainframe.c:104
+msgid "translator-credits"
+msgstr "Ibán Cereijo Graña <ibancg@gmail.com>"
+
+#: ../src/lingot-gui-mainframe.c:247
+msgid "Error"
+msgstr "Erro"
+
+#: ../src/lingot-gui-mainframe.c:248
+msgid "Warning"
+msgstr "Aviso"
+
+#: ../src/lingot-gui-mainframe.c:248
+msgid "Info"
+msgstr "Información"
+
+#: ../src/lingot-gui-mainframe.c:267
+msgid "Open Configuration File"
+msgstr "Abrir arquivo de configuración"
+
+#: ../src/lingot-gui-mainframe.c:275 ../src/lingot-gui-mainframe.c:318
+msgid "Lingot configuration files"
+msgstr "Arquivos de configuración de lingot"
+
+#: ../src/lingot-gui-mainframe.c:307
+msgid "Save Configuration File"
+msgstr "Gardar arquivo de configuración"
+
+#: ../src/lingot-gui-config-dialog.c:311
+msgid ""
+"The provided scale contains wide gaps in frequency that increase the gauge "
+"range and produce a loss of visual accuracy. Consider providing scales with "
+"at least 12 tones, or with a maximum distance between adjacent notes below "
+"200 cents."
+msgstr ""
+"A escala suministrada contén grandes hocos en frecuencia que incrementan o "
+"rango da agulla e provocan unha perda de precisión visual. Considere proveer "
+"escalas con polo menos 12 tonos, ou cunha distancia máxima entre notas "
+"adxacentes non superior a 200 cents."
+
+#: ../src/lingot-gui-config-dialog-scale.c:84
+msgid "You cannot insert before the reference note."
+msgstr "No pode insertar unha nota enriba da nota de referencia."
+
+#: ../src/lingot-gui-config-dialog-scale.c:210
+msgid "Do not use space characters for the note names."
+msgstr "Non empregue caracteres valeiros para os nomes das notas."
+
+#: ../src/lingot-gui-config-dialog-scale.c:213
+msgid "The name contains illegal characters."
+msgstr "O nome contén caracteres inválidos."
+
+#: ../src/lingot-gui-config-dialog-scale.c:230
+msgid "You cannot change the first shift, it must be 1/1."
+msgstr ""
+"Non pode cambiar o desprazamento en frecuencia na nota de referencia, debe "
+"estar fixado a 1/1."
+
+#: ../src/lingot-gui-config-dialog-scale.c:237
+msgid "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1."
+msgstr ""
+"O desprazamento en frecuencia debe estar entre 0 e 1200 cents, ou entre 1/1 "
+"e 2/1."
+
+#: ../src/lingot-gui-config-dialog-scale.c:339
+msgid "Shift"
+msgstr "Desprazamento"
+
+#: ../src/lingot-gui-config-dialog-scale.c:360
+msgid "Frequency [Hz]"
+msgstr "Frecuencia [Hz]"
+
+#: ../src/lingot-gui-config-dialog-scale.c:417
+msgid "There are notes with the same name"
+msgstr "Hai notas có mesmo nome"
+
+#: ../src/lingot-gui-config-dialog-scale.c:431
+msgid ""
+"There are invalid values in the scale: the notes should be ordered by "
+"frequency / shift"
+msgstr ""
+"Hai valores inválidos na escala: as notas deberan estar ordeadas por "
+"frecuencia / desprazamento"
+
+#: ../src/lingot-gui-config-dialog-scale.c:438
+msgid ""
+"There are invalid values in the scale: all the notes should be in the same "
+"octave"
+msgstr ""
+"Hai valores inválidos na escala: tódalas notas deben estar na mesma octava"
+
+#: ../src/lingot-gui-config-dialog-scale.c:447
+msgid "There are notes without name"
+msgstr "Hai notas sen nome"
+
+#: ../src/lingot-gui-config-dialog-scale.c:511
+msgid "Open Scale File"
+msgstr "Abrir arquivo de escala"
+
+#: ../src/lingot-gui-config-dialog-scale.c:519
+msgid "Scala files"
+msgstr "Ficheiros de Scala"
+
+#: ../src/lingot-gui-config-dialog-scale.c:539
+msgid "The scale cannot be imported: file format error"
+msgstr "A escala non pode ser importada: o ficheiro contén erros de formato"
+
+#: ../src/lingot-gui-config-dialog-scale.c:605
+msgid ""
+"Note identifier, free text that will be displayed in the main window when "
+"tuning close to the given note. Don't use space characters here."
+msgstr ""
+"Identificador da nota, texto libre que será amosado na ventá principal "
+"cuando se atope afinando preto da devandita nota. Non empregue caracteres en "
+"blanco aquí."
+
+#: ../src/lingot-gui-config-dialog-scale.c:610
+msgid ""
+"Shift. You can define it as a deviation in cents from the reference note "
+"(the first one), or as a frequency ratio, like '3/2' or '5/4'. All the "
+"values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all "
+"the notes must be in the same octave), and they must be well ordered."
+msgstr ""
+"Desprazamento en frecuencia. Pode definilo coma unha desviación en cents con "
+"respecto á nota de referencia (a primeira), ou coma un múltiplo da súa "
+"frecuencia, como '3/2' ou '5/4'. Tódolos valores deben estar entre 0 e 1200 "
+"cents, ou entre 1/1 e 2/1 (é dicir, tódalas notas deben estar na mesma "
+"octava), e deben estar todos eles ben ordeados."
+
+#: ../src/lingot-gui-config-dialog-scale.c:615
+msgid ""
+"Frequency. You can enter here the absolute frequency for a given note as a "
+"reference, and all the other frequencies will shift according to the "
+"deviations specified in the 'Shift' column. You can use an absolute numeric "
+"value or the keywords 'mid-C' (261.625565 Hz) and 'mid-A' (440 Hz)."
+msgstr ""
+"Frecuencia. Pode definir aquí a frecuencia absoluta dunha nota concreta como "
+"referencia, e o resto de frecuencias estableceránse en base a este valor e ó "
+"desprazamento en frecuencia de cada nota (definido na columna "
+"'Desprazamento'). Pode empregar tanto un valor numérico, ou as palabras "
+"clave 'mid-C' (261.625565 Hz) e 'mid-A' (440 Hz)."
diff --git a/po/it.po b/po/it.po
new file mode 100644
index 0000000..b944322
--- /dev/null
+++ b/po/it.po
@@ -0,0 +1,694 @@
+# translation of it.po to
+# translation of es.po to
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Jairo Chapela Martínez <jairochapela@gmail.com>, 2007.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: it\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-02-21 17:10+0000\n"
+"PO-Revision-Date: 2008-07-27 21:38+0200\n"
+"Last-Translator: cereda.ste@gmail.com\n"
+"Language-Team: <cereda.ste@gmail.com>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+"X-Language: it_IT\n"
+
+#: ../src/glade/lingot-config-dialog.glade.h:1
+msgid ""
+"Adds a new note to the list, just above the selected line, or appends it to "
+"the end if no line is selected. Is not possible to add a note before the "
+"reference (the first) one. You can also use the Insert key on the table "
+"beside."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:2
+msgid "Adjustments"
+msgstr "Regolazioni"
+
+#: ../src/glade/lingot-config-dialog.glade.h:3
+msgid "Advanced"
+msgstr "Avanzate"
+
+#: ../src/glade/lingot-config-dialog.glade.h:4
+msgid ""
+"Advanced settings on the frequency finding algorithm. You should not modify "
+"these parameters unless you really need it and you have a good understanding "
+"of the algorithm. Use the 'Default' button if you get lost, and use those "
+"default parameters as your reference."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:5
+msgid ""
+"After having chosen the fundamental peak on the FFT, Lingot computes a "
+"series of N (being N this parameter) DFTs localized in frequency to enclose "
+"the fundamental frequency."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:6
+msgid ""
+"All the peaks with an amplitude difference with the highest one greater than "
+"this parameter will be rejected as a candidate to host the fundamental "
+"frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:7
+msgid ""
+"Allows you to adapt the signal levels without the aid of an external mixer."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:8
+msgid ""
+"Any signal level below this value will be considered as noise. This noise "
+"level is depicted in the spectrum area as a yellow dotted line."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:9
+msgid ""
+"Applies a shift in frequency to all the notes defined in the table above."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:10
+msgid "Apply the current changes and modify the congifuration file."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:11
+msgid ""
+"Apply the current changes to the running tuner, but doesn't modify the "
+"configuration file."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:12
+#, fuzzy
+msgid "Audio device"
+msgstr "Periferica audio"
+
+#: ../src/glade/lingot-config-dialog.glade.h:13
+msgid "Audio input settings. Set here the source and hardware settings."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:14
+msgid "Audio system"
+msgstr "Sistema audio"
+
+#: ../src/glade/lingot-config-dialog.glade.h:15
+msgid "Basic"
+msgstr "Basilare"
+
+#: ../src/glade/lingot-config-dialog.glade.h:16
+msgid ""
+"Basic settings on the frequency finding algorithm. Come here to get better "
+"accuracy, frequency range or CPU usage. "
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:17
+msgid "Calculation rate"
+msgstr "Velocità di calcolo"
+
+#: ../src/glade/lingot-config-dialog.glade.h:18
+msgid "Capture"
+msgstr "Cattura"
+
+#: ../src/glade/lingot-config-dialog.glade.h:19
+msgid ""
+"Choose the audio device if you have more than one. You cannot modify this "
+"field if you are using JACK, but you can connect Lingot to a desired source "
+"externally."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:20
+msgid ""
+"Choose the hardware sample rate here. We give you some examples, but you can "
+"choose another one. Please, be aware that depending on the audio system and/"
+"or device, not all the sampling frequencies are available. Anyway, you can "
+"get close to your desired effective sample rate by combining this parameter "
+"with the oversampling factor (Basic tab). If you are using JACK, you cannot "
+"modify this field, but you can change it externally (in the JACK server "
+"configuration)."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:21
+msgid "DFT number"
+msgstr "Numero di DFT"
+
+#: ../src/glade/lingot-config-dialog.glade.h:22
+msgid "DFT size"
+msgstr "Grandezza DFT"
+
+#: ../src/glade/lingot-config-dialog.glade.h:23
+msgid "DFTs"
+msgstr "DFTs"
+
+#: ../src/glade/lingot-config-dialog.glade.h:24
+msgid "Default"
+msgstr "Configurazione predefinita"
+
+#: ../src/glade/lingot-config-dialog.glade.h:25
+msgid "Delete"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:26
+msgid ""
+"Deletes the selected notes. The reference note, i.e., the first one, cannot "
+"be removed. You can also use the Delete key on the table beside."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:27
+#: ../src/glade/lingot-mainframe.glade.h:3
+msgid "Deviation"
+msgstr "Deviazione"
+
+#: ../src/glade/lingot-config-dialog.glade.h:28
+msgid "Effective sample rate"
+msgstr "Frequenza di campionamento effettiva"
+
+#: ../src/glade/lingot-config-dialog.glade.h:29
+msgid ""
+"Effective sampling frequency. The lower this parameter is, the more accurate "
+"the FFT will be, and hence the better is the hooking up to the correct peak. "
+"Remember, however, that your temporal window will increase, and the fact "
+"that you won't be able to tune frequencies above the half of this frequency "
+"(Nyquist-Shannon sampling theorem)."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:30
+msgid "FFT size"
+msgstr "Grandezza FFT"
+
+#: ../src/glade/lingot-config-dialog.glade.h:31
+msgid "Gain"
+msgstr "Guadagno"
+
+#: ../src/glade/lingot-config-dialog.glade.h:32
+msgid "Hardware sampling frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:33
+msgid "Here you can pick the sound system."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:34
+msgid "Hz"
+msgstr "Hz"
+
+#: ../src/glade/lingot-config-dialog.glade.h:35
+msgid "Import"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:36
+msgid ""
+"Imports the scale from an external .scl file, with the Scala project format "
+"(http://www.huygens-fokker.org/scala/)"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:37
+msgid "Insert"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:38
+msgid ""
+"Lingot is an universal tuner, it can tune any instrument according to the "
+"scale you define here."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:39
+msgid "Lingot only considers frequencies above this one."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:40
+msgid "Minimum frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:41
+#: ../src/lingot-gui-config-dialog-scale.c:322
+msgid "Name"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:42
+msgid "Noise threshold"
+msgstr "Soglia di rumore"
+
+#: ../src/glade/lingot-config-dialog.glade.h:43
+msgid "Number of calculations of the fundamental frequency per second."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:44
+msgid ""
+"Number of main peaks considered over the FFT. Remember that sometimes the "
+"first harmonics can have a higher amplitude than the fundamental component, "
+"depending on your instrument."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:45
+msgid ""
+"Number of samples needed by a peak at each side, lower in amplitude than the "
+"sample at the center, to be considered as a peak. You should not consider "
+"more than 1 or 2 samples, unless you have a really big FFT buffer."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:46
+msgid "Number of samples of each DFT."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:47
+msgid ""
+"Number of visualizations per second of the (last) computed frequency, error "
+"and spectrum. "
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:48
+msgid "Oversampling factor"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:49
+msgid "Peak half-width"
+msgstr "Metà larghezza picco"
+
+#: ../src/glade/lingot-config-dialog.glade.h:50
+msgid "Peak number"
+msgstr "Numero di picchi"
+
+#: ../src/glade/lingot-config-dialog.glade.h:51
+msgid "Peak rejection relation"
+msgstr "Soglia di rigetto picco"
+
+#: ../src/glade/lingot-config-dialog.glade.h:52
+msgid "Quick adjusments on the dynamic response and the signal levels."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:53
+msgid "Resets the built-in settings, without applying them."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:54
+msgid ""
+"Rolls back all the previous applied changes and closes the configuration "
+"dialog."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:55
+msgid "Sample rate"
+msgstr "Frequenza campione"
+
+#: ../src/glade/lingot-config-dialog.glade.h:56
+msgid "Scale"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:57
+msgid "Scale name, only for your information."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:58
+msgid "Temporal window"
+msgstr "Finestra temporale"
+
+#: ../src/glade/lingot-config-dialog.glade.h:59
+msgid ""
+"The FFT buffer gives Lingot a first look to the spectrum. Higher values can "
+"help Lingot to hook up the correct peak, but it's also computationally more "
+"expensive. Don't use high values here unless you have an equally high "
+"effective sample rate."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:60
+msgid ""
+"This is the most recent amount of data considered for tuning. The longer it "
+"is, the more accuracy you can obtain, but also the dynamic response gets "
+"lower, because you are considering older parts of the signal. Also, if you "
+"raise this parameter, the computational cost increases. This value, in "
+"samples (depending on the effective sample rate), must be greater or equal "
+"to the FFT buffer size."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:61
+msgid "Visualization rate"
+msgstr "Soglia di visualizzazione"
+
+#: ../src/glade/lingot-config-dialog.glade.h:62
+msgid "cents"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:63
+msgid "dB"
+msgstr "dB"
+
+#: ../src/glade/lingot-config-dialog.glade.h:64
+msgid "lingot configuration"
+msgstr "configura lingot"
+
+#: ../src/glade/lingot-config-dialog.glade.h:65
+msgid "peaks"
+msgstr "picchi"
+
+#: ../src/glade/lingot-config-dialog.glade.h:66
+msgid "samples"
+msgstr "campioni"
+
+#: ../src/glade/lingot-config-dialog.glade.h:67
+msgid "seconds"
+msgstr "secondi"
+
+#: ../src/glade/lingot-mainframe.glade.h:1
+msgid "---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:2
+msgid ""
+"Closest note to the estimated frequency, according to the scale defined in "
+"the Lingot settings."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:4
+msgid ""
+"Error in cents between the estimated frequency and the closest note "
+"according to the scale defined in the Lingot settings."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:5
+msgid "Estimated fundamental frequency in hertzs."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:6
+msgid "Opens an external configuration file."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:7
+msgid "Saves the running configuration to an external file."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:8
+#, fuzzy
+msgid "Show spectrum"
+msgstr "Spettro"
+
+#: ../src/glade/lingot-mainframe.glade.h:9
+msgid ""
+"Shows the error in cents in a visual way. The range will depend on the "
+"maximum distance between each two notes in the scale defined in the Lingot "
+"settings (try to provide scales with low maximum distance, i.e. with many "
+"notes, to have a higher resolution in this gauge),"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:10
+msgid "Spectrum"
+msgstr "Spettro"
+
+#: ../src/glade/lingot-mainframe.glade.h:11
+msgid ""
+"This area shows the spectral power density of the captured signal. The "
+"fundamental frequency is shown with a red dot, and the noise threshold with "
+"a horizontal dotted yellow line. If you have a large FFT buffer (with more "
+"than 512 samples), you can browse through the whole spectrum with a "
+"horizontal scrollbar."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:12
+msgid "Tone"
+msgstr "Nota"
+
+#: ../src/glade/lingot-mainframe.glade.h:13
+#, fuzzy
+msgid "_Edit"
+msgstr "_Modifica"
+
+#: ../src/glade/lingot-mainframe.glade.h:14
+msgid "_File"
+msgstr "_File"
+
+#: ../src/glade/lingot-mainframe.glade.h:15
+msgid "_Help"
+msgstr "_Aiuto"
+
+#: ../src/glade/lingot-mainframe.glade.h:16
+msgid "_View"
+msgstr "_Visualizza"
+
+#: ../src/glade/lingot-mainframe.glade.h:17
+msgid "e = ---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:18
+msgid "f = ---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:19
+msgid "lingot"
+msgstr "lingot"
+
+#: ../src/lingot-audio-oss.c:56
+#, c-format
+msgid ""
+"Unable to open audio device %s.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:63
+#, c-format
+msgid ""
+"Error setting number of channels.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:71
+#, c-format
+msgid ""
+"Error setting bits per sample.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:86
+#, c-format
+msgid ""
+"Error setting DMA buffer size.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:92
+#, fuzzy, c-format
+msgid ""
+"Error setting sample rate.\n"
+"%s."
+msgstr "Frequenza di campionamento effettiva"
+
+#: ../src/lingot-audio-oss.c:132 ../src/lingot-audio-alsa.c:167
+#, c-format
+msgid ""
+"Read from audio interface failed.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-alsa.c:139
+#, fuzzy
+msgid "The application has not been built with ALSA support"
+msgstr "L'applicazione è stata compilata senza il supporto a ALSA"
+
+#: ../src/lingot-audio-jack.c:61
+msgid "Missing connection with JACK audio server"
+msgstr "Manca la connessione al server audio JACK"
+
+#: ../src/lingot-audio-jack.c:90 ../src/lingot-audio-jack.c:190
+msgid "Unable to connect to JACK server"
+msgstr "Impossibile connettersi al server JACK"
+
+#: ../src/lingot-audio-jack.c:115
+msgid "No more JACK ports available"
+msgstr "Nessuna porta di JACK disponibile"
+
+#: ../src/lingot-audio-jack.c:133 ../src/lingot-audio-jack.c:247
+#: ../src/lingot-audio-jack.c:314 ../src/lingot-audio-jack.c:346
+msgid "The application has not been built with JACK support"
+msgstr "L'applicazione è stata compilata senza il supporto a JACK"
+
+#: ../src/lingot-audio-jack.c:265
+msgid "Cannot activate client"
+msgstr "Impossibile attivare il client"
+
+#: ../src/lingot-audio-jack.c:271
+#, fuzzy
+msgid "No active capture ports"
+msgstr "Nessuna porta di fisica di cattura"
+
+#: ../src/lingot-audio-jack.c:282 ../src/lingot-audio-jack.c:302
+msgid "Cannot connect input ports"
+msgstr "Impossibile connettere le porte d'ingresso"
+
+#: ../src/lingot-audio-jack.c:297
+msgid "No physical capture ports"
+msgstr "Nessuna porta di fisica di cattura"
+
+#: ../src/lingot-config.c:436
+#, c-format
+msgid ""
+"Error parsing the configuration file, line %i: unrecognized audio system "
+"'%s', assuming default audio system.\n"
+msgstr ""
+
+#: ../src/lingot-config.c:452
+msgid ""
+"The configuration file contains errors, and hence some default values have "
+"been chosen. Consider checking the settings and fixing the problem using the "
+"configuration dialog."
+msgstr ""
+
+#: ../src/lingot-core.c:86
+#, c-format
+msgid ""
+"The requested sample rate is not available, the real sample rate has been "
+"set to %d Hz"
+msgstr ""
+
+#: ../src/lingot-core.c:99
+#, c-format
+msgid ""
+"The temporal buffer is smaller than FFT size. It has been increased to %0.3f "
+"seconds"
+msgstr ""
+"Il buffer temporale è più piccolo dell'FFT. È stato aumentato a %0.3f secondi"
+
+#: ../src/lingot-gui-mainframe.c:100
+msgid "Accurate and easy to use musical instrument tuner"
+msgstr "Accordatore di strumenti affidabile e semplice da usare"
+
+#: ../src/lingot-gui-mainframe.c:104
+msgid "translator-credits"
+msgstr "Stefano Cereda <communico@tiscali.it>"
+
+#: ../src/lingot-gui-mainframe.c:247
+msgid "Error"
+msgstr "Errore"
+
+#: ../src/lingot-gui-mainframe.c:248
+msgid "Warning"
+msgstr "Attenzione"
+
+#: ../src/lingot-gui-mainframe.c:248
+msgid "Info"
+msgstr ""
+
+#: ../src/lingot-gui-mainframe.c:267
+#, fuzzy
+msgid "Open Configuration File"
+msgstr "configura lingot"
+
+#: ../src/lingot-gui-mainframe.c:275 ../src/lingot-gui-mainframe.c:318
+#, fuzzy
+msgid "Lingot configuration files"
+msgstr "configura lingot"
+
+#: ../src/lingot-gui-mainframe.c:307
+#, fuzzy
+msgid "Save Configuration File"
+msgstr "configura lingot"
+
+#: ../src/lingot-gui-config-dialog.c:311
+msgid ""
+"The provided scale contains wide gaps in frequency that increase the gauge "
+"range and produce a loss of visual accuracy. Consider providing scales with "
+"at least 12 tones, or with a maximum distance between adjacent notes below "
+"200 cents."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:84
+msgid "You cannot insert before the reference note."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:210
+msgid "Do not use space characters for the note names."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:213
+msgid "The name contains illegal characters."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:230
+msgid "You cannot change the first shift, it must be 1/1."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:237
+msgid "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:339
+msgid "Shift"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:360
+msgid "Frequency [Hz]"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:417
+msgid "There are notes with the same name"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:431
+msgid ""
+"There are invalid values in the scale: the notes should be ordered by "
+"frequency / shift"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:438
+msgid ""
+"There are invalid values in the scale: all the notes should be in the same "
+"octave"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:447
+msgid "There are notes without name"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:511
+msgid "Open Scale File"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:519
+msgid "Scala files"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:539
+msgid "The scale cannot be imported: file format error"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:605
+msgid ""
+"Note identifier, free text that will be displayed in the main window when "
+"tuning close to the given note. Don't use space characters here."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:610
+msgid ""
+"Shift. You can define it as a deviation in cents from the reference note "
+"(the first one), or as a frequency ratio, like '3/2' or '5/4'. All the "
+"values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all "
+"the notes must be in the same octave), and they must be well ordered."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:615
+msgid ""
+"Frequency. You can enter here the absolute frequency for a given note as a "
+"reference, and all the other frequencies will shift according to the "
+"deviations specified in the 'Shift' column. You can use an absolute numeric "
+"value or the keywords 'mid-C' (261.625565 Hz) and 'mid-A' (440 Hz)."
+msgstr ""
+
+#~ msgid "Root frequency"
+#~ msgstr "Frequenza base"
+
+#~ msgid "freq"
+#~ msgstr "freq"
+
+#~ msgid "err"
+#~ msgstr "err"
+
+#~ msgid "440 (A) +"
+#~ msgstr " A (440 Hz) + "
+
+#~ msgid "General parameters"
+#~ msgstr "Parametri generali"
+
+#~ msgid "Advanced parameters"
+#~ msgstr "Parametri avanzati"
diff --git a/po/pt_BR.po b/po/pt_BR.po
new file mode 100644
index 0000000..1b2633c
--- /dev/null
+++ b/po/pt_BR.po
@@ -0,0 +1,697 @@
+# translation of pt_BR.po to Português do Brasil
+# Copyright (C) 2008 Carlos Laué
+# This file is distributed under the same license as the lingot package.
+#
+# Carlos Laue <carlosl@seznam.cz>, 2008, 2010.
+msgid ""
+msgstr ""
+"Project-Id-Version: pt_BR\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-02-21 17:10+0000\n"
+"PO-Revision-Date: 2008-06-24 14:00+0200\n"
+"Last-Translator: Carlos Laue <carlosl@seznam.cz>\n"
+"Language-Team: Português do Brasil\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+"X-Language: pt_BR\n"
+
+#: ../src/glade/lingot-config-dialog.glade.h:1
+msgid ""
+"Adds a new note to the list, just above the selected line, or appends it to "
+"the end if no line is selected. Is not possible to add a note before the "
+"reference (the first) one. You can also use the Insert key on the table "
+"beside."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:2
+msgid "Adjustments"
+msgstr "Ajustes"
+
+#: ../src/glade/lingot-config-dialog.glade.h:3
+msgid "Advanced"
+msgstr "Avançado"
+
+#: ../src/glade/lingot-config-dialog.glade.h:4
+msgid ""
+"Advanced settings on the frequency finding algorithm. You should not modify "
+"these parameters unless you really need it and you have a good understanding "
+"of the algorithm. Use the 'Default' button if you get lost, and use those "
+"default parameters as your reference."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:5
+msgid ""
+"After having chosen the fundamental peak on the FFT, Lingot computes a "
+"series of N (being N this parameter) DFTs localized in frequency to enclose "
+"the fundamental frequency."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:6
+msgid ""
+"All the peaks with an amplitude difference with the highest one greater than "
+"this parameter will be rejected as a candidate to host the fundamental "
+"frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:7
+msgid ""
+"Allows you to adapt the signal levels without the aid of an external mixer."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:8
+msgid ""
+"Any signal level below this value will be considered as noise. This noise "
+"level is depicted in the spectrum area as a yellow dotted line."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:9
+msgid ""
+"Applies a shift in frequency to all the notes defined in the table above."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:10
+msgid "Apply the current changes and modify the congifuration file."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:11
+msgid ""
+"Apply the current changes to the running tuner, but doesn't modify the "
+"configuration file."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:12
+#, fuzzy
+msgid "Audio device"
+msgstr "Dispositivo de som"
+
+#: ../src/glade/lingot-config-dialog.glade.h:13
+msgid "Audio input settings. Set here the source and hardware settings."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:14
+msgid "Audio system"
+msgstr "Sistema de som"
+
+#: ../src/glade/lingot-config-dialog.glade.h:15
+msgid "Basic"
+msgstr "Básico"
+
+#: ../src/glade/lingot-config-dialog.glade.h:16
+msgid ""
+"Basic settings on the frequency finding algorithm. Come here to get better "
+"accuracy, frequency range or CPU usage. "
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:17
+msgid "Calculation rate"
+msgstr "Freqüência de cálculo"
+
+#: ../src/glade/lingot-config-dialog.glade.h:18
+msgid "Capture"
+msgstr "Captura"
+
+#: ../src/glade/lingot-config-dialog.glade.h:19
+msgid ""
+"Choose the audio device if you have more than one. You cannot modify this "
+"field if you are using JACK, but you can connect Lingot to a desired source "
+"externally."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:20
+msgid ""
+"Choose the hardware sample rate here. We give you some examples, but you can "
+"choose another one. Please, be aware that depending on the audio system and/"
+"or device, not all the sampling frequencies are available. Anyway, you can "
+"get close to your desired effective sample rate by combining this parameter "
+"with the oversampling factor (Basic tab). If you are using JACK, you cannot "
+"modify this field, but you can change it externally (in the JACK server "
+"configuration)."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:21
+msgid "DFT number"
+msgstr "Número de DFTs"
+
+#: ../src/glade/lingot-config-dialog.glade.h:22
+msgid "DFT size"
+msgstr "Tamanho da DFT"
+
+#: ../src/glade/lingot-config-dialog.glade.h:23
+msgid "DFTs"
+msgstr "DFTs"
+
+#: ../src/glade/lingot-config-dialog.glade.h:24
+msgid "Default"
+msgstr "Configuração padrão"
+
+#: ../src/glade/lingot-config-dialog.glade.h:25
+msgid "Delete"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:26
+msgid ""
+"Deletes the selected notes. The reference note, i.e., the first one, cannot "
+"be removed. You can also use the Delete key on the table beside."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:27
+#: ../src/glade/lingot-mainframe.glade.h:3
+msgid "Deviation"
+msgstr "Diferença"
+
+#: ../src/glade/lingot-config-dialog.glade.h:28
+msgid "Effective sample rate"
+msgstr "Freqüência de amostragem efetiva"
+
+#: ../src/glade/lingot-config-dialog.glade.h:29
+msgid ""
+"Effective sampling frequency. The lower this parameter is, the more accurate "
+"the FFT will be, and hence the better is the hooking up to the correct peak. "
+"Remember, however, that your temporal window will increase, and the fact "
+"that you won't be able to tune frequencies above the half of this frequency "
+"(Nyquist-Shannon sampling theorem)."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:30
+msgid "FFT size"
+msgstr "Tamanho da FFT"
+
+#: ../src/glade/lingot-config-dialog.glade.h:31
+msgid "Gain"
+msgstr "Ganho"
+
+#: ../src/glade/lingot-config-dialog.glade.h:32
+msgid "Hardware sampling frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:33
+msgid "Here you can pick the sound system."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:34
+msgid "Hz"
+msgstr "Hz"
+
+#: ../src/glade/lingot-config-dialog.glade.h:35
+msgid "Import"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:36
+msgid ""
+"Imports the scale from an external .scl file, with the Scala project format "
+"(http://www.huygens-fokker.org/scala/)"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:37
+msgid "Insert"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:38
+msgid ""
+"Lingot is an universal tuner, it can tune any instrument according to the "
+"scale you define here."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:39
+msgid "Lingot only considers frequencies above this one."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:40
+msgid "Minimum frequency"
+msgstr "Frequencia mínima"
+
+#: ../src/glade/lingot-config-dialog.glade.h:41
+#: ../src/lingot-gui-config-dialog-scale.c:322
+msgid "Name"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:42
+msgid "Noise threshold"
+msgstr "Nível de ruído ignorado"
+
+#: ../src/glade/lingot-config-dialog.glade.h:43
+msgid "Number of calculations of the fundamental frequency per second."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:44
+msgid ""
+"Number of main peaks considered over the FFT. Remember that sometimes the "
+"first harmonics can have a higher amplitude than the fundamental component, "
+"depending on your instrument."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:45
+msgid ""
+"Number of samples needed by a peak at each side, lower in amplitude than the "
+"sample at the center, to be considered as a peak. You should not consider "
+"more than 1 or 2 samples, unless you have a really big FFT buffer."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:46
+msgid "Number of samples of each DFT."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:47
+msgid ""
+"Number of visualizations per second of the (last) computed frequency, error "
+"and spectrum. "
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:48
+msgid "Oversampling factor"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:49
+msgid "Peak half-width"
+msgstr "Ordem de cristas"
+
+#: ../src/glade/lingot-config-dialog.glade.h:50
+msgid "Peak number"
+msgstr "Número de cristas"
+
+#: ../src/glade/lingot-config-dialog.glade.h:51
+msgid "Peak rejection relation"
+msgstr "Relação de rejeição de cristas"
+
+#: ../src/glade/lingot-config-dialog.glade.h:52
+msgid "Quick adjusments on the dynamic response and the signal levels."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:53
+msgid "Resets the built-in settings, without applying them."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:54
+msgid ""
+"Rolls back all the previous applied changes and closes the configuration "
+"dialog."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:55
+msgid "Sample rate"
+msgstr "Freqüência de amostragem"
+
+#: ../src/glade/lingot-config-dialog.glade.h:56
+msgid "Scale"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:57
+msgid "Scale name, only for your information."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:58
+msgid "Temporal window"
+msgstr "Janela temporal"
+
+#: ../src/glade/lingot-config-dialog.glade.h:59
+msgid ""
+"The FFT buffer gives Lingot a first look to the spectrum. Higher values can "
+"help Lingot to hook up the correct peak, but it's also computationally more "
+"expensive. Don't use high values here unless you have an equally high "
+"effective sample rate."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:60
+msgid ""
+"This is the most recent amount of data considered for tuning. The longer it "
+"is, the more accuracy you can obtain, but also the dynamic response gets "
+"lower, because you are considering older parts of the signal. Also, if you "
+"raise this parameter, the computational cost increases. This value, in "
+"samples (depending on the effective sample rate), must be greater or equal "
+"to the FFT buffer size."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:61
+msgid "Visualization rate"
+msgstr "Freqüência de visualizaçâo"
+
+#: ../src/glade/lingot-config-dialog.glade.h:62
+msgid "cents"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:63
+msgid "dB"
+msgstr "dB"
+
+#: ../src/glade/lingot-config-dialog.glade.h:64
+msgid "lingot configuration"
+msgstr "Configuração do lingot"
+
+#: ../src/glade/lingot-config-dialog.glade.h:65
+msgid "peaks"
+msgstr "cristas"
+
+#: ../src/glade/lingot-config-dialog.glade.h:66
+msgid "samples"
+msgstr "amostras"
+
+#: ../src/glade/lingot-config-dialog.glade.h:67
+msgid "seconds"
+msgstr "segundos"
+
+#: ../src/glade/lingot-mainframe.glade.h:1
+msgid "---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:2
+msgid ""
+"Closest note to the estimated frequency, according to the scale defined in "
+"the Lingot settings."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:4
+msgid ""
+"Error in cents between the estimated frequency and the closest note "
+"according to the scale defined in the Lingot settings."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:5
+msgid "Estimated fundamental frequency in hertzs."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:6
+msgid "Opens an external configuration file."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:7
+msgid "Saves the running configuration to an external file."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:8
+#, fuzzy
+msgid "Show spectrum"
+msgstr "Espectro"
+
+#: ../src/glade/lingot-mainframe.glade.h:9
+msgid ""
+"Shows the error in cents in a visual way. The range will depend on the "
+"maximum distance between each two notes in the scale defined in the Lingot "
+"settings (try to provide scales with low maximum distance, i.e. with many "
+"notes, to have a higher resolution in this gauge),"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:10
+msgid "Spectrum"
+msgstr "Espectro"
+
+#: ../src/glade/lingot-mainframe.glade.h:11
+msgid ""
+"This area shows the spectral power density of the captured signal. The "
+"fundamental frequency is shown with a red dot, and the noise threshold with "
+"a horizontal dotted yellow line. If you have a large FFT buffer (with more "
+"than 512 samples), you can browse through the whole spectrum with a "
+"horizontal scrollbar."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:12
+msgid "Tone"
+msgstr "Nota"
+
+#: ../src/glade/lingot-mainframe.glade.h:13
+#, fuzzy
+msgid "_Edit"
+msgstr "_Editar"
+
+#: ../src/glade/lingot-mainframe.glade.h:14
+msgid "_File"
+msgstr "_Arquivo"
+
+#: ../src/glade/lingot-mainframe.glade.h:15
+msgid "_Help"
+msgstr "A_juda"
+
+#: ../src/glade/lingot-mainframe.glade.h:16
+msgid "_View"
+msgstr "_Ver"
+
+#: ../src/glade/lingot-mainframe.glade.h:17
+msgid "e = ---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:18
+msgid "f = ---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:19
+msgid "lingot"
+msgstr "lingot"
+
+#: ../src/lingot-audio-oss.c:56
+#, c-format
+msgid ""
+"Unable to open audio device %s.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:63
+#, c-format
+msgid ""
+"Error setting number of channels.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:71
+#, c-format
+msgid ""
+"Error setting bits per sample.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:86
+#, c-format
+msgid ""
+"Error setting DMA buffer size.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:92
+#, fuzzy, c-format
+msgid ""
+"Error setting sample rate.\n"
+"%s."
+msgstr "Freqüência de amostragem efetiva"
+
+#: ../src/lingot-audio-oss.c:132 ../src/lingot-audio-alsa.c:167
+#, c-format
+msgid ""
+"Read from audio interface failed.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-alsa.c:139
+msgid "The application has not been built with ALSA support"
+msgstr "A aplicação nao foi compilada com suporte ALSA"
+
+#: ../src/lingot-audio-jack.c:61
+msgid "Missing connection with JACK audio server"
+msgstr "Falha de conexão com servidor de áudio JACK"
+
+#: ../src/lingot-audio-jack.c:90 ../src/lingot-audio-jack.c:190
+msgid "Unable to connect to JACK server"
+msgstr "Impossível de conetar com o servidor JACK"
+
+#: ../src/lingot-audio-jack.c:115
+msgid "No more JACK ports available"
+msgstr "Nenhuma porta JACK disponível"
+
+#: ../src/lingot-audio-jack.c:133 ../src/lingot-audio-jack.c:247
+#: ../src/lingot-audio-jack.c:314 ../src/lingot-audio-jack.c:346
+msgid "The application has not been built with JACK support"
+msgstr "O programa não foi compilada com o suporte ao JACK"
+
+#: ../src/lingot-audio-jack.c:265
+msgid "Cannot activate client"
+msgstr "Ativação do cliente impossível"
+
+#: ../src/lingot-audio-jack.c:271
+#, fuzzy
+msgid "No active capture ports"
+msgstr "Porta de captura inexistente"
+
+#: ../src/lingot-audio-jack.c:282 ../src/lingot-audio-jack.c:302
+msgid "Cannot connect input ports"
+msgstr "Impossível conetar as portas de entrada"
+
+#: ../src/lingot-audio-jack.c:297
+msgid "No physical capture ports"
+msgstr "Porta de captura inexistente"
+
+#: ../src/lingot-config.c:436
+#, c-format
+msgid ""
+"Error parsing the configuration file, line %i: unrecognized audio system "
+"'%s', assuming default audio system.\n"
+msgstr ""
+
+#: ../src/lingot-config.c:452
+msgid ""
+"The configuration file contains errors, and hence some default values have "
+"been chosen. Consider checking the settings and fixing the problem using the "
+"configuration dialog."
+msgstr ""
+
+#: ../src/lingot-core.c:86
+#, c-format
+msgid ""
+"The requested sample rate is not available, the real sample rate has been "
+"set to %d Hz"
+msgstr ""
+
+#: ../src/lingot-core.c:99
+#, fuzzy, c-format
+msgid ""
+"The temporal buffer is smaller than FFT size. It has been increased to %0.3f "
+"seconds"
+msgstr ""
+"O buffer temporal é menor que o tamanho da FFT escolhido, Fora ampliado para "
+"%0.3f segundos."
+
+#: ../src/lingot-gui-mainframe.c:100
+msgid "Accurate and easy to use musical instrument tuner"
+msgstr "Afinador de instrumentos musicais preciso e fácil de usar"
+
+#: ../src/lingot-gui-mainframe.c:104
+msgid "translator-credits"
+msgstr "Carlos Laué <carlosl@seznam.cz>"
+
+#: ../src/lingot-gui-mainframe.c:247
+msgid "Error"
+msgstr "Erro"
+
+#: ../src/lingot-gui-mainframe.c:248
+msgid "Warning"
+msgstr "Atenção"
+
+#: ../src/lingot-gui-mainframe.c:248
+msgid "Info"
+msgstr ""
+
+#: ../src/lingot-gui-mainframe.c:267
+#, fuzzy
+msgid "Open Configuration File"
+msgstr "Configuração do lingot"
+
+#: ../src/lingot-gui-mainframe.c:275 ../src/lingot-gui-mainframe.c:318
+#, fuzzy
+msgid "Lingot configuration files"
+msgstr "Configuração do lingot"
+
+#: ../src/lingot-gui-mainframe.c:307
+#, fuzzy
+msgid "Save Configuration File"
+msgstr "Configuração do lingot"
+
+#: ../src/lingot-gui-config-dialog.c:311
+msgid ""
+"The provided scale contains wide gaps in frequency that increase the gauge "
+"range and produce a loss of visual accuracy. Consider providing scales with "
+"at least 12 tones, or with a maximum distance between adjacent notes below "
+"200 cents."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:84
+msgid "You cannot insert before the reference note."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:210
+msgid "Do not use space characters for the note names."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:213
+msgid "The name contains illegal characters."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:230
+msgid "You cannot change the first shift, it must be 1/1."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:237
+msgid "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:339
+msgid "Shift"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:360
+msgid "Frequency [Hz]"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:417
+msgid "There are notes with the same name"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:431
+msgid ""
+"There are invalid values in the scale: the notes should be ordered by "
+"frequency / shift"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:438
+msgid ""
+"There are invalid values in the scale: all the notes should be in the same "
+"octave"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:447
+msgid "There are notes without name"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:511
+msgid "Open Scale File"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:519
+msgid "Scala files"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:539
+msgid "The scale cannot be imported: file format error"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:605
+msgid ""
+"Note identifier, free text that will be displayed in the main window when "
+"tuning close to the given note. Don't use space characters here."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:610
+msgid ""
+"Shift. You can define it as a deviation in cents from the reference note "
+"(the first one), or as a frequency ratio, like '3/2' or '5/4'. All the "
+"values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all "
+"the notes must be in the same octave), and they must be well ordered."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:615
+msgid ""
+"Frequency. You can enter here the absolute frequency for a given note as a "
+"reference, and all the other frequencies will shift according to the "
+"deviations specified in the 'Shift' column. You can use an absolute numeric "
+"value or the keywords 'mid-C' (261.625565 Hz) and 'mid-A' (440 Hz)."
+msgstr ""
+
+#~ msgid "Root frequency"
+#~ msgstr "Freqüência padrão"
+
+#~ msgid "freq"
+#~ msgstr "freqüência"
+
+#~ msgid "err"
+#~ msgstr "erro"
+
+#~ msgid "440 (A) +"
+#~ msgstr "A (440 Hz) +"
+
+#~ msgid "General parameters"
+#~ msgstr "Parâmetros gerais"
+
+#~ msgid "Advanced parameters"
+#~ msgstr "Parâmetros avançados"
+
+#~ msgid "Matthew Blissett (Logo design)"
+#~ msgstr "Matthew Blissett (Design do logotipo)"
diff --git a/po/sv.po b/po/sv.po
new file mode 100644
index 0000000..4183994
--- /dev/null
+++ b/po/sv.po
@@ -0,0 +1,692 @@
+# Swedish messages for lingot
+# Copyright (C) 2007-2009 Ibán Cereijo Graña, Jairo Chapela Martínez.
+# This file is distributed under the same license as the lingot package.
+# John Gustafsson <jamminjohn@users.sourceforge.net>, 2008-2009.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: lingot\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-02-21 17:10+0000\n"
+"PO-Revision-Date: 2009-07-17 18:04+0100\n"
+"Last-Translator: John Gustafsson <jamminjohn@users.sourceforge.net>\n"
+"Language-Team: Swedish <sv@li.org>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../src/glade/lingot-config-dialog.glade.h:1
+msgid ""
+"Adds a new note to the list, just above the selected line, or appends it to "
+"the end if no line is selected. Is not possible to add a note before the "
+"reference (the first) one. You can also use the Insert key on the table "
+"beside."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:2
+msgid "Adjustments"
+msgstr "Justeringar"
+
+#: ../src/glade/lingot-config-dialog.glade.h:3
+msgid "Advanced"
+msgstr "Avancerat"
+
+#: ../src/glade/lingot-config-dialog.glade.h:4
+msgid ""
+"Advanced settings on the frequency finding algorithm. You should not modify "
+"these parameters unless you really need it and you have a good understanding "
+"of the algorithm. Use the 'Default' button if you get lost, and use those "
+"default parameters as your reference."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:5
+msgid ""
+"After having chosen the fundamental peak on the FFT, Lingot computes a "
+"series of N (being N this parameter) DFTs localized in frequency to enclose "
+"the fundamental frequency."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:6
+msgid ""
+"All the peaks with an amplitude difference with the highest one greater than "
+"this parameter will be rejected as a candidate to host the fundamental "
+"frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:7
+msgid ""
+"Allows you to adapt the signal levels without the aid of an external mixer."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:8
+msgid ""
+"Any signal level below this value will be considered as noise. This noise "
+"level is depicted in the spectrum area as a yellow dotted line."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:9
+msgid ""
+"Applies a shift in frequency to all the notes defined in the table above."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:10
+msgid "Apply the current changes and modify the congifuration file."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:11
+msgid ""
+"Apply the current changes to the running tuner, but doesn't modify the "
+"configuration file."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:12
+#, fuzzy
+msgid "Audio device"
+msgstr "Ljudenhet"
+
+#: ../src/glade/lingot-config-dialog.glade.h:13
+msgid "Audio input settings. Set here the source and hardware settings."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:14
+msgid "Audio system"
+msgstr "Ljudsystem"
+
+#: ../src/glade/lingot-config-dialog.glade.h:15
+msgid "Basic"
+msgstr "Grundläggande"
+
+#: ../src/glade/lingot-config-dialog.glade.h:16
+msgid ""
+"Basic settings on the frequency finding algorithm. Come here to get better "
+"accuracy, frequency range or CPU usage. "
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:17
+msgid "Calculation rate"
+msgstr "Beräkningsfrekvens"
+
+#: ../src/glade/lingot-config-dialog.glade.h:18
+msgid "Capture"
+msgstr "Ljudfångst"
+
+#: ../src/glade/lingot-config-dialog.glade.h:19
+msgid ""
+"Choose the audio device if you have more than one. You cannot modify this "
+"field if you are using JACK, but you can connect Lingot to a desired source "
+"externally."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:20
+msgid ""
+"Choose the hardware sample rate here. We give you some examples, but you can "
+"choose another one. Please, be aware that depending on the audio system and/"
+"or device, not all the sampling frequencies are available. Anyway, you can "
+"get close to your desired effective sample rate by combining this parameter "
+"with the oversampling factor (Basic tab). If you are using JACK, you cannot "
+"modify this field, but you can change it externally (in the JACK server "
+"configuration)."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:21
+msgid "DFT number"
+msgstr "Antal DFTer"
+
+#: ../src/glade/lingot-config-dialog.glade.h:22
+msgid "DFT size"
+msgstr "DFT-storlek"
+
+#: ../src/glade/lingot-config-dialog.glade.h:23
+msgid "DFTs"
+msgstr "DFTer"
+
+#: ../src/glade/lingot-config-dialog.glade.h:24
+msgid "Default"
+msgstr "Standardvärde"
+
+#: ../src/glade/lingot-config-dialog.glade.h:25
+msgid "Delete"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:26
+msgid ""
+"Deletes the selected notes. The reference note, i.e., the first one, cannot "
+"be removed. You can also use the Delete key on the table beside."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:27
+#: ../src/glade/lingot-mainframe.glade.h:3
+msgid "Deviation"
+msgstr "Avvikelse"
+
+#: ../src/glade/lingot-config-dialog.glade.h:28
+msgid "Effective sample rate"
+msgstr "Effektiv samplingsfrekvens"
+
+#: ../src/glade/lingot-config-dialog.glade.h:29
+msgid ""
+"Effective sampling frequency. The lower this parameter is, the more accurate "
+"the FFT will be, and hence the better is the hooking up to the correct peak. "
+"Remember, however, that your temporal window will increase, and the fact "
+"that you won't be able to tune frequencies above the half of this frequency "
+"(Nyquist-Shannon sampling theorem)."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:30
+msgid "FFT size"
+msgstr "FFT-storlek"
+
+#: ../src/glade/lingot-config-dialog.glade.h:31
+msgid "Gain"
+msgstr "Förstärkning"
+
+#: ../src/glade/lingot-config-dialog.glade.h:32
+msgid "Hardware sampling frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:33
+msgid "Here you can pick the sound system."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:34
+msgid "Hz"
+msgstr "Hz"
+
+#: ../src/glade/lingot-config-dialog.glade.h:35
+msgid "Import"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:36
+msgid ""
+"Imports the scale from an external .scl file, with the Scala project format "
+"(http://www.huygens-fokker.org/scala/)"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:37
+msgid "Insert"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:38
+msgid ""
+"Lingot is an universal tuner, it can tune any instrument according to the "
+"scale you define here."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:39
+msgid "Lingot only considers frequencies above this one."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:40
+msgid "Minimum frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:41
+#: ../src/lingot-gui-config-dialog-scale.c:322
+msgid "Name"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:42
+msgid "Noise threshold"
+msgstr "Tröskelvärde för brus"
+
+#: ../src/glade/lingot-config-dialog.glade.h:43
+msgid "Number of calculations of the fundamental frequency per second."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:44
+msgid ""
+"Number of main peaks considered over the FFT. Remember that sometimes the "
+"first harmonics can have a higher amplitude than the fundamental component, "
+"depending on your instrument."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:45
+msgid ""
+"Number of samples needed by a peak at each side, lower in amplitude than the "
+"sample at the center, to be considered as a peak. You should not consider "
+"more than 1 or 2 samples, unless you have a really big FFT buffer."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:46
+msgid "Number of samples of each DFT."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:47
+msgid ""
+"Number of visualizations per second of the (last) computed frequency, error "
+"and spectrum. "
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:48
+msgid "Oversampling factor"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:49
+msgid "Peak half-width"
+msgstr "Halv toppbredd"
+
+#: ../src/glade/lingot-config-dialog.glade.h:50
+msgid "Peak number"
+msgstr "Antal toppar"
+
+#: ../src/glade/lingot-config-dialog.glade.h:51
+msgid "Peak rejection relation"
+msgstr "Tröskelvärde för topprelation"
+
+#: ../src/glade/lingot-config-dialog.glade.h:52
+msgid "Quick adjusments on the dynamic response and the signal levels."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:53
+msgid "Resets the built-in settings, without applying them."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:54
+msgid ""
+"Rolls back all the previous applied changes and closes the configuration "
+"dialog."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:55
+msgid "Sample rate"
+msgstr "Samplingsfrekvens"
+
+#: ../src/glade/lingot-config-dialog.glade.h:56
+msgid "Scale"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:57
+msgid "Scale name, only for your information."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:58
+msgid "Temporal window"
+msgstr "Tidsfönster"
+
+#: ../src/glade/lingot-config-dialog.glade.h:59
+msgid ""
+"The FFT buffer gives Lingot a first look to the spectrum. Higher values can "
+"help Lingot to hook up the correct peak, but it's also computationally more "
+"expensive. Don't use high values here unless you have an equally high "
+"effective sample rate."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:60
+msgid ""
+"This is the most recent amount of data considered for tuning. The longer it "
+"is, the more accuracy you can obtain, but also the dynamic response gets "
+"lower, because you are considering older parts of the signal. Also, if you "
+"raise this parameter, the computational cost increases. This value, in "
+"samples (depending on the effective sample rate), must be greater or equal "
+"to the FFT buffer size."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:61
+msgid "Visualization rate"
+msgstr "Visualiseringsfrekvens"
+
+#: ../src/glade/lingot-config-dialog.glade.h:62
+msgid "cents"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:63
+msgid "dB"
+msgstr "dB"
+
+#: ../src/glade/lingot-config-dialog.glade.h:64
+msgid "lingot configuration"
+msgstr "Konfiguration av Lingot"
+
+#: ../src/glade/lingot-config-dialog.glade.h:65
+msgid "peaks"
+msgstr "toppar"
+
+#: ../src/glade/lingot-config-dialog.glade.h:66
+msgid "samples"
+msgstr "samplingar"
+
+#: ../src/glade/lingot-config-dialog.glade.h:67
+msgid "seconds"
+msgstr "sekunder"
+
+#: ../src/glade/lingot-mainframe.glade.h:1
+msgid "---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:2
+msgid ""
+"Closest note to the estimated frequency, according to the scale defined in "
+"the Lingot settings."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:4
+msgid ""
+"Error in cents between the estimated frequency and the closest note "
+"according to the scale defined in the Lingot settings."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:5
+msgid "Estimated fundamental frequency in hertzs."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:6
+msgid "Opens an external configuration file."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:7
+msgid "Saves the running configuration to an external file."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:8
+#, fuzzy
+msgid "Show spectrum"
+msgstr "Spektrum"
+
+#: ../src/glade/lingot-mainframe.glade.h:9
+msgid ""
+"Shows the error in cents in a visual way. The range will depend on the "
+"maximum distance between each two notes in the scale defined in the Lingot "
+"settings (try to provide scales with low maximum distance, i.e. with many "
+"notes, to have a higher resolution in this gauge),"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:10
+msgid "Spectrum"
+msgstr "Spektrum"
+
+#: ../src/glade/lingot-mainframe.glade.h:11
+msgid ""
+"This area shows the spectral power density of the captured signal. The "
+"fundamental frequency is shown with a red dot, and the noise threshold with "
+"a horizontal dotted yellow line. If you have a large FFT buffer (with more "
+"than 512 samples), you can browse through the whole spectrum with a "
+"horizontal scrollbar."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:12
+msgid "Tone"
+msgstr "Not"
+
+#: ../src/glade/lingot-mainframe.glade.h:13
+#, fuzzy
+msgid "_Edit"
+msgstr "_Redigera"
+
+#: ../src/glade/lingot-mainframe.glade.h:14
+msgid "_File"
+msgstr "_Arkiv"
+
+#: ../src/glade/lingot-mainframe.glade.h:15
+msgid "_Help"
+msgstr "_Hjälp"
+
+#: ../src/glade/lingot-mainframe.glade.h:16
+msgid "_View"
+msgstr "_Visa"
+
+#: ../src/glade/lingot-mainframe.glade.h:17
+msgid "e = ---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:18
+msgid "f = ---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:19
+msgid "lingot"
+msgstr "Lingot"
+
+#: ../src/lingot-audio-oss.c:56
+#, c-format
+msgid ""
+"Unable to open audio device %s.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:63
+#, c-format
+msgid ""
+"Error setting number of channels.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:71
+#, c-format
+msgid ""
+"Error setting bits per sample.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:86
+#, c-format
+msgid ""
+"Error setting DMA buffer size.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:92
+#, fuzzy, c-format
+msgid ""
+"Error setting sample rate.\n"
+"%s."
+msgstr "Effektiv samplingsfrekvens"
+
+#: ../src/lingot-audio-oss.c:132 ../src/lingot-audio-alsa.c:167
+#, c-format
+msgid ""
+"Read from audio interface failed.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-alsa.c:139
+#, fuzzy
+msgid "The application has not been built with ALSA support"
+msgstr "Applikationen har inte byggts med stöd för ALSA"
+
+#: ../src/lingot-audio-jack.c:61
+msgid "Missing connection with JACK audio server"
+msgstr "Saknar anslutning till ljudservern JACK"
+
+#: ../src/lingot-audio-jack.c:90 ../src/lingot-audio-jack.c:190
+msgid "Unable to connect to JACK server"
+msgstr "Kan inte ansluta till JACK-servern"
+
+#: ../src/lingot-audio-jack.c:115
+msgid "No more JACK ports available"
+msgstr "Inga fler JACK-portar är tillgängliga"
+
+#: ../src/lingot-audio-jack.c:133 ../src/lingot-audio-jack.c:247
+#: ../src/lingot-audio-jack.c:314 ../src/lingot-audio-jack.c:346
+msgid "The application has not been built with JACK support"
+msgstr "Applikationen har inte byggts med stöd för JACK"
+
+#: ../src/lingot-audio-jack.c:265
+msgid "Cannot activate client"
+msgstr "Kan inte aktivera klient"
+
+#: ../src/lingot-audio-jack.c:271
+#, fuzzy
+msgid "No active capture ports"
+msgstr "Inga fysiska ljudfångsportar"
+
+#: ../src/lingot-audio-jack.c:282 ../src/lingot-audio-jack.c:302
+msgid "Cannot connect input ports"
+msgstr "Kan inte ansluta ingångsportar"
+
+#: ../src/lingot-audio-jack.c:297
+msgid "No physical capture ports"
+msgstr "Inga fysiska ljudfångsportar"
+
+#: ../src/lingot-config.c:436
+#, c-format
+msgid ""
+"Error parsing the configuration file, line %i: unrecognized audio system "
+"'%s', assuming default audio system.\n"
+msgstr ""
+
+#: ../src/lingot-config.c:452
+msgid ""
+"The configuration file contains errors, and hence some default values have "
+"been chosen. Consider checking the settings and fixing the problem using the "
+"configuration dialog."
+msgstr ""
+
+#: ../src/lingot-core.c:86
+#, c-format
+msgid ""
+"The requested sample rate is not available, the real sample rate has been "
+"set to %d Hz"
+msgstr ""
+
+#: ../src/lingot-core.c:99
+#, c-format
+msgid ""
+"The temporal buffer is smaller than FFT size. It has been increased to %0.3f "
+"seconds"
+msgstr ""
+"Tidsbufferten är mindre än FFT-storleken. Den har ökats till %0.3f sekunder."
+
+#: ../src/lingot-gui-mainframe.c:100
+msgid "Accurate and easy to use musical instrument tuner"
+msgstr "Precist och lättanvänt stämprogram för musikinstrument"
+
+#: ../src/lingot-gui-mainframe.c:104
+msgid "translator-credits"
+msgstr "John Gustafsson <jamminjohn@users.sourceforge.net>"
+
+#: ../src/lingot-gui-mainframe.c:247
+msgid "Error"
+msgstr "Fel"
+
+#: ../src/lingot-gui-mainframe.c:248
+msgid "Warning"
+msgstr "Varning"
+
+#: ../src/lingot-gui-mainframe.c:248
+msgid "Info"
+msgstr ""
+
+#: ../src/lingot-gui-mainframe.c:267
+#, fuzzy
+msgid "Open Configuration File"
+msgstr "Konfiguration av Lingot"
+
+#: ../src/lingot-gui-mainframe.c:275 ../src/lingot-gui-mainframe.c:318
+#, fuzzy
+msgid "Lingot configuration files"
+msgstr "Konfiguration av Lingot"
+
+#: ../src/lingot-gui-mainframe.c:307
+#, fuzzy
+msgid "Save Configuration File"
+msgstr "Konfiguration av Lingot"
+
+#: ../src/lingot-gui-config-dialog.c:311
+msgid ""
+"The provided scale contains wide gaps in frequency that increase the gauge "
+"range and produce a loss of visual accuracy. Consider providing scales with "
+"at least 12 tones, or with a maximum distance between adjacent notes below "
+"200 cents."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:84
+msgid "You cannot insert before the reference note."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:210
+msgid "Do not use space characters for the note names."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:213
+msgid "The name contains illegal characters."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:230
+msgid "You cannot change the first shift, it must be 1/1."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:237
+msgid "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:339
+msgid "Shift"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:360
+msgid "Frequency [Hz]"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:417
+msgid "There are notes with the same name"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:431
+msgid ""
+"There are invalid values in the scale: the notes should be ordered by "
+"frequency / shift"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:438
+msgid ""
+"There are invalid values in the scale: all the notes should be in the same "
+"octave"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:447
+msgid "There are notes without name"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:511
+msgid "Open Scale File"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:519
+msgid "Scala files"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:539
+msgid "The scale cannot be imported: file format error"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:605
+msgid ""
+"Note identifier, free text that will be displayed in the main window when "
+"tuning close to the given note. Don't use space characters here."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:610
+msgid ""
+"Shift. You can define it as a deviation in cents from the reference note "
+"(the first one), or as a frequency ratio, like '3/2' or '5/4'. All the "
+"values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all "
+"the notes must be in the same octave), and they must be well ordered."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:615
+msgid ""
+"Frequency. You can enter here the absolute frequency for a given note as a "
+"reference, and all the other frequencies will shift according to the "
+"deviations specified in the 'Shift' column. You can use an absolute numeric "
+"value or the keywords 'mid-C' (261.625565 Hz) and 'mid-A' (440 Hz)."
+msgstr ""
+
+#~ msgid "Root frequency"
+#~ msgstr "Grundfrekvens"
+
+#~ msgid "freq"
+#~ msgstr "frekv"
+
+#~ msgid "err"
+#~ msgstr "fel"
+
+#, fuzzy
+#~ msgid "440 (A) +"
+#~ msgstr " A (440 Hz) + "
+
+#~ msgid "General parameters"
+#~ msgstr "Allmänna parametrar"
+
+#~ msgid "Advanced parameters"
+#~ msgstr "Avancerade parametrar"
diff --git a/po/zh_CN.po b/po/zh_CN.po
new file mode 100644
index 0000000..178f0b7
--- /dev/null
+++ b/po/zh_CN.po
@@ -0,0 +1,700 @@
+# Chinese/China translation of lingot.
+# Copyright (C) 2009 THE lingot'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the lingot package.
+# Jairo Chapela Martínez <jairochapela@gmail.com>, 2007.
+# Careone <careoneagain@gmail.com>, 2009.
+#
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: lingot 0.7.7b5\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-02-21 17:10+0000\n"
+"PO-Revision-Date: 2009-09-14 17:29+0800\n"
+"Last-Translator: Careone <careoneagain@gmail.com>\n"
+"Language-Team: Chinese/Simplified <lp-l10n-zh-cn@lists.launchpad.net>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../src/glade/lingot-config-dialog.glade.h:1
+msgid ""
+"Adds a new note to the list, just above the selected line, or appends it to "
+"the end if no line is selected. Is not possible to add a note before the "
+"reference (the first) one. You can also use the Insert key on the table "
+"beside."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:2
+msgid "Adjustments"
+msgstr "校正"
+
+#: ../src/glade/lingot-config-dialog.glade.h:3
+msgid "Advanced"
+msgstr "高级"
+
+#: ../src/glade/lingot-config-dialog.glade.h:4
+msgid ""
+"Advanced settings on the frequency finding algorithm. You should not modify "
+"these parameters unless you really need it and you have a good understanding "
+"of the algorithm. Use the 'Default' button if you get lost, and use those "
+"default parameters as your reference."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:5
+msgid ""
+"After having chosen the fundamental peak on the FFT, Lingot computes a "
+"series of N (being N this parameter) DFTs localized in frequency to enclose "
+"the fundamental frequency."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:6
+msgid ""
+"All the peaks with an amplitude difference with the highest one greater than "
+"this parameter will be rejected as a candidate to host the fundamental "
+"frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:7
+msgid ""
+"Allows you to adapt the signal levels without the aid of an external mixer."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:8
+msgid ""
+"Any signal level below this value will be considered as noise. This noise "
+"level is depicted in the spectrum area as a yellow dotted line."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:9
+msgid ""
+"Applies a shift in frequency to all the notes defined in the table above."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:10
+msgid "Apply the current changes and modify the congifuration file."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:11
+msgid ""
+"Apply the current changes to the running tuner, but doesn't modify the "
+"configuration file."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:12
+#, fuzzy
+msgid "Audio device"
+msgstr "音频设备"
+
+#: ../src/glade/lingot-config-dialog.glade.h:13
+msgid "Audio input settings. Set here the source and hardware settings."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:14
+msgid "Audio system"
+msgstr "音频系统"
+
+#: ../src/glade/lingot-config-dialog.glade.h:15
+msgid "Basic"
+msgstr "基本"
+
+#: ../src/glade/lingot-config-dialog.glade.h:16
+msgid ""
+"Basic settings on the frequency finding algorithm. Come here to get better "
+"accuracy, frequency range or CPU usage. "
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:17
+msgid "Calculation rate"
+msgstr "运算率"
+
+#: ../src/glade/lingot-config-dialog.glade.h:18
+msgid "Capture"
+msgstr "捕获"
+
+#: ../src/glade/lingot-config-dialog.glade.h:19
+msgid ""
+"Choose the audio device if you have more than one. You cannot modify this "
+"field if you are using JACK, but you can connect Lingot to a desired source "
+"externally."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:20
+msgid ""
+"Choose the hardware sample rate here. We give you some examples, but you can "
+"choose another one. Please, be aware that depending on the audio system and/"
+"or device, not all the sampling frequencies are available. Anyway, you can "
+"get close to your desired effective sample rate by combining this parameter "
+"with the oversampling factor (Basic tab). If you are using JACK, you cannot "
+"modify this field, but you can change it externally (in the JACK server "
+"configuration)."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:21
+msgid "DFT number"
+msgstr "二维傅里叶变换(DFT) 数字"
+
+#: ../src/glade/lingot-config-dialog.glade.h:22
+msgid "DFT size"
+msgstr "二维傅里叶变换(DFT) 大小"
+
+#: ../src/glade/lingot-config-dialog.glade.h:23
+msgid "DFTs"
+msgstr "二维傅里叶变换(DFT)"
+
+#: ../src/glade/lingot-config-dialog.glade.h:24
+msgid "Default"
+msgstr "默认值"
+
+#: ../src/glade/lingot-config-dialog.glade.h:25
+msgid "Delete"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:26
+msgid ""
+"Deletes the selected notes. The reference note, i.e., the first one, cannot "
+"be removed. You can also use the Delete key on the table beside."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:27
+#: ../src/glade/lingot-mainframe.glade.h:3
+msgid "Deviation"
+msgstr "偏差"
+
+#: ../src/glade/lingot-config-dialog.glade.h:28
+msgid "Effective sample rate"
+msgstr "有效采样率"
+
+#: ../src/glade/lingot-config-dialog.glade.h:29
+msgid ""
+"Effective sampling frequency. The lower this parameter is, the more accurate "
+"the FFT will be, and hence the better is the hooking up to the correct peak. "
+"Remember, however, that your temporal window will increase, and the fact "
+"that you won't be able to tune frequencies above the half of this frequency "
+"(Nyquist-Shannon sampling theorem)."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:30
+msgid "FFT size"
+msgstr "快速傅里叶变换(FFT) 大小"
+
+#: ../src/glade/lingot-config-dialog.glade.h:31
+msgid "Gain"
+msgstr "增益"
+
+#: ../src/glade/lingot-config-dialog.glade.h:32
+msgid "Hardware sampling frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:33
+msgid "Here you can pick the sound system."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:34
+msgid "Hz"
+msgstr "赫兹(Hz)"
+
+#: ../src/glade/lingot-config-dialog.glade.h:35
+msgid "Import"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:36
+msgid ""
+"Imports the scale from an external .scl file, with the Scala project format "
+"(http://www.huygens-fokker.org/scala/)"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:37
+msgid "Insert"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:38
+msgid ""
+"Lingot is an universal tuner, it can tune any instrument according to the "
+"scale you define here."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:39
+msgid "Lingot only considers frequencies above this one."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:40
+msgid "Minimum frequency"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:41
+#: ../src/lingot-gui-config-dialog-scale.c:322
+msgid "Name"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:42
+msgid "Noise threshold"
+msgstr "噪波极限值"
+
+#: ../src/glade/lingot-config-dialog.glade.h:43
+msgid "Number of calculations of the fundamental frequency per second."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:44
+msgid ""
+"Number of main peaks considered over the FFT. Remember that sometimes the "
+"first harmonics can have a higher amplitude than the fundamental component, "
+"depending on your instrument."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:45
+msgid ""
+"Number of samples needed by a peak at each side, lower in amplitude than the "
+"sample at the center, to be considered as a peak. You should not consider "
+"more than 1 or 2 samples, unless you have a really big FFT buffer."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:46
+msgid "Number of samples of each DFT."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:47
+msgid ""
+"Number of visualizations per second of the (last) computed frequency, error "
+"and spectrum. "
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:48
+msgid "Oversampling factor"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:49
+msgid "Peak half-width"
+msgstr "半波峰值"
+
+#: ../src/glade/lingot-config-dialog.glade.h:50
+msgid "Peak number"
+msgstr "高音数字"
+
+#: ../src/glade/lingot-config-dialog.glade.h:51
+msgid "Peak rejection relation"
+msgstr "峰值抑制关系"
+
+#: ../src/glade/lingot-config-dialog.glade.h:52
+msgid "Quick adjusments on the dynamic response and the signal levels."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:53
+msgid "Resets the built-in settings, without applying them."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:54
+msgid ""
+"Rolls back all the previous applied changes and closes the configuration "
+"dialog."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:55
+msgid "Sample rate"
+msgstr "采样率"
+
+#: ../src/glade/lingot-config-dialog.glade.h:56
+msgid "Scale"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:57
+msgid "Scale name, only for your information."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:58
+msgid "Temporal window"
+msgstr "临时窗口"
+
+#: ../src/glade/lingot-config-dialog.glade.h:59
+msgid ""
+"The FFT buffer gives Lingot a first look to the spectrum. Higher values can "
+"help Lingot to hook up the correct peak, but it's also computationally more "
+"expensive. Don't use high values here unless you have an equally high "
+"effective sample rate."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:60
+msgid ""
+"This is the most recent amount of data considered for tuning. The longer it "
+"is, the more accuracy you can obtain, but also the dynamic response gets "
+"lower, because you are considering older parts of the signal. Also, if you "
+"raise this parameter, the computational cost increases. This value, in "
+"samples (depending on the effective sample rate), must be greater or equal "
+"to the FFT buffer size."
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:61
+msgid "Visualization rate"
+msgstr "可见率"
+
+#: ../src/glade/lingot-config-dialog.glade.h:62
+msgid "cents"
+msgstr ""
+
+#: ../src/glade/lingot-config-dialog.glade.h:63
+msgid "dB"
+msgstr "分贝(dB)"
+
+#: ../src/glade/lingot-config-dialog.glade.h:64
+msgid "lingot configuration"
+msgstr "lingot 配置"
+
+#: ../src/glade/lingot-config-dialog.glade.h:65
+msgid "peaks"
+msgstr "峰值"
+
+#: ../src/glade/lingot-config-dialog.glade.h:66
+msgid "samples"
+msgstr "采样"
+
+#: ../src/glade/lingot-config-dialog.glade.h:67
+msgid "seconds"
+msgstr "秒"
+
+#: ../src/glade/lingot-mainframe.glade.h:1
+msgid "---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:2
+msgid ""
+"Closest note to the estimated frequency, according to the scale defined in "
+"the Lingot settings."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:4
+msgid ""
+"Error in cents between the estimated frequency and the closest note "
+"according to the scale defined in the Lingot settings."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:5
+msgid "Estimated fundamental frequency in hertzs."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:6
+msgid "Opens an external configuration file."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:7
+msgid "Saves the running configuration to an external file."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:8
+#, fuzzy
+msgid "Show spectrum"
+msgstr "乐谱"
+
+#: ../src/glade/lingot-mainframe.glade.h:9
+msgid ""
+"Shows the error in cents in a visual way. The range will depend on the "
+"maximum distance between each two notes in the scale defined in the Lingot "
+"settings (try to provide scales with low maximum distance, i.e. with many "
+"notes, to have a higher resolution in this gauge),"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:10
+msgid "Spectrum"
+msgstr "乐谱"
+
+#: ../src/glade/lingot-mainframe.glade.h:11
+msgid ""
+"This area shows the spectral power density of the captured signal. The "
+"fundamental frequency is shown with a red dot, and the noise threshold with "
+"a horizontal dotted yellow line. If you have a large FFT buffer (with more "
+"than 512 samples), you can browse through the whole spectrum with a "
+"horizontal scrollbar."
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:12
+msgid "Tone"
+msgstr "音调"
+
+#: ../src/glade/lingot-mainframe.glade.h:13
+#, fuzzy
+msgid "_Edit"
+msgstr "编辑(_E)"
+
+#: ../src/glade/lingot-mainframe.glade.h:14
+msgid "_File"
+msgstr "文件(_F)"
+
+#: ../src/glade/lingot-mainframe.glade.h:15
+msgid "_Help"
+msgstr "帮助(_H)"
+
+#: ../src/glade/lingot-mainframe.glade.h:16
+msgid "_View"
+msgstr "查看(_V)"
+
+#: ../src/glade/lingot-mainframe.glade.h:17
+msgid "e = ---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:18
+msgid "f = ---"
+msgstr ""
+
+#: ../src/glade/lingot-mainframe.glade.h:19
+msgid "lingot"
+msgstr "lingot"
+
+#: ../src/lingot-audio-oss.c:56
+#, c-format
+msgid ""
+"Unable to open audio device %s.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:63
+#, c-format
+msgid ""
+"Error setting number of channels.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:71
+#, c-format
+msgid ""
+"Error setting bits per sample.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:86
+#, c-format
+msgid ""
+"Error setting DMA buffer size.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-oss.c:92
+#, fuzzy, c-format
+msgid ""
+"Error setting sample rate.\n"
+"%s."
+msgstr "有效采样率"
+
+#: ../src/lingot-audio-oss.c:132 ../src/lingot-audio-alsa.c:167
+#, c-format
+msgid ""
+"Read from audio interface failed.\n"
+"%s."
+msgstr ""
+
+#: ../src/lingot-audio-alsa.c:139
+msgid "The application has not been built with ALSA support"
+msgstr ""
+
+#: ../src/lingot-audio-jack.c:61
+msgid "Missing connection with JACK audio server"
+msgstr "与插孔音频服务失去连接"
+
+#: ../src/lingot-audio-jack.c:90 ../src/lingot-audio-jack.c:190
+msgid "Unable to connect to JACK server"
+msgstr "无法连接到插孔服务"
+
+#: ../src/lingot-audio-jack.c:115
+msgid "No more JACK ports available"
+msgstr "没有更多的插孔端口可以使用"
+
+#: ../src/lingot-audio-jack.c:133 ../src/lingot-audio-jack.c:247
+#: ../src/lingot-audio-jack.c:314 ../src/lingot-audio-jack.c:346
+msgid "The application has not been built with JACK support"
+msgstr "这个程序无法支持插孔"
+
+#: ../src/lingot-audio-jack.c:265
+msgid "Cannot activate client"
+msgstr "无法激活客户端"
+
+#: ../src/lingot-audio-jack.c:271
+#, fuzzy
+msgid "No active capture ports"
+msgstr "没有物理捕获端口"
+
+#: ../src/lingot-audio-jack.c:282 ../src/lingot-audio-jack.c:302
+msgid "Cannot connect input ports"
+msgstr "无法连接输入端口"
+
+#: ../src/lingot-audio-jack.c:297
+msgid "No physical capture ports"
+msgstr "没有物理捕获端口"
+
+#: ../src/lingot-config.c:436
+#, c-format
+msgid ""
+"Error parsing the configuration file, line %i: unrecognized audio system "
+"'%s', assuming default audio system.\n"
+msgstr ""
+
+#: ../src/lingot-config.c:452
+msgid ""
+"The configuration file contains errors, and hence some default values have "
+"been chosen. Consider checking the settings and fixing the problem using the "
+"configuration dialog."
+msgstr ""
+
+#: ../src/lingot-core.c:86
+#, c-format
+msgid ""
+"The requested sample rate is not available, the real sample rate has been "
+"set to %d Hz"
+msgstr ""
+
+#: ../src/lingot-core.c:99
+#, c-format
+msgid ""
+"The temporal buffer is smaller than FFT size. It has been increased to %0.3f "
+"seconds"
+msgstr "临时缓冲区小于“快速傅里叶变换(FFT)”的大小。提高到 %0.3f 秒"
+
+#: ../src/lingot-gui-mainframe.c:100
+msgid "Accurate and easy to use musical instrument tuner"
+msgstr "精确和方便的乐器调音师"
+
+#: ../src/lingot-gui-mainframe.c:104
+msgid "translator-credits"
+msgstr "Careone <careoneagain@gmail.com>, (zh_CN)"
+
+#: ../src/lingot-gui-mainframe.c:247
+msgid "Error"
+msgstr "错误"
+
+#: ../src/lingot-gui-mainframe.c:248
+msgid "Warning"
+msgstr "警告"
+
+#: ../src/lingot-gui-mainframe.c:248
+msgid "Info"
+msgstr ""
+
+#: ../src/lingot-gui-mainframe.c:267
+#, fuzzy
+msgid "Open Configuration File"
+msgstr "lingot 配置"
+
+#: ../src/lingot-gui-mainframe.c:275 ../src/lingot-gui-mainframe.c:318
+#, fuzzy
+msgid "Lingot configuration files"
+msgstr "lingot 配置"
+
+#: ../src/lingot-gui-mainframe.c:307
+#, fuzzy
+msgid "Save Configuration File"
+msgstr "lingot 配置"
+
+#: ../src/lingot-gui-config-dialog.c:311
+msgid ""
+"The provided scale contains wide gaps in frequency that increase the gauge "
+"range and produce a loss of visual accuracy. Consider providing scales with "
+"at least 12 tones, or with a maximum distance between adjacent notes below "
+"200 cents."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:84
+msgid "You cannot insert before the reference note."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:210
+msgid "Do not use space characters for the note names."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:213
+msgid "The name contains illegal characters."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:230
+msgid "You cannot change the first shift, it must be 1/1."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:237
+msgid "The shift must be between 0 and 1200 cents, or between 1/1 and 2/1."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:339
+msgid "Shift"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:360
+msgid "Frequency [Hz]"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:417
+msgid "There are notes with the same name"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:431
+msgid ""
+"There are invalid values in the scale: the notes should be ordered by "
+"frequency / shift"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:438
+msgid ""
+"There are invalid values in the scale: all the notes should be in the same "
+"octave"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:447
+msgid "There are notes without name"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:511
+msgid "Open Scale File"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:519
+msgid "Scala files"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:539
+msgid "The scale cannot be imported: file format error"
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:605
+msgid ""
+"Note identifier, free text that will be displayed in the main window when "
+"tuning close to the given note. Don't use space characters here."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:610
+msgid ""
+"Shift. You can define it as a deviation in cents from the reference note "
+"(the first one), or as a frequency ratio, like '3/2' or '5/4'. All the "
+"values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all "
+"the notes must be in the same octave), and they must be well ordered."
+msgstr ""
+
+#: ../src/lingot-gui-config-dialog-scale.c:615
+msgid ""
+"Frequency. You can enter here the absolute frequency for a given note as a "
+"reference, and all the other frequencies will shift according to the "
+"deviations specified in the 'Shift' column. You can use an absolute numeric "
+"value or the keywords 'mid-C' (261.625565 Hz) and 'mid-A' (440 Hz)."
+msgstr ""
+
+#~ msgid "Root frequency"
+#~ msgstr "根频率"
+
+#~ msgid "freq"
+#~ msgstr "频率"
+
+#~ msgid "err"
+#~ msgstr "错误"
+
+#~ msgid "General parameters"
+#~ msgstr "常规参数"
+
+#~ msgid "Advanced parameters"
+#~ msgstr "高级参数"
+
+#~ msgid " A (440 Hz) + "
+#~ msgstr " A (440 Hz) + "
+
+#~ msgid "Peak order"
+#~ msgstr "高音声阶"
+
+#~ msgid "Note"
+#~ msgstr "音符"
+
+#~ msgid "note"
+#~ msgstr "音符"
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..03b32d1
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,55 @@
+SUBDIRS = glade
+
+INCLUDES = \
+ $(PACKAGE_CFLAGS) $(GTK_CFLAGS) $(ALSA_CFLAGS) $(JACK_CFLAGS) $(GLADE_CFLAGS)\
+ -DLINGOT_GLADEDIR=\""$(datadir)/lingot/glade/"\" \
+ -DLINGOT_LOCALEDIR=\""$(datadir)/locale"\"
+
+AM_CXXFLAGS =\
+ -Wall
+
+bin_PROGRAMS = lingot
+
+lingot_SOURCES = \
+ lingot-fft.c\
+ lingot-fft.h\
+ lingot-audio.c\
+ lingot-audio.h\
+ lingot-audio-oss.c\
+ lingot-audio-oss.h\
+ lingot-audio-alsa.c\
+ lingot-audio-alsa.h\
+ lingot-audio-jack.c\
+ lingot-audio-jack.h\
+ lingot-complex.h\
+ lingot-complex.c\
+ lingot-config.c\
+ lingot-config.h\
+ lingot-config-scale.c\
+ lingot-config-scale.h\
+ lingot-core.c\
+ lingot-core.h\
+ lingot-defs.h\
+ lingot-msg.h\
+ lingot-msg.c\
+ lingot-gui-config-dialog.c\
+ lingot-gui-config-dialog.h\
+ lingot-gui-config-dialog-scale.c\
+ lingot-gui-config-dialog-scale.h\
+ lingot-gui-mainframe.c\
+ lingot-gui-mainframe.h\
+ lingot-gauge.c\
+ lingot-gauge.h\
+ lingot-filter.c\
+ lingot-filter.h\
+ lingot-signal.c\
+ lingot-signal.h\
+ lingot.c\
+ lingot-i18n.h
+
+lingot_LDFLAGS =
+
+lingot_LDADD = \
+ $(PACKAGE_LIBS) $(GTK_LIBS) $(ALSA_LIBS) $(JACK_LIBS) $(GLADE_LIBS)\
+ -lpthread
+
diff --git a/src/glade/Makefile.am b/src/glade/Makefile.am
new file mode 100644
index 0000000..079ffbc
--- /dev/null
+++ b/src/glade/Makefile.am
@@ -0,0 +1,8 @@
+gladedir = $(datadir)/lingot/glade/
+
+glade_DATA = \
+ lingot-config-dialog.glade\
+ lingot-mainframe.glade
+
+
+EXTRA_DIST = $(glade_DATA)
diff --git a/src/glade/lingot-config-dialog.glade b/src/glade/lingot-config-dialog.glade
new file mode 100644
index 0000000..faf1c21
--- /dev/null
+++ b/src/glade/lingot-config-dialog.glade
@@ -0,0 +1,1085 @@
+<?xml version="1.0"?>
+<glade-interface>
+ <!-- interface-requires gtk+ 2.12 -->
+ <!-- interface-naming-policy toplevel-contextual -->
+ <widget class="GtkDialog" id="dialog1">
+ <property name="visible">True</property>
+ <property name="border_width">5</property>
+ <property name="title" translatable="yes">lingot configuration</property>
+ <property name="window_position">center-always</property>
+ <property name="type_hint">normal</property>
+ <property name="has_separator">False</property>
+ <child internal-child="vbox">
+ <widget class="GtkVBox" id="dialog-vbox5">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">2</property>
+ <child>
+ <widget class="GtkNotebook" id="notebook1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <widget class="GtkVBox" id="vbox2">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkTable" id="table1">
+ <property name="visible">True</property>
+ <property name="border_width">10</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">3</property>
+ <property name="column_spacing">10</property>
+ <property name="row_spacing">10</property>
+ <child>
+ <widget class="GtkLabel" id="system">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Audio system</property>
+ </widget>
+ <packing>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBox" id="input_system">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Here you can pick the sound system.</property>
+ <property name="items">OSS
+ALSA
+JACK</property>
+ <signal name="changed" handler="on_combobox_input_architecture_changed"/>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="oss_label_input_dev2">
+ <property name="visible">True</property>
+ <property name="label">
+</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Audio device</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBoxEntry" id="input_dev">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Choose the audio device if you have more than one. You cannot modify this field if you are using JACK, but you can connect Lingot to a desired source externally.</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Sample rate</property>
+ </widget>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label30">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Hz</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBoxEntry" id="sample_rate">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Choose the hardware sample rate here. We give you some examples, but you can choose another one. Please, be aware that depending on the audio system and/or device, not all the sampling frequencies are available. Anyway, you can get close to your desired effective sample rate by combining this parameter with the oversampling factor (Basic tab). If you are using JACK, you cannot modify this field, but you can change it externally (in the JACK server configuration).</property>
+ <property name="items" translatable="yes"></property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_SHRINK | GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="input">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Audio input settings. Set here the source and hardware settings.</property>
+ <property name="label" translatable="yes">Capture</property>
+ </widget>
+ <packing>
+ <property name="tab_fill">False</property>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkTable" id="table3">
+ <property name="visible">True</property>
+ <property name="extension_events">cursor</property>
+ <property name="border_width">10</property>
+ <property name="n_rows">4</property>
+ <property name="n_columns">3</property>
+ <property name="column_spacing">10</property>
+ <property name="row_spacing">10</property>
+ <child>
+ <widget class="GtkLabel" id="label10">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Calculation rate</property>
+ </widget>
+ <packing>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label11">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Visualization rate</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label12">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Noise threshold</property>
+ </widget>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label13">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Gain</property>
+ </widget>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label14">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Hz</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label15">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Hz</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_EXPAND</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label16">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">dB</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label17">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">dB</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHScale" id="calculation_rate">
+ <property name="width_request">100</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">Number of calculations of the fundamental frequency per second.</property>
+ <property name="adjustment">25.199999999999999 1 30 1 0 0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHScale" id="visualization_rate">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">Number of visualizations per second of the (last) computed frequency, error and spectrum. </property>
+ <property name="adjustment">25 1 40 3 0 0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHScale" id="noise_threshold">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">Any signal level below this value will be considered as noise. This noise level is depicted in the spectrum area as a yellow dotted line.</property>
+ <property name="adjustment">90 0 100 1 10 0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHScale" id="gain">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">Allows you to adapt the signal levels without the aid of an external mixer.</property>
+ <property name="adjustment">27.699999999999999 -90 90 0.10000000000000001 0 0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Quick adjusments on the dynamic response and the signal levels.</property>
+ <property name="label" translatable="yes">Adjustments</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkTable" id="table4">
+ <property name="visible">True</property>
+ <property name="border_width">10</property>
+ <property name="n_rows">4</property>
+ <property name="n_columns">3</property>
+ <property name="column_spacing">10</property>
+ <property name="row_spacing">10</property>
+ <child>
+ <widget class="GtkSpinButton" id="temporal_window">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">This is the most recent amount of data considered for tuning. The longer it is, the more accuracy you can obtain, but also the dynamic response gets lower, because you are considering older parts of the signal. Also, if you raise this parameter, the computational cost increases. This value, in samples (depending on the effective sample rate), must be greater or equal to the FFT buffer size.</property>
+ <property name="xalign">1</property>
+ <property name="adjustment">0.32000000000000001 0 15 0.01 0 0</property>
+ <property name="digits">3</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkComboBox" id="fft_size">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">The FFT buffer gives Lingot a first look to the spectrum. Higher values can help Lingot to hook up the correct peak, but it's also computationally more expensive. Don't use high values here unless you have an equally high effective sample rate.</property>
+ <property name="items">256
+512
+1024
+2048
+4096</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkTable" id="table7">
+ <property name="visible">True</property>
+ <property name="n_columns">4</property>
+ <child>
+ <widget class="GtkLabel" id="label_sample_rate1">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Hardware sampling frequency</property>
+ <property name="label">8000</property>
+ </widget>
+ <packing>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label31">
+ <property name="visible">True</property>
+ <property name="label"> / </property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="oversampling">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip" translatable="yes">Oversampling factor</property>
+ <property name="xalign">1</property>
+ <property name="adjustment">1 1 120 1 10 0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label_sample_rate2">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Effective sampling frequency. The lower this parameter is, the more accurate the FFT will be, and hence the better is the hooking up to the correct peak. Remember, however, that your temporal window will increase, and the fact that you won't be able to tune frequencies above the half of this frequency (Nyquist-Shannon sampling theorem).</property>
+ <property name="label"> = 2000</property>
+ </widget>
+ <packing>
+ <property name="left_attach">3</property>
+ <property name="right_attach">4</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label28">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">seconds</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label27">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">samples</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label24">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Hz</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label22">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Temporal window</property>
+ </widget>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label21">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">FFT size</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label20">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Effective sample rate</property>
+ </widget>
+ <packing>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label23">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Minimum frequency</property>
+ </widget>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="minimum_frequency">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">Lingot only considers frequencies above this one.</property>
+ <property name="invisible_char">&#x25CF;</property>
+ <property name="xalign">1</property>
+ <property name="adjustment">0 0 22050 1 0 0</property>
+ <property name="digits">1</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label29">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Hz</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Basic settings on the frequency finding algorithm. Come here to get better accuracy, frequency range or CPU usage. </property>
+ <property name="label" translatable="yes">Basic</property>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ <property name="tab_fill">False</property>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkTable" id="table5">
+ <property name="visible">True</property>
+ <property name="border_width">10</property>
+ <property name="n_rows">5</property>
+ <property name="n_columns">3</property>
+ <property name="column_spacing">10</property>
+ <property name="row_spacing">10</property>
+ <child>
+ <widget class="GtkLabel" id="label48">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">dB</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label47">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">samples</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label45">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">peaks</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label46">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">samples</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label44">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">DFTs</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHScale" id="rejection_peak_relation">
+ <property name="width_request">100</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">All the peaks with an amplitude difference with the highest one greater than this parameter will be rejected as a candidate to host the fundamental frequency</property>
+ <property name="adjustment">29.199999999999999 0 50 1 0 0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="peak_halfwidth">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">Number of samples needed by a peak at each side, lower in amplitude than the sample at the center, to be considered as a peak. You should not consider more than 1 or 2 samples, unless you have a really big FFT buffer.</property>
+ <property name="xalign">1</property>
+ <property name="adjustment">1 1 5 1 10 0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="peak_number">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">Number of main peaks considered over the FFT. Remember that sometimes the first harmonics can have a higher amplitude than the fundamental component, depending on your instrument.</property>
+ <property name="xalign">1</property>
+ <property name="adjustment">1 1 10 1 10 0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="dft_size">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">Number of samples of each DFT.</property>
+ <property name="xalign">1</property>
+ <property name="adjustment">4 4 100 1 10 0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label43">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Peak rejection relation</property>
+ </widget>
+ <packing>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="dft_number">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">After having chosen the fundamental peak on the FFT, Lingot computes a series of N (being N this parameter) DFTs localized in frequency to enclose the fundamental frequency.</property>
+ <property name="xalign">1</property>
+ <property name="adjustment">0 0 10 1 10 0</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label33">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Peak half-width</property>
+ </widget>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label32">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Peak number</property>
+ </widget>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label25">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">DFT size</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label18">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">DFT number</property>
+ </widget>
+ <packing>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Advanced settings on the frequency finding algorithm. You should not modify these parameters unless you really need it and you have a good understanding of the algorithm. Use the 'Default' button if you get lost, and use those default parameters as your reference.</property>
+ <property name="label" translatable="yes">Advanced</property>
+ </widget>
+ <packing>
+ <property name="position">3</property>
+ <property name="tab_fill">False</property>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="xalign">0.47999998927116394</property>
+ <property name="label" translatable="yes">Name</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="padding">21</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="scale_name">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">Scale name, only for your information.</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </widget>
+ <packing>
+ <property name="padding">5</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="height_request">200</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">out</property>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">4</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkVBox" id="vbox3">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <widget class="GtkVButtonBox" id="vbuttonbox1">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <widget class="GtkButton" id="button_scale_add">
+ <property name="label" translatable="yes">Insert</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="tooltip" translatable="yes">Adds a new note to the list, just above the selected line, or appends it to the end if no line is selected. Is not possible to add a note before the reference (the first) one. You can also use the Insert key on the table beside.</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="button_scale_del">
+ <property name="label" translatable="yes">Delete</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="tooltip" translatable="yes">Deletes the selected notes. The reference note, i.e., the first one, cannot be removed. You can also use the Delete key on the table beside.</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="button_scale_import">
+ <property name="label" translatable="yes">Import</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="tooltip" translatable="yes">Imports the scale from an external .scl file, with the Scala project format (http://www.huygens-fokker.org/scala/)</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="padding">5</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox3">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkHBox" id="hbox4">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkLabel" id="label9">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Deviation</property>
+ </widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="root_frequency_error">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">Applies a shift in frequency to all the notes defined in the table above.</property>
+ <property name="invisible_char">&#x25CF;</property>
+ <property name="xalign">1</property>
+ <property name="adjustment">0 -500 500 1 10 0</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label19">
+ <property name="visible">True</property>
+ <property name="ypad">1</property>
+ <property name="label" translatable="yes">cents</property>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label26">
+ <property name="visible">True</property>
+ </widget>
+ <packing>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Lingot is an universal tuner, it can tune any instrument according to the scale you define here.</property>
+ <property name="xpad">1</property>
+ <property name="label" translatable="yes">Scale</property>
+ </widget>
+ <packing>
+ <property name="position">4</property>
+ <property name="tab_fill">False</property>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <widget class="GtkHButtonBox" id="dialog-action_area5">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <widget class="GtkButton" id="button_default">
+ <property name="label" translatable="yes">Default</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="tooltip" translatable="yes">Resets the built-in settings, without applying them.</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="button_apply">
+ <property name="label">gtk-apply</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="tooltip" translatable="yes">Apply the current changes to the running tuner, but doesn't modify the configuration file.</property>
+ <property name="use_stock">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="button_accept">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="tooltip" translatable="yes">Apply the current changes and modify the congifuration file.</property>
+ <property name="use_stock">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="button_cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="tooltip" translatable="yes">Rolls back all the previous applied changes and closes the configuration dialog.</property>
+ <property name="use_stock">True</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</glade-interface>
diff --git a/src/glade/lingot-mainframe.glade b/src/glade/lingot-mainframe.glade
new file mode 100644
index 0000000..ce76be9
--- /dev/null
+++ b/src/glade/lingot-mainframe.glade
@@ -0,0 +1,273 @@
+<?xml version="1.0"?>
+<glade-interface>
+ <!-- interface-requires gtk+ 2.16 -->
+ <!-- interface-naming-policy project-wide -->
+ <widget class="GtkWindow" id="window1">
+ <property name="visible">True</property>
+ <property name="no_show_all">True</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">lingot</property>
+ <property name="resizable">False</property>
+ <property name="window_position">center</property>
+ <child>
+ <widget class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <widget class="GtkMenuBar" id="menubar1">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkMenuItem" id="menuitem1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_File</property>
+ <property name="use_underline">True</property>
+ <child>
+ <widget class="GtkMenu" id="menu1">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkImageMenuItem" id="open_config_item">
+ <property name="label">gtk-open</property>
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Opens an external configuration file.</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkImageMenuItem" id="save_config_item">
+ <property name="label">gtk-save-as</property>
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Saves the running configuration to an external file.</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="separatormenuitem1">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkImageMenuItem" id="quit_item">
+ <property name="label">gtk-quit</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkMenuItem" id="menuitem2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Edit</property>
+ <property name="use_underline">True</property>
+ <child>
+ <widget class="GtkMenu" id="menu2">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkImageMenuItem" id="preferences_item">
+ <property name="label">gtk-preferences</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkMenuItem" id="menuitem3">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_View</property>
+ <property name="use_underline">True</property>
+ <child>
+ <widget class="GtkMenu" id="menu3">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkCheckMenuItem" id="spectrum_item">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Show spectrum</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkMenuItem" id="menuitem4">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Help</property>
+ <property name="use_underline">True</property>
+ <child>
+ <widget class="GtkMenu" id="menu4">
+ <property name="visible">True</property>
+ <child>
+ <widget class="GtkImageMenuItem" id="about_item">
+ <property name="label">gtk-about</property>
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="spacing">4</property>
+ <child>
+ <widget class="GtkFrame" id="frame1">
+ <property name="width_request">164</property>
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <widget class="GtkDrawingArea" id="gauge_area">
+ <property name="width_request">160</property>
+ <property name="height_request">100</property>
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Shows the error in cents in a visual way. The range will depend on the maximum distance between each two notes in the scale defined in the Lingot settings (try to provide scales with low maximum distance, i.e. with many notes, to have a higher resolution in this gauge),</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Deviation</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkFrame" id="frame3">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <widget class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkVBox" id="vbox2">
+ <property name="width_request">110</property>
+ <property name="height_request">100</property>
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <widget class="GtkLabel" id="freq_label">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Estimated fundamental frequency in hertzs.</property>
+ <property name="label" translatable="yes">f = ---</property>
+ </widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="tone_label">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Closest note to the estimated frequency, according to the scale defined in the Lingot settings.</property>
+ <property name="label" translatable="yes">---</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="error_label">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Error in cents between the estimated frequency and the closest note according to the scale defined in the Lingot settings.</property>
+ <property name="label" translatable="yes">e = ---</property>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Tone</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkFrame" id="spectrum_frame">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="width_request">290</property>
+ <property name="height_request">96</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <child>
+ <widget class="GtkViewport" id="viewport1">
+ <property name="visible">True</property>
+ <property name="resize_mode">queue</property>
+ <child>
+ <widget class="GtkDrawingArea" id="spectrum_area">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">This area shows the spectral power density of the captured signal. The fundamental frequency is shown with a red dot, and the noise threshold with a horizontal dotted yellow line. If you have a large FFT buffer (with more than 512 samples), you can browse through the whole spectrum with a horizontal scrollbar.</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Spectrum</property>
+ <property name="use_markup">True</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+</glade-interface>
diff --git a/src/lingot-audio-alsa.c b/src/lingot-audio-alsa.c
new file mode 100644
index 0000000..2c134f3
--- /dev/null
+++ b/src/lingot-audio-alsa.c
@@ -0,0 +1,205 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <stdlib.h>
+
+#include "lingot-defs.h"
+#include "lingot-audio-alsa.h"
+#include "lingot-i18n.h"
+#include "lingot-msg.h"
+
+LingotAudioHandler* lingot_audio_alsa_new(char* device, int sample_rate) {
+
+ LingotAudioHandler* audio = NULL;
+
+# ifdef ALSA
+ const char* exception;
+ snd_pcm_hw_params_t* hw_params = NULL;
+ int err;
+ char error_message[1000];
+ unsigned int channels = 1;
+
+ audio = malloc(sizeof(LingotAudioHandler));
+ audio->read_buffer = NULL;
+ audio->audio_system = AUDIO_SYSTEM_ALSA;
+ audio->read_buffer_size = 128; // TODO: size up
+
+ // ALSA allocates some mem to load its config file when we call
+ // snd_card_next. Now that we're done getting the info, let's tell ALSA
+ // to unload the info and free up that mem
+ snd_config_update_free_global();
+
+ audio->capture_handle = NULL;
+
+ try {
+ if ((err = snd_pcm_open(&audio->capture_handle, device,
+ SND_PCM_STREAM_CAPTURE, 0)) < 0) {
+ sprintf(error_message, "Cannot open audio device %s.\n%s.", device,
+ snd_strerror(err));
+ throw(error_message);
+ }
+
+ strcpy(audio->device, device);
+
+ if ((err = snd_pcm_hw_params_malloc(&hw_params)) < 0) {
+ sprintf(error_message,
+ "Cannot allocate hardware parameter structure.\n%s.",
+ snd_strerror(err));
+ throw(error_message);
+ }
+
+ if ((err = snd_pcm_hw_params_any(audio->capture_handle, hw_params)) < 0) {
+ sprintf(error_message,
+ "Cannot initialize hardware parameter structure.\n%s.",
+ snd_strerror(err));
+ throw(error_message);
+ }
+
+ if ((err = snd_pcm_hw_params_set_access(audio->capture_handle,
+ hw_params, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) {
+ sprintf(error_message, "Cannot set access type.\n%s", snd_strerror(
+ err));
+ throw(error_message);
+ }
+
+ if ((err = snd_pcm_hw_params_set_format(audio->capture_handle,
+ hw_params, SND_PCM_FORMAT_S16_LE)) < 0) {
+ sprintf(error_message, "Cannot set sample format.\n%s.",
+ snd_strerror(err));
+ throw(error_message);
+ }
+
+ unsigned int rate = sample_rate;
+
+ if ((err = snd_pcm_hw_params_set_rate_near(audio->capture_handle,
+ hw_params, &rate, 0)) < 0) {
+ sprintf(error_message, "Cannot set sample rate.\n%s.",
+ snd_strerror(err));
+ throw(error_message);
+ }
+
+ audio->real_sample_rate = rate;
+
+ if ((err = snd_pcm_hw_params_set_channels(audio->capture_handle,
+ hw_params, channels)) < 0) {
+ sprintf(error_message, "Cannot set channel count.\n%s.",
+ snd_strerror(err));
+ throw(error_message);
+ }
+
+ if ((err = snd_pcm_hw_params(audio->capture_handle, hw_params)) < 0) {
+ sprintf(error_message, "Cannot set parameters.\n%s.", snd_strerror(
+ err));
+ throw(error_message);
+ }
+
+ if ((err = snd_pcm_prepare(audio->capture_handle)) < 0) {
+ sprintf(error_message,
+ "Cannot prepare audio interface for use.\n%s.",
+ snd_strerror(err));
+ throw(error_message);
+ }
+
+ audio->read_buffer = malloc(channels * audio->read_buffer_size
+ * sizeof(SAMPLE_TYPE));
+ memset(audio->read_buffer, 0, audio->read_buffer_size
+ * sizeof(SAMPLE_TYPE));
+ } catch {
+ if (audio->capture_handle != NULL)
+ snd_pcm_close(audio->capture_handle);
+ free(audio);
+ audio = NULL;
+ lingot_msg_add_error(exception);
+ }
+
+ if (hw_params != NULL)
+ snd_pcm_hw_params_free(hw_params);
+
+# else
+ lingot_msg_add_error(
+ _("The application has not been built with ALSA support"));
+# endif
+
+ return audio;
+}
+
+void lingot_audio_alsa_destroy(LingotAudioHandler* audio) {
+# ifdef ALSA
+ if (audio != NULL) {
+ snd_pcm_close(audio->capture_handle);
+ free(audio->read_buffer);
+ }
+# endif
+}
+
+int lingot_audio_alsa_read(LingotAudioHandler* audio) {
+# ifdef ALSA
+ int temp_sret;
+ int i;
+
+ temp_sret = snd_pcm_readi(audio->capture_handle, audio->read_buffer,
+ audio->read_buffer_size);
+
+ // if (rand() < 0.001 * RAND_MAX)
+ // temp_sret = 0;
+
+ if (temp_sret != audio->read_buffer_size) {
+ char buff[100];
+ sprintf(buff, _("Read from audio interface failed.\n%s."),
+ snd_strerror(temp_sret));
+ lingot_msg_add_error(buff);
+ return -1;
+ }
+
+ // float point conversion
+ for (i = 0; i < audio->read_buffer_size; i++) {
+ audio->flt_read_buffer[i] = audio->read_buffer[i];
+ }
+
+# endif
+
+ return 0;
+}
+
+LingotAudioSystemProperties* lingot_audio_alsa_get_audio_system_properties(
+ audio_system_t audio_system) {
+
+ LingotAudioSystemProperties* result =
+ (LingotAudioSystemProperties*) malloc(1
+ * sizeof(LingotAudioSystemProperties));
+
+ // TODO
+ result->forced_sample_rate = 0;
+ result->n_devices = 0;
+ result->devices = NULL;
+
+ result->n_sample_rates = 5;
+ result->sample_rates = malloc(result->n_sample_rates * sizeof(int));
+ result->sample_rates[0] = 8000;
+ result->sample_rates[1] = 11025;
+ result->sample_rates[2] = 22050;
+ result->sample_rates[3] = 44100;
+ result->sample_rates[4] = 48000;
+
+ return result;
+}
+
diff --git a/src/lingot-audio-alsa.h b/src/lingot-audio-alsa.h
new file mode 100644
index 0000000..3580c1e
--- /dev/null
+++ b/src/lingot-audio-alsa.h
@@ -0,0 +1,34 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LINGOT_AUDIO_ALSA_H__
+#define __LINGOT_AUDIO_ALSA_H__
+
+#include "lingot-audio.h"
+
+LingotAudioHandler* lingot_audio_alsa_new(char* device, int sample_rate);
+void lingot_audio_alsa_destroy(LingotAudioHandler*);
+int lingot_audio_alsa_read(LingotAudioHandler*);
+LingotAudioSystemProperties* lingot_audio_alsa_get_audio_system_properties(
+ audio_system_t);
+
+#endif
diff --git a/src/lingot-audio-jack.c b/src/lingot-audio-jack.c
new file mode 100644
index 0000000..5135c38
--- /dev/null
+++ b/src/lingot-audio-jack.c
@@ -0,0 +1,349 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <stdio.h>
+
+#include "lingot-defs.h"
+#include "lingot-audio-jack.h"
+#include "lingot-i18n.h"
+#include "lingot-msg.h"
+
+#ifdef JACK
+#include <jack/jack.h>
+
+// persistent JACK client to obtain hardware parameters
+jack_client_t* client = NULL;
+pthread_mutex_t stop_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+// this array allows us to reconnect the client to the last ports it was
+// connected in a previous session
+#define MAX_LAST_PORTS 10
+char last_ports[MAX_LAST_PORTS][80];
+
+int lingot_audio_jack_process(jack_nframes_t nframes, void* param) {
+ LingotAudioHandler* audio = param;
+ audio->nframes = nframes;
+
+ pthread_mutex_lock(&stop_mutex);
+ if (audio->running) {
+ lingot_audio_jack_read(audio);
+ audio->process_callback(audio->flt_read_buffer,
+ audio->read_buffer_size, audio->process_callback_arg);
+ }
+ pthread_mutex_unlock(&stop_mutex);
+
+ return 0;
+}
+
+// JACK calls this shutdown_callback if the server ever shuts down or
+// decides to disconnect the client.
+void lingot_audio_jack_shutdown(void* param) {
+ LingotAudioHandler* audio = param;
+ lingot_msg_add_error(_("Missing connection with JACK audio server"));
+ pthread_mutex_lock(&stop_mutex);
+ audio->interrupted = 1;
+ pthread_mutex_unlock(&stop_mutex);
+}
+#endif
+
+LingotAudioHandler* lingot_audio_jack_new(char* device, int sample_rate) {
+
+ LingotAudioHandler* audio = NULL;
+
+# ifdef JACK
+ const char* exception;
+ const char **ports = NULL;
+ const char *client_name = "lingot";
+ const char *server_name = NULL;
+
+ jack_options_t options = JackNoStartServer;
+ jack_status_t status;
+
+ audio = malloc(sizeof(LingotAudioHandler));
+ strcpy(audio->device, "");
+
+ audio->audio_system = AUDIO_SYSTEM_JACK;
+ audio->jack_client = jack_client_open(client_name, options, &status,
+ server_name);
+
+ try {
+ if (audio->jack_client == NULL) {
+ throw(_("Unable to connect to JACK server"));
+ }
+
+ if (status & JackServerStarted) {
+ fprintf(stderr, "JACK server started\n");
+ }
+ if (status & JackNameNotUnique) {
+ client_name = jack_get_client_name(audio->jack_client);
+ fprintf(stderr, "unique name `%s' assigned\n", client_name);
+ }
+
+ jack_on_shutdown(audio->jack_client, lingot_audio_jack_shutdown, audio);
+
+ audio->real_sample_rate = jack_get_sample_rate(audio->jack_client);
+ audio->read_buffer_size = jack_get_buffer_size(audio->jack_client);
+
+ // printf("engine sample rate: %" PRIu32 "\n", jack_get_sample_rate(
+ // audio->jack_client));
+ // printf("buffer size: %" PRIu32 "\n", jack_get_buffer_size(
+ // audio->jack_client));
+
+ audio->jack_input_port = jack_port_register(audio->jack_client,
+ "input", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0);
+
+ if ((audio->jack_input_port == NULL)) {
+ throw(_("No more JACK ports available"));
+ }
+
+ } catch {
+ free(audio);
+ audio = NULL;
+ lingot_msg_add_error(exception);
+ }
+
+ if (ports != NULL)
+ free(ports);
+
+ if (audio != NULL) {
+ client = audio->jack_client;
+ }
+
+# else
+ lingot_msg_add_error(
+ _("The application has not been built with JACK support"));
+# endif
+ return audio;
+}
+
+void lingot_audio_jack_destroy(LingotAudioHandler* audio) {
+# ifdef JACK
+ if (audio != NULL) {
+ //jack_cycle_wait(audio->jack_client);
+ // jack_deactivate(audio->jack_client);
+ jack_client_close(audio->jack_client);
+ client = NULL;
+ }
+# endif
+}
+
+int lingot_audio_jack_read(LingotAudioHandler* audio) {
+# ifdef JACK
+ register int i;
+ float* in = jack_port_get_buffer(audio->jack_input_port, audio->nframes);
+ for (i = 0; i < audio->nframes; i++)
+ audio->flt_read_buffer[i] = in[i] * 32768;
+ return 0;
+# else
+ return -1;
+# endif
+}
+
+LingotAudioSystemProperties* lingot_audio_jack_get_audio_system_properties(
+ audio_system_t audio_system) {
+
+ LingotAudioSystemProperties* properties = NULL;
+# ifdef JACK
+ properties = (LingotAudioSystemProperties*) malloc(1
+ * sizeof(LingotAudioSystemProperties));
+
+ int sample_rate = -1;
+
+ const char *client_name = "lingot-get-sample-rate";
+ const char *server_name = NULL;
+
+ jack_options_t options = JackNoStartServer;
+ jack_status_t status;
+ jack_client_t* jack_client = NULL;
+ const char **ports = NULL;
+ const char* exception;
+
+ unsigned long int flags = JackPortIsOutput;
+
+ try {
+ if (client != NULL) {
+ sample_rate = jack_get_sample_rate(client);
+ ports = jack_get_ports(client, NULL, NULL, flags);
+ } else {
+ jack_client = jack_client_open(client_name, options, &status,
+ server_name);
+ if (jack_client == NULL) {
+ throw(_("Unable to connect to JACK server"));
+ }
+ if (status & JackServerStarted) {
+ fprintf(stderr, "JACK server started\n");
+ }
+ if (status & JackNameNotUnique) {
+ client_name = jack_get_client_name(jack_client);
+ fprintf(stderr, "unique name `%s' assigned\n", client_name);
+ }
+
+ sample_rate = jack_get_sample_rate(jack_client);
+
+ ports = jack_get_ports(jack_client, NULL, NULL, flags);
+ }
+ } catch {
+ // here I throw a warning message because we are only ontaining the
+ // audio properties
+ lingot_msg_add_warning(exception);
+ }
+
+ properties->forced_sample_rate = 1;
+ properties->n_devices = 0;
+ properties->devices = NULL;
+
+ if (ports != NULL) {
+ int i;
+ for (i = 0; ports[i] != NULL; i++) {
+ }
+ properties->n_devices = i;
+
+ if (properties->n_devices != 0) {
+ properties->devices = malloc(properties->n_devices * sizeof(char*));
+ for (i = 0; ports[i] != NULL; i++) {
+ properties->devices[i] = strdup(ports[i]);
+ }
+ }
+
+ }
+
+ if (sample_rate == -1) {
+ properties->n_sample_rates = 0;
+ properties->sample_rates = NULL;
+ } else {
+ properties->n_sample_rates = 1;
+ properties->sample_rates = malloc(properties->n_sample_rates
+ * sizeof(int));
+ properties->sample_rates[0] = sample_rate;
+ }
+
+ if (ports != NULL)
+ free(ports);
+
+ if (jack_client != NULL)
+ jack_client_close(jack_client);
+
+# else
+ lingot_msg_add_error(
+ _("The application has not been built with JACK support"));
+# endif
+
+ return properties;
+}
+
+int lingot_audio_jack_start(LingotAudioHandler* audio) {
+ int result = 0;
+
+# ifdef JACK
+ int index = 0;
+ const char **ports = NULL;
+ const char* exception;
+ jack_set_process_callback(audio->jack_client, lingot_audio_jack_process,
+ audio);
+
+ try {
+ if (jack_activate(audio->jack_client)) {
+ throw(_("Cannot activate client"));
+ }
+
+ ports
+ = jack_get_ports(audio->jack_client, NULL, NULL,
+ JackPortIsOutput);
+ if (ports == NULL) {
+ throw(_("No active capture ports"));
+ }
+
+ // try to connect the client to the ports is was connected before
+ int j = 0;
+ int connections = 0;
+ for (j = 0; j < MAX_LAST_PORTS; j++) {
+ for (index = 0; ports[index]; index++) {
+ if (!strcmp(last_ports[j], ports[index])) {
+ if (jack_connect(audio->jack_client, ports[index],
+ jack_port_name(audio->jack_input_port))) {
+ throw(_("Cannot connect input ports"));
+ } else {
+ connections++;
+ }
+ }
+ }
+ }
+
+ // if there wasn't connections before, we connect the client to the
+ // first physical port
+ if (!connections) {
+ free(ports);
+ ports = jack_get_ports(audio->jack_client, NULL, NULL,
+ JackPortIsPhysical | JackPortIsOutput);
+ if (ports == NULL) {
+ throw(_("No physical capture ports"));
+ }
+
+ if (jack_connect(audio->jack_client, ports[0], jack_port_name(
+ audio->jack_input_port))) {
+ throw(_("Cannot connect input ports"));
+ }
+ }
+
+ } catch {
+ lingot_msg_add_error(exception);
+ result = -1;
+ }
+
+ free(ports);
+# else
+ lingot_msg_add_error(
+ _("The application has not been built with JACK support"));
+# endif
+
+ return result;
+}
+
+void lingot_audio_jack_stop(LingotAudioHandler* audio) {
+# ifdef JACK
+ //jack_cycle_wait(audio->jack_client);
+ const char** ports = jack_get_ports(audio->jack_client, NULL, NULL,
+ JackPortIsOutput);
+
+ if (ports != NULL) {
+ int i, j = 0;
+
+ for (i = 0; i < MAX_LAST_PORTS; i++) {
+ strcpy(last_ports[i], "");
+ }
+
+ for (i = 0; ports[i]; i++) {
+ if (jack_port_connected(jack_port_by_name(audio->jack_client,
+ ports[i]))) {
+ strcpy(last_ports[j++], ports[i]);
+ }
+ }
+ }
+
+ pthread_mutex_lock(&stop_mutex);
+ jack_deactivate(audio->jack_client);
+ pthread_mutex_unlock(&stop_mutex);
+# else
+ lingot_msg_add_error(
+ _("The application has not been built with JACK support"));
+# endif
+}
diff --git a/src/lingot-audio-jack.h b/src/lingot-audio-jack.h
new file mode 100644
index 0000000..92495cc
--- /dev/null
+++ b/src/lingot-audio-jack.h
@@ -0,0 +1,36 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LINGOT_AUDIO_JACK_H__
+#define __LINGOT_AUDIO_JACK_H__
+
+#include "lingot-audio.h"
+
+LingotAudioHandler* lingot_audio_jack_new(char* device, int sample_rate);
+void lingot_audio_jack_destroy(LingotAudioHandler*);
+int lingot_audio_jack_read(LingotAudioHandler*);
+LingotAudioSystemProperties* lingot_audio_jack_get_audio_system_properties(
+ audio_system_t);
+int lingot_audio_jack_start(LingotAudioHandler*);
+void lingot_audio_jack_stop(LingotAudioHandler*);
+
+#endif
diff --git a/src/lingot-audio-oss.c b/src/lingot-audio-oss.c
new file mode 100644
index 0000000..ee43ae6
--- /dev/null
+++ b/src/lingot-audio-oss.c
@@ -0,0 +1,168 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <sys/soundcard.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "lingot-msg.h"
+#include "lingot-defs.h"
+#include "lingot-audio-oss.h"
+#include "lingot-i18n.h"
+
+LingotAudioHandler* lingot_audio_oss_new(char* device, int sample_rate) {
+
+ int channels = 1;
+ int format = SAMPLE_FORMAT;
+ char error_message[100];
+ const char* exception;
+
+ LingotAudioHandler* audio = malloc(sizeof(LingotAudioHandler));
+
+ audio->audio_system = AUDIO_SYSTEM_OSS;
+ audio->dsp = open(device, O_RDONLY);
+ audio->read_buffer_size = 128; // TODO: size up
+ strcpy(audio->device, device);
+
+ try {
+
+ if (audio->dsp < 0) {
+ sprintf(error_message, _("Unable to open audio device %s.\n%s."),
+ device, strerror(errno));
+ throw(error_message);
+ }
+
+ //if (ioctl(audio->dsp, SOUND_PCM_READ_CHANNELS, &channels) < 0)
+ if (ioctl(audio->dsp, SNDCTL_DSP_CHANNELS, &channels) < 0) {
+ sprintf(error_message, _("Error setting number of channels.\n%s."),
+ strerror(errno));
+ throw(error_message);
+ }
+
+ // sample size
+ //if (ioctl(audio->dsp, SOUND_PCM_SETFMT, &format) < 0)
+ if (ioctl(audio->dsp, SNDCTL_DSP_SETFMT, &format) < 0) {
+ sprintf(error_message, _("Error setting bits per sample.\n%s."),
+ strerror(errno));
+ throw(error_message);
+ }
+
+ int fragment_size = 1;
+ int DMA_buffer_size = 512;
+ int param = 0;
+
+ for (param = 0; fragment_size < DMA_buffer_size; param++)
+ fragment_size <<= 1;
+
+ param |= 0x00ff0000;
+
+ if (ioctl(audio->dsp, SNDCTL_DSP_SETFRAGMENT, &param) < 0) {
+ sprintf(error_message, _("Error setting DMA buffer size.\n%s."),
+ strerror(errno));
+ throw(error_message);
+ }
+
+ if (ioctl(audio->dsp, SNDCTL_DSP_SPEED, &sample_rate) < 0) {
+ sprintf(error_message, _("Error setting sample rate.\n%s."),
+ strerror(errno));
+ throw(error_message);
+ }
+
+ audio->real_sample_rate = sample_rate;
+ audio->read_buffer = malloc(audio->read_buffer_size
+ * sizeof(SAMPLE_TYPE));
+ memset(audio->read_buffer, 0, audio->read_buffer_size
+ * sizeof(SAMPLE_TYPE));
+
+ } catch {
+ close(audio->dsp);
+ free(audio);
+ audio = NULL;
+ lingot_msg_add_error(exception);
+ }
+
+ return audio;
+}
+
+void lingot_audio_oss_destroy(LingotAudioHandler* audio) {
+ if (audio != NULL) {
+ close(audio->dsp);
+ free(audio->read_buffer);
+ }
+}
+
+int lingot_audio_oss_read(LingotAudioHandler* audio) {
+ int i;
+ int read_size;
+
+ read_size = read(audio->dsp, audio->read_buffer, audio->read_buffer_size
+ * sizeof(SAMPLE_TYPE));
+
+ // if (rand() < 0.001 * RAND_MAX)
+ // read_size = 0;
+
+ if (read_size != audio->read_buffer_size * sizeof(SAMPLE_TYPE)) {
+ char buff[100];
+ sprintf(buff, _("Read from audio interface failed.\n%s."), strerror(
+ errno));
+ lingot_msg_add_error(buff);
+ return -1;
+ }
+
+ // float point conversion
+ for (i = 0; i < audio->read_buffer_size; i++) {
+ audio->flt_read_buffer[i] = audio->read_buffer[i];
+ }
+
+ return 0;
+}
+
+LingotAudioSystemProperties* lingot_audio_oss_get_audio_system_properties(
+ audio_system_t audio_system) {
+
+ LingotAudioSystemProperties* result =
+ (LingotAudioSystemProperties*) malloc(1
+ * sizeof(LingotAudioSystemProperties));
+
+ // TODO
+ result->forced_sample_rate = 0;
+ result->n_devices = 0;
+ result->devices = NULL;
+
+ result->n_sample_rates = 5;
+ result->sample_rates = malloc(result->n_sample_rates * sizeof(int));
+ result->sample_rates[0] = 8000;
+ result->sample_rates[1] = 11025;
+ result->sample_rates[2] = 22050;
+ result->sample_rates[3] = 44100;
+ result->sample_rates[4] = 48000;
+
+ return result;
+}
+
diff --git a/src/lingot-audio-oss.h b/src/lingot-audio-oss.h
new file mode 100644
index 0000000..a87e204
--- /dev/null
+++ b/src/lingot-audio-oss.h
@@ -0,0 +1,34 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LINGOT_AUDIO_OSS_H__
+#define __LINGOT_AUDIO_OSS_H__
+
+#include "lingot-audio.h"
+
+LingotAudioHandler* lingot_audio_oss_new(char* device, int sample_rate);
+void lingot_audio_oss_destroy(LingotAudioHandler*);
+int lingot_audio_oss_read(LingotAudioHandler*);
+LingotAudioSystemProperties* lingot_audio_oss_get_audio_system_properties(
+ audio_system_t);
+
+#endif
diff --git a/src/lingot-audio.c b/src/lingot-audio.c
new file mode 100644
index 0000000..7e81ab1
--- /dev/null
+++ b/src/lingot-audio.c
@@ -0,0 +1,208 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "lingot-defs.h"
+#include "lingot-audio.h"
+
+#include "lingot-core.h"
+#include "lingot-audio-oss.h"
+#include "lingot-audio-alsa.h"
+#include "lingot-audio-jack.h"
+
+LingotAudioHandler* lingot_audio_new(audio_system_t audio_system, char* device,
+ int sample_rate, LingotAudioProcessCallback process_callback,
+ void *process_callback_arg) {
+
+ LingotAudioHandler* result = NULL;
+
+ switch (audio_system) {
+ case AUDIO_SYSTEM_OSS:
+ result = lingot_audio_oss_new(device, sample_rate);
+ break;
+ case AUDIO_SYSTEM_ALSA:
+ result = lingot_audio_alsa_new(device, sample_rate);
+ break;
+ case AUDIO_SYSTEM_JACK:
+ result = lingot_audio_jack_new(device, sample_rate);
+ break;
+ }
+
+ if (result != NULL) {
+ // audio source read in floating point format.
+ result->flt_read_buffer
+ = malloc(result->read_buffer_size * sizeof(FLT));
+ memset(result->flt_read_buffer, 0, result->read_buffer_size
+ * sizeof(FLT));
+ result->process_callback = process_callback;
+ result->process_callback_arg = process_callback_arg;
+ result->interrupted = 0;
+ result->running = 0;
+ }
+
+ return result;
+}
+
+void lingot_audio_destroy(LingotAudioHandler* audio) {
+ if (audio != NULL) {
+
+ free(audio->flt_read_buffer);
+
+ switch (audio->audio_system) {
+ case AUDIO_SYSTEM_OSS:
+ lingot_audio_oss_destroy(audio);
+ break;
+ case AUDIO_SYSTEM_ALSA:
+ lingot_audio_alsa_destroy(audio);
+ break;
+ case AUDIO_SYSTEM_JACK:
+ lingot_audio_jack_destroy(audio);
+ break;
+ default:
+ perror("unknown audio system\n");
+ break;
+ }
+
+ free(audio);
+ }
+}
+
+int lingot_audio_read(LingotAudioHandler* audio) {
+ int result = -1;
+
+ if (audio != NULL)
+ switch (audio->audio_system) {
+ case AUDIO_SYSTEM_OSS:
+ result = lingot_audio_oss_read(audio);
+ break;
+ case AUDIO_SYSTEM_ALSA:
+ result = lingot_audio_alsa_read(audio);
+ break;
+ // case AUDIO_SYSTEM_JACK:
+ // result = lingot_audio_jack_read(audio);
+ // break;
+ default:
+ perror("unknown audio system\n");
+ result = -1;
+ break;
+ }
+
+ return result;
+}
+
+LingotAudioSystemProperties* lingot_audio_get_audio_system_properties(
+ audio_system_t audio_system) {
+ LingotAudioSystemProperties* result;
+
+ switch (audio_system) {
+ case AUDIO_SYSTEM_OSS:
+ result = lingot_audio_oss_get_audio_system_properties(audio_system);
+ break;
+ case AUDIO_SYSTEM_ALSA:
+ result = lingot_audio_alsa_get_audio_system_properties(audio_system);
+ break;
+ case AUDIO_SYSTEM_JACK:
+ result = lingot_audio_jack_get_audio_system_properties(audio_system);
+ break;
+ default:
+ perror("unknown audio system\n");
+ result = NULL;
+ break;
+ }
+
+ return result;
+}
+
+void lingot_audio_audio_system_properties_destroy(
+ LingotAudioSystemProperties* properties) {
+
+ int i;
+ for (i = 0; i < properties->n_devices; i++) {
+ free(properties->devices[i]);
+ }
+
+ if (properties->sample_rates != NULL)
+ free(properties->sample_rates);
+ if (properties->devices != NULL)
+ free(properties->devices);
+}
+
+void lingot_audio_run_reading_thread(LingotAudioHandler* audio) {
+
+ int read_status = 0;
+
+ while (audio->running) {
+ // process new data block.
+ read_status = lingot_audio_read(audio);
+
+ if (read_status == 0) {
+ audio->process_callback(audio->flt_read_buffer,
+ audio->read_buffer_size, audio->process_callback_arg);
+ } else {
+ audio->running = 0;
+ audio->interrupted = 1;
+ }
+ }
+}
+
+int lingot_audio_start(LingotAudioHandler* audio) {
+
+ int result = 0;
+
+ if (audio->audio_system != AUDIO_SYSTEM_JACK) {
+ pthread_attr_init(&audio->thread_input_read_attr);
+
+ // detached thread.
+ // pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+ pthread_create(&audio->thread_input_read,
+ &audio->thread_input_read_attr,
+ (void* (*)(void*)) lingot_audio_run_reading_thread, audio);
+ } else {
+ result = lingot_audio_jack_start(audio);
+ }
+
+ if (result == 0) {
+ audio->running = 1;
+ }
+
+ return result;
+}
+
+void lingot_audio_stop(LingotAudioHandler* audio) {
+ void* thread_result;
+
+ if (audio->running == 1) {
+ audio->running = 0;
+ // thread cancellation
+ if (audio->audio_system != AUDIO_SYSTEM_JACK) {
+ pthread_cancel(audio->thread_input_read);
+ pthread_join(audio->thread_input_read, &thread_result);
+ pthread_attr_destroy(&audio->thread_input_read_attr);
+ } else {
+ lingot_audio_jack_stop(audio);
+ }
+ }
+}
+
diff --git a/src/lingot-audio.h b/src/lingot-audio.h
new file mode 100644
index 0000000..d76995c
--- /dev/null
+++ b/src/lingot-audio.h
@@ -0,0 +1,109 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LINGOT_AUDIO_H__
+#define __LINGOT_AUDIO_H__
+
+#ifdef ALSA
+#include <alsa/asoundlib.h>
+#endif
+
+#ifdef JACK
+#include <jack/jack.h>
+#endif
+
+#include "lingot-config.h"
+
+typedef void (*LingotAudioProcessCallback)(FLT* read_buffer,
+ int read_buffer_size, void *arg);
+
+typedef struct _LingotAudioHandler LingotAudioHandler;
+
+struct _LingotAudioHandler {
+
+ int audio_system;
+ char device[100];
+
+ LingotAudioProcessCallback process_callback;
+ void* process_callback_arg;
+
+#ifdef ALSA
+ snd_pcm_t *capture_handle;
+#endif
+
+ int dsp; // file handler.
+ int read_buffer_size;
+ SAMPLE_TYPE* read_buffer;
+ FLT* flt_read_buffer;
+
+# ifdef JACK
+ jack_port_t *jack_input_port;
+ jack_client_t *jack_client;
+ int nframes;
+# endif
+
+ // char error_message[100];
+ unsigned int real_sample_rate;
+
+ // pthread-related member variables
+ pthread_t thread_input_read;
+ pthread_attr_t thread_input_read_attr;
+
+ // indicates whether the audio thread is running
+ int running;
+
+ // indicates whether the thread was interrupted (by the audio server, not
+ // by the user)
+ int interrupted;
+};
+
+typedef struct _LingotAudioSystemProperties LingotAudioSystemProperties;
+
+struct _LingotAudioSystemProperties {
+
+ int forced_sample_rate; // tells whether the sample rate can be changed
+
+ int n_sample_rates; // number of available sample rates
+ int* sample_rates; // sample rates
+
+ int n_devices; // number of available devices
+ char** devices; // devices
+};
+
+LingotAudioSystemProperties* lingot_audio_get_audio_system_properties(
+ audio_system_t audio_system);
+void lingot_audio_audio_system_properties_destroy(LingotAudioSystemProperties*);
+
+// creates an audio handler
+LingotAudioHandler
+ *
+ lingot_audio_new(audio_system_t audio_system, char* device,
+ int sample_rate, LingotAudioProcessCallback process_callback,
+ void *process_callback_arg);
+
+// destroys an audio handler
+void lingot_audio_destroy(LingotAudioHandler*);
+
+int lingot_audio_start(LingotAudioHandler*);
+void lingot_audio_stop(LingotAudioHandler*);
+
+#endif
diff --git a/src/lingot-background.xpm b/src/lingot-background.xpm
new file mode 100644
index 0000000..d7cb633
--- /dev/null
+++ b/src/lingot-background.xpm
@@ -0,0 +1,201 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+/* XPM */
+static char *background2_xpm[] = {
+/* columns rows colors chars-per-pixel */
+"160 100 74 1",
+" c #000000",
+". c #8E8D8E",
+"X c #9A898B",
+"o c #9A9294",
+"O c #9A999B",
+"+ c #A79699",
+"@ c #A7989A",
+"# c #9F9EA0",
+"$ c #A19FA1",
+"% c #A7A6A7",
+"& c #A8A6A8",
+"* c #A7A8A9",
+"= c #AAAAAB",
+"- c #BFBFBF",
+"; c #CD9A9D",
+": c #D09B9F",
+"> c #DD9EA2",
+", c #DDA1A5",
+"< c #ECA7AC",
+"1 c #EEAAAE",
+"2 c #F1A7AE",
+"3 c #F0AAAE",
+"4 c #E6B3AE",
+"5 c #EEADB0",
+"6 c #F0ADB0",
+"7 c #EEB6B9",
+"8 c #E7BDBA",
+"9 c #ECBCBE",
+"0 c #F1B4B9",
+"q c #F1BDBF",
+"w c #BFC0BF",
+"e c #B5E5AE",
+"r c #ABF1AE",
+"t c #B2F0B3",
+"y c #B7F1B9",
+"u c #B8F0BA",
+"i c #C0E8BA",
+"p c #EEBDC0",
+"a c #F0BEC1",
+"s c #BFEFC1",
+"d c #C2C2C2",
+"f c #CDC6C5",
+"g c #CCCBCD",
+"h c #CECFD0",
+"j c #D0CED0",
+"k c #CFD0D0",
+"l c #D1D1D1",
+"z c #DDD6D7",
+"x c #D7D6D8",
+"c c #D9D7D9",
+"v c #DBDADC",
+"b c #EEC0C2",
+"n c #F0C0C2",
+"m c #DDE0DF",
+"M c #D9EFDA",
+"N c #DDDFE1",
+"B c #F0DFE3",
+"V c #DEE0E1",
+"C c #E2E2E2",
+"Z c #EEE2E4",
+"A c #EEEEEE",
+"S c #F0E2E4",
+"D c #F1E7EB",
+"F c #F0EBEB",
+"G c #E2F0E3",
+"H c #E7F1EA",
+"J c #EDF0EE",
+"K c #EFEFF0",
+"L c #F1EFF3",
+"P c #EEF3F3",
+"I c #F2F2F2",
+"U c #F7F8F7",
+"Y c #F7F8F8",
+"T c #F9F9F9",
+/* pixels */
+" ",
+" Oggfddgdfdddddd8-dw-8dd---8dd---8dd---8dd---8dd---8dd---8dd---8ddww-8wwdddddd-ddddd8dddddwd-8wddd-8dd---8dd---8dd---8dd---8dd---8dd---8dd---8dd---8dwddgffdggO ",
+" gTTTTTTTTTYYYYYYYYYYYUUTYYYYYTYYYUUTYYYYYTYYYUUTYYYYYTUYYUUTYYYYYTTTTTTYTTTTTTTTYYYPYYYTTTTTTTYUYYYYYTUYYUUTYYYYYTUUYTUTYYYYYTUUYUTTYYYYYTYYYUUTYYTTTTTTTTTTTk ",
+" fTTTTTTTTTYYYYYYYYYYUUUUYYYYYYYYYYUUYYYYYYYYYYUYYYYYYYYYYYUUYYYYTTTTTTTTTYTTTTTTTTYYYYYTTTTTTTTYYYYYYYYYYUUYYYYYYYYUTUUYYYYYYYYTUTUUYYYYYYYYYYUYYYTTTTTTTTTTTg ",
+" fTTTTTTYYYYUUIUYUUULUUUUUUUUUUUUUUUIUIUUUUUUIUUUUUUUUUUUUUUUUUUUUUUUUUTYUYUUUYYUUUYYUUUYYYUUUYYUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUIIUUUUUUUUIUUUUUYTTTTTTTTTTf ",
+" gTTTTTTUUYUIUIUIIUYLUUULULUIUUIIULUUIUUUILUIUIULUIIUIIUUUIUUUUUIUUUULIUUUUUUUUUUUULUUUUYYUIYIIUUULUUUIUUULUIUIUUILUILIULULIIUUIIULUUUIIUILUIUIULUIUTTTTTTTTTTg ",
+" gTTTTTTUUUUUIUIIIUIUIUIIIUIIULIUIUIIIUIIUIUILIUIUIUIIULUIUIIUUIIUIUUIUULUUUIUIYUUIUUUUIUIUUIUIULUIUUIULUIUIIUUIIUIUUIIIIUIUIILIIUUIIIIUIUIUILIUIUIUIUYUTTTTTTd ",
+" dTTTTTTUULUIIIIIUIILIIIUIIIIIIIIILUIIIIIIIIIUIIILIUIILUIULUIIIUUIUILUULLULUUUUIUIUULUUUIUUIUIIUULUIIULUIIIIILIIIIIILIIUILUIIUIIIIILUIIIIIIIIUIIILIIIUIUTTTTTTf ",
+" dTTTYYULULLIIIIIIIIIIIILIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIUIIIUIULIUIUIUUIIIUIUIUIIIIUIUIIIIIIIIIIUIIIIFIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIILIIIIIIUUUUYTTTf ",
+" dTTYYUUULIIIIFIIIFIIJIIILIIFIIIIIFIJIIIIIIFFIJLILIIIIIIIIIIIIIIIIIIIIIIIIUIIIIIIIUIIIIILUIUIIIIIILUIIIIIIIIIIIIIAIIIIIFILIIIFJIIIFIJIIIIIFIFIJPLIFIIIIIIUYTTTg ",
+" dTTUULUUIILIAPIAJJIFIFIFIJIIJFIIAFPIAFFAJIIIIJIIILIIIIIIIIIIIIIUIIIUIUIIULIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIFIIJIIPFFIFIFIJIAIFIJLJJIIPIIKKPIIIIIUIIUYYTTd ",
+" fTTUUUULIIIIAAFPFLJAAPFIFFJAIJFAAIIAIIPFIIFIJIIIFILFIIIIIIIIIIIIIIIIIIIIIIIUILUUIIIIUIIIIIIIIIIIILIIIIIIIIIJIIFIIFPIFFPIIJIIIIFKJAPAAFIAAFAAAAAAFIFIFIIUIUTTTd ",
+" dTYYUIIIIIFJJAJFAAFAAAAAAAAAFPAAAAFFAFPPPAFFIIJFIIIIFIIIIIIIIJIIIIIIIAvccvczcvxccvcccvcvvFIIIIIIIIIJIJIFIIIIIJIJIALIAAIIFPFAAAFAAAFAAAAAFPAAAAAAFAJIIIILIUUUTd ",
+" wYYUIUIILIJIJAAPAAPAAAAAAAAAAAAAAAAJAPFAFFPPFJLFIJIIJJIFIJJIFIJFvzvcxgO....X............OgvcccNFIJJIIIJIIJJJFIJIAJAAAJFAJAAAAAPAAAAAAAAAAAAAAAAAJALJFIFLUIUUTd ",
+" wTYIIIIIIIFFJFAAAAAAAAAAAAAAAAAAAAAAPPAIFPAAJIJJIIJJIIJIIIAvzvcgO....OgvcvcvcvxcvccvcccvgO....OgcccvFIIFIIIIFJIJIIFFILJJKPAAAAAAAAAAAAAAAAAAAAAAAAJLAIIIIUUTTd ",
+" wYTYUUIIFFIJFIAAAAAAAAAAAAAAAAAAAAPFAFJALJJPIFIIJIFIIFAmzzgO...OgvcvcvAIIIIFLIILIIILIIIIFvvcccg@...OgccmFIFIIIJIFPIIJJAPFFAAAAAAAAAAAAAAAAAAAAAAAAAJIJILIIUUTd ",
+" -YYUUUIIFJLAAAAAAAAHAAAAAAAAAAAAAAAFPAJJFIJIFIFJIIJAvvgO..OgvcvvAIIPIPIPYLLIILIILLILULLPLYIIPIKvvcvgO..OgvvAIFPIPAJIAIAAFFPAIAAAAAAAAAAAAAAAAAAAAAAIJJILILUUTd ",
+" 8YULUIIIIIJAAAAAAAAAAAAAAAAAAAAPFFPJFIFILAIJIIIIJvcgO.OgccvAIPPIIPIIIIILLLLILLLLILLILLIPLLLILPIIJPIJvcvgO.OgvvAFIIIJIAIPIAAJFAPIJAAAAAAAAAAAAAAAAAIFFIIIIUUTTd ",
+" dTUUUUIIIAAAAAAAAAAAAAAAAAAAAAAPAFAIALIIJIPJJJAvgO.OgvvAPIIPPPIIIIIPIKILYLLLLLLIULUIIIIYLYLIIIIIIIPPIPIAvvfO.OgvAJIIFIJJJIIAAFPAFAAAAAAAAAAAAAAAAAFJIIIIIIUUTd ",
+" dUTULIIIIIFAAAAAAAAAAAAAAAAAAAAFAPPJIJJAIIFAvvgOOgcvAIPIIIPIIPYIIPIIIIILYLLYLIYILLLLLIIPLLPPIPIIIIPIIIIIPPAvcgOOgcvAJIJLJFIIIFAPFAPAAAAAAAAAAAAAAAIFJFILUUUUTd ",
+" -TYUIIIIIFIPAAAAAAAAAZAAAPFAAAAAAJIIIJJIJAvgO.OgvAIIPIIIIPIPPYPLYPPPYLPLLYYLYLLLLLLULYLLPPPPPPPPIPPPPPIPIIPIIPvgO.OgvAJIJIAAIAAPAFFFAAAAAAAAAAAAAAAJIIJIIUUUTd ",
+" -YYUIUIIJIAAAAAAAAAAAAAAAAAAAAKLAIFFFIIAvgOOgcvJIPIIIPIPPIPPPPPPPPYPPLYLLLLLLLYLLTLLLYLLYYLPPYPIPPUPUIPPIPIPIPIAvcgOOkvAIJIIAAIFPPAPPFAAAAAAAAAAAAAJFIIIIIUUTd ",
+" -YYUIUIIFAAAAAAAAAAAAAAAAFPPFKKJIIFIIAvgOOgvAIPPIIPIPPPPPPIPPPPPYPPPPPPLYLLLTLLTLLTLYLLLPLYPPPPPYPPPPPUIPIPPPPPIIIAvgOOgvAFJJIAPFIFAFPAAAAAAAAHAAAAIILIILUUTTd ",
+" 8YYUUIIIIIAAAAAAAAAAAAAFAAPFJJLIFPPJAkOOgvAIIIIIIPIPIPPUIPPYPPPPPPPYPLYLTLTLLLLLLLLYLLYYPPPPYYPPPPPPPPPPIPIPPPYIIIIIAvgOOjAILIJIFPJAPFPAAAAAZAAAAAAFIFLIULUUTd ",
+" dYYUUIIIIFJLAAAAAAAAAPFPAFJIPAIFPIAvg%gvAIIPPPYPIPUPPPPPPPYPPPPPPPPDDDBDKHHAHAGMGAHHHHHDDDDDLPPYPPPPPYPPPYPPYPPPIIJIIPJvg%gvAIJJIAIAAJFPFFAAAAAAAAAAFIIIUIUUUd ",
+" dYYUIUIIJIAAAAAAAAAAAAAPFAPFIJAJAvgOOjAIPIPPPPPPPPPPPYPYPPPPPPAKKLBa0p0piyuuuutetuuutsu8000pBKDAPPPPPPPPPPPPPPYIPIPPPIIIAlOOgvAIFIAAIAAAAPAAAAAAAAAJIPIIIUUUUd ",
+" -TYULIIILIAJAAAAAAAFPPAFAJIIJILAkOOgvAJPIPIPPPPIPPPPPPPPPPAPABb77p022224errrrrrrrrrrrre422210777bZAKIPPPPPPPPPPPPPIPIPIPFAvgOOjAPIFLIFAJFFPAAAAAAAAAIFILUIUUTd ",
+" -UYUUUIIIJKFJAAAAAPFAAAIPIFFJAvg%gvAIPPPPIPIPPYPPUPPYPPAAZpp971122222224errrrrrrrrrrrre422222111177bCPPPPPPPPPPPPIPIPPPIPPIAvg%gvAJJJIIPIJAAAAAAAAAAAIIILUUUUd ",
+" -UUUIULIIFAAAAAAAAAFPAIPIJJIAkOOgAIPPPPIPIPPPPPPPPPPPPCp775<111111122224errrrrrrrrrrrre42212221<1165777pZAPPPPPUPYPPPPPPIPPIIAgOOjAJAIFFIAAJFPPAAAAAIJIIIUUUTd ",
+" 8YTULIIIJIAAAAAAAAAAAIFFFIIAg%gvAPIIIPPPIPPPPPPYPPAPZb7555155<5122212224errrrrrurrrrrre5222211266<<111117pBAAPPPPPPPPPYIPIIPIPAvg%jAIPAIJLJALAFAAAIIALILUIUTTd ",
+" dTUUIIIIIFPJAAAAIFPAPJAIAAvg%kAIPPIPIPUPPPUPPPYPPZb77551<5<1<1<1<1227pp8uuuyyysMsyuuuyu87701221<651<11111179pZAPPPPYPPPPPIPPIPIJAk%gvAIIFJIJJPFAJFJJJJIIIUUUTd ",
+" dUUUUIUIIIIFAPFJFJAIFIIAAkOOgAIIJIPIPPPPPPPYPPFCb7511155<1115550777pBBDDHHHHHHHKDHHHHHHDDDBp77p75<151111111157bAPPPPPPIPPPPIIJPPIAjOOgAJPIFIFAPFALFILJILIIUUTd ",
+" -TYULIIILIJFFJJFPFFIJAAAk%gvAPPJPIPPYPPPPPPPJZb755<5<111<11797pBKDKLPPPYLLYLLLLTLLYLYLPPPPLKDDHBp777655111<11157pZAPPPPPPPPYPPPIPIAvg%kAAJJFIAAAJAAIAIIIUUUUYd ",
+" -YYUUIIIIFIJIFJAPIPAIPAg*kAIPPIIIPIPPPPYPPKDb755<<5551<577pZKADPPPPLPPLLLLLLYLLLLLLLLLPLPPPPPPPPAAKCn775511113<<57pBAPPPYPPPPPPPPPIJAl%kAJIPIIAALIFAIFIILIUUTd ",
+" -YYULUIIILILAIFFIAIIAAk%jAPPIPIIPPPPPPPPKCb71115111<557nCADPPPPPPPPPPPPLLLLLLLLLLLLLLPLLPLPPPPPPPPPPAABp7551111131179BAPPPPPPPPIIIPPIAg*kAFAFAIJFPIAIIIIUULYYd ",
+" 8YYUUIIILIFJIJIJAIAAvf*jAJPIPIPPPIPYPPPHb051111<11577pZLPPPPPPPPPPPPLPKPLLLLLLLLLLLLLLLLPPPPPPPPPPPPPPPKCpp75111<11117pAPPPPYPPPPPPIPJAk&gvAIJAIJAJAIIIILUUYTd ",
+" dYYUIIIIJIJJIJIJIFAkOOgAPPIPIIPPPPPPPAZp1111111557pZKKPPPPPPPHPPPPPPKPPLLPLKKKLLLLLKKPLLLPLPPPPPPPPPPPPPPPHSa7411111111pZAPPPPPPPPPPIPPAkOOgAAIIFAIIIIIIUIUTTd ",
+" dYYUUUIIIILIFLAJAAk%gvAIJIPIPPPPPPPPAb7511111117pZDPPPPPPPPPPPPPPPPKPKKLLLLKKKLLLLLKKKKLPLPKPKPPHPPPPPPPYPPPFCb7111111157pZPYPPYPPPIPPPPAvg%hAJPIJAIJIIIUUYYTd ",
+" -TYUIIIIIJIIFJIAAk%kAIPIPJIPPPPYYPACb511111117pDHPPPPPPPPPPPPPPPKKKPKKPKKKKKKDKKKDLKKKKKPKKKPKHPPPPPPPPPPPPPPPKZp7111111<5pCPPPPPPUPPPPPIPAh&kAFIIIIFIIIIIYYTd ",
+" -UYUUULIIIIJPIFAk%gAPIJPIIPPPPIPPHb0611111119ZAPPPPPPHPPPPPPPPPPKKKKKKKKKKKKKKADKKLKKKKKKKKKPKKAPPPPPPPPPPPPPPPPAZp11111555pAPPPPPPPPPPIJIJAg%kAPFIIIIIIYYYTTd ",
+" -TYUUUIIIIILIIFvOgAJIIPYPPPYPPPPZp55<551167bZPPPPPPPPPPPHPKPKKKPAKKKAKAKAAKKKAKKKAAKHDKKKKHKKKKAPAKPPKPKPPPPPPPPPPHb711<51157pZPPPPPYPYJPIIPAgOvPAPIIIUIUUUTTd ",
+" 8TYUUUIIIIIIFJFgOvIIPPIPPPPPPPPZp11111511aCAPPPPPPPPPPKKPAPAKAKKAKHAKAAKDHKDAAAKKAAAAKKDKAKKKAAAJAPKKKPPHPKPPPPPPPPAZb1<113115pZPPPPPPPIIPJPIvOfAIFIIIIUILUTTd ",
+" wTTLUULIIIIIJAk%jAIPJIPPPPPPPPZb511515579ZPYPPPPPPPPPPPKPKKHKKAAAAAAAAAAAAAKKAADKKAHAKAAHAAAAAAAAAAHKKKAAKPPPPPPPPPPPHb755<1111pZPPPPPPPIIPJIAg%jAPIIIILUUUTTd ",
+" dYUUUUIIIIIJAk%gAPJIPIPPPPPPPZp15111<5pZAPPPPPPPKPHHPKKAAAKKKKKAAAAAAAAAAAAHKAAKKAADAAAAAAAAAAAAAAAKAAAJPKKKPHPPPPPPPPPZp5111111pDPPPPPPPPPIIPAk%gAIIIIULUUTTd ",
+" dYTTUILUIIIFl%kAJIPPPYPPPPPAZ91111155pZPPPPPPPPPKPPAPKHAAKAAAAHAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAKDAAAAAAAAKAKPAJPAPPPPPPPPPZb1111115pBPPYPPPPIPPIPAk*kJIIUIUUUYTd ",
+" dTTUUUUIIIAl&kAPIPIPPPPPPPKb75111147bZPPPPHPPPPJPAAAKKAAAAAAADAAAAAHAAAAAHKAAAAHAAAKKAAAKAAAAKHAAAAAAAAAJKKAKAPPPPPPPPPPPZb7111<157bCPPIPPPPPPIPAl&lAIIUUUTTTd ",
+" dTTTUUUUIIvOgAPPPUPPPPPPPA91111155pHKPPPPPPPKPPAKJKAAAAAAAAAAAAAAAAAAAAAAAAHKAAKAAADKAAKDAAAAAAAAAAAAAAAAAKKAPJKPHPPPPPPPPPZp51111159ZPPPPPPYPPJPAgOVUILIUUTTf ",
+" dTTUUIUIIIjOvIJPPPPPPPPPAb5111115pZPPPPPPPPPPPHPJKJAAAAAAAAAAAAAAAAAAAAKDAAAAKDAAAKKHAAHAAAAAAAHAAAAAAAAAAHJAAAKKPPPPPPPPPPPZp1111115bPPPYPPPPPIIFvOlFUUUUTTTd ",
+" dTTTTTUUAl=lAIPPIPPPPPPPZ7111115pAPPPPPPPHPKKAAAPAAAAAAAAHAAAKKAAAAAHKAAAKADAAAAAAHZAAAAAAAAAAAAAKKAAAKAAAAAAKKKAPAKPPPPPPPPPAp5111118BPPPPPPYPIPPAl=lAUTTTTTd ",
+" dTTTTYUIl&lAIIIIPPPYPPPZp511115pZPPPPPPKPPKPKAPAHAAAAAAAKKKAAHAAAAAAADKAAHAKAAAAAAAAAAAAAAAAAAAAAADAAAKAAAAAAAKAKHPPHKPKPPPPPPZp511111pZPPPPPPPPPIIIl=xITTTTTd ",
+" dTTYYUIC$gPIIIPPIPPPPPAp511111pZPPPPPPPJPPKAAAAAAAAAAAAADAAAAAAKKACAAAKAAAAHAAAAAAAAAAAAAAAAAAKAAAHAAHDHDAAAADHAKKAAKKKKHPPPPPPZb511111bZPPPPYPIPIIIPh$CUTTTTw ",
+" dTTTYYIlOVIIIIPIPPYPPAb511115pZPPPPPPPPPKKKAAAAAAAAAAAAAAAAAADAKKKKAAAKAAAAKAAAAAAAAAAAAAAAAAADAAAAAAAAAKAAAAAAAAAAAAPKPKPPPPPPPZp511115bAPPPPPPIIIUICOlITTTTf ",
+" dTTTYIx=xAUUIPYYPPYPZp5<5115pHPPPPPPPHPKKAKKAHAAAAAAAAAAHKAKHAAAHAHDKDKAKAAAADKAAAAAAAAAAAAAAAHAAAHAAAAAAAAAAAAAAAAAAAKKPPKPPPPPPKp511155pSPPYPIIUPIUPx=xITTTf ",
+" fTTTYC$kPIIPIPPPPPPAp511515pAPPPPPPPPKPKAKHAAKAAAAAAAAAAAAAAAAAKDAAKKHAADAAAAAAAAAAAAAAAAAAAAAAAAKDAAAAAAAAAAAAAAAAAAKAHKKPPPPPPPPAp511555pLPPPPPPIIUIIx$CTTTg ",
+" dTTTUl$VUIYPIPPPPPPp515555pCIPPPPPKKPKPAAAAAAAAAAAAAAAHAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAHDAAAAAAAKKAAKDAAAAAAAKAAAAAAHKKKHKPPPPPPPPZp5555<7ZPIPPPIUUIUIC$xUTTf ",
+" dTTTC$lPIYIPYYPPYIS7151557ZPPPPPPPPHKAAAAAAAAAAAAAAAAADAKDAAAAKKAAAAAAAAAAKHAAAAAAAAAAAAAAAAAAAAAAAAAKHAAAAAAAKAAAAAAAAKKPPHPPPPPPPPZ75<555pDPYPYPPIIUUIj%CTTd ",
+" dTTTC$gCIUIPPIPYPA9535131bJPYPPPPPPPAAAAAAAAAAAAKKAAAAAAAAAAAADAAAAAAAAAHAAAKKAAAAAAAAAAAAAAAAAAAAAAAHKDHKAAADHKZAAAAAAKKKKKAPPPPPPPJb413115aSIYPPYPUPPCh%CTTd ",
+" dTTTIc$OlVPYPYPPPn535355nZPPPPPPHKKJAAAAAAAAAAAHDAAAKAAAAHAKHAAAAAAAAAAKKAAAHAAAAAAAAAAAAAAAAAAHAAAAAKDAAKAAAAAAAAAAAAAAAKHKPPAPPPPPPZb613336nFYYPPYPCl$$xITTg ",
+" dTTYYIVl#OlVPPIIS0133159AIPPPPPPKPKAAAAAAAAKAAAAAAADKAAAADKAAAAAAAAAAAAAAAAAAAAJAAAAAAADAAAAAAADAAAAAAAAAAAAAAAAAAAHAAAAAAKKHAPJPPPPPPAb113330SPPPPVx##jCITTTf ",
+" fTTYYYUIClO#kPPSn333330ZPYPPPPPHPKAAAAAAAAAZAAAAAAAHAAAAAAKAAAAAAAAAAAAAAADAAAAFAAPAAAAAAAHAAAAKKAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAPPPPPYPPS033333qZPPxOOkVIYTTTTd ",
+" dTTTTIUUIPVh=kx9333333nAPPPPPJIPKAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAJFJAAAKAAJLFAAAKAAAAAAAAAAAAAAAAKKAAAAAAAAAAAAAAAAAAKAAPPPPPPPPYJn6333339vk=kVPUUUYYTTf ",
+" dTTTYUUYIIIPl#o;,<333nSPUYPPPPPPKPAAAAAAAAAAAAAHAAAAAAAAAAKAAAKAAAAAJJLPPFLKAAKKAAJAAIJAKAAAAAAAKHAAAKHHAAAAAAAAAAAAAAAAAAAKPAAJPJIPPPPISn611<>;o#kPIUIIUYYTTd ",
+" dTTYYUUIIIPIPNgoX:<30SIPPYPPPPPKPAAPAAAAAAAAAAADAAAHKAAAAHKAKADAAAAPFFAFPAJAAKAIAAAIAAAAAKAKAAAADAAAAADDAAAAAAAAAAAAAAAAAAAAAAPJPPPPYPUUPS01<;XogVPYIIUUUTTTTd ",
+" dTTTYUIUIIYPIPKVg@;,9FIPPPPPPIPJKAAAAAAAAAAAAAAKKAADKAAAAKDAHAAAAAAFAPPFAPFIALKFIJPIFAAPKAKAAKKAKAAAAAKAAAAAAHAAAAAAAAAAAAJKAAAJPPPPPPPPIF9,;+gNPPPPIUIUTTTTTd ",
+" -TTUUULIIIIIPIIPPhOofvPIPPIPIJPJAPFPFFAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAFPIFIIJLIFIIFIJIFIIALJAAJFPAFJAAAAAAAAAAAAAAAAAAAAAAAPAFFPAAIPIPIPIIPVfookAPIIIIIIIIUUUTTd ",
+" 8TTUUIUIIIIIIPIPPKVk#OkVJIPJILIIIAAAAPAAAAAAAAAAAAAAAAAAAAAALJPAAAAAPJJFIIFJJFIIFIAIIFIIAIJAAPFAPFAAAAAAAAAAAAAAAAAAAAAJAAIPAAIIAJIIPPJVkOOhVPPPPPIIIUIUIUUTTd ",
+" wTTUUUIIIIIPIPJIPPIHNgOOkJPIIPAJIIPFPAPAAAAAAAAAAAAAAAAAAAAAAAAIFJIFIIJILJJLIIIJIIIIJLJJAFIIIAPFFIAAAAAAAAAAAAAAAAAAAAPALAFFPIAJIPIPIAkO#kVAIPIIPIIIIIILUULTTd ",
+" wTTULIUUIIIJPLPPIIPPPPvk=gvAIIJIFFIJAIFAJAAAAAAAAAAAAAAAAAPFJAAJJLJPIFJPJIIJJIIIIJJAIIJIIAIFIJFPJAPAAAAAAAAAAAAAAAAAFAFKJJJIFIJIIJIAvg*hNHPPPIPPIPPIIIIULUUTTd ",
+" dYYUIIIIIIPKJPILPIPIPIIKkOOgvAIPIFIJIAJAAFPPFJAAAAAAAAAAAAAAPAIIFIPFIIIIJAvvxvxvxccvvAPIJFIJIIPIJAAKAJAAAAAAAAAAZALAJPAPFIAPPFIIJAvhOOkHPIPPFIIPIJPIIIIUIUUTTd ",
+" dYYUUUIIIIJIJFPPFPIPIJIPAvgOOlAIJFPIFLJIAJAFAPFAAAAAPAAAAPFAAFIPIFJPIAvvcgO.........ogvvvAIIJFIFLJAFPAIAAAAAAAAAJAAJAFALJAIFIJIIAjOOgvALPIPPIJLJJLIPIIIIIUUTTd ",
+" dYYUIIIIPIAFIFPKAAIIAKIFPPAvg%gvAIIJIIFFIIAFPAPAAAAJFAPALAJFIIJFAJIAvgO..OjccccccxvvgO..OgvAFIJIIIPFAAFFPPFAAPAAAPALFIIJIIAPPIAvg%gvAIFKPLIIIPPFPPFIFPIUIUUUTd ",
+" dYYUUIIIIIFPKJJPIJAPFPPIAPPIAgOOfvAIAPIIJJLAPFFAAAAAPFFJJFIPIFAIAvvgoOgccvFJIIJIJIJJAvccgOOgxvAIFFPIIAPPFAAPFFAAJAAJJIJIFJIFAvfOOgAIPIJPLIJAJAAPFAJIPIIIIIUUTd ",
+" -YYUUIIIAJLAJAAAAFPPIAIPFIIJIAvgOOgvAFIFPFFIJPAAAAAAAFPAJIPFPAIAjO.OgvAJIIFIJIIIIAFIIIIIAvgO.OjAPPIJIFAAFPFAFPAAPJAIFFIPFIAvgOOgvAIILIPFIFIAAAAJKAIIPJIIIUUUTd ",
+" -YYUIUIIIIAAAAAPFAAFJKAIFPAIFJIAvgOOjAIPIIPAIFPIFPAFPIJIFFIAIAvg%gxvAIFIJIIIIIFIIIIFPFIIIFAvcg%fvAAIFIPJIFPAPAIFFIIPIIJPIAlOogvAIJJIFFIIJPJAAAAAJAAFIIIIIUIUTd ",
+" -TYULIIIIIPFAAAAAAAFJAJJIFIPPFIPFAvg*fvAFIJIAJIIAJILAFIIIJJFAkOOgAAIPIIIIJJIFIJPFJPIIJIAIIIIIAgOOgAFIIJAIIPPFJAIPIAFPJIAvg%gvAKJJIFJIPJJKAAAAAAAAAAIJIIIIIUTTd ",
+" -UYUUUIIIFFPAAAAAAAPAALAAIJFIIAAPIIAhOOgvAKAIIFAIIFJIAIFIJAAk%gvAIIIFJIJIFIIIJLIFIFPFIAJAJIJLAAvg&gAIJFIJIFIFIIIFIFJIAvgoOjAIFPLAIIIFAAPALJAAAAAAAAFLJJILUUUTd ",
+" -UUUIULIIIJAAAAAAAAAAAAFPAAJIPFIJAIKAvfOOhALAIJIAAIJFIPIJIAk%kALIJLFIPAIJPIFJIFIPFIAIFIIIAJAJIIIAg%kAJIJFFIIAIAIIIILAgOogvAIJIFIAJJJAFAFPAAAAAAAAAAAIILIIUUUUd ",
+" 8YTULIIIFAAAAAAAAAAAAAAAAFPPFAPFAIJKIPAvf*gvAIIFIIIIIIFIFAj%gAIJJIJPIFIJIFFPAAIFAPAAAIJFIFIIAFIIFAj%kAJIIIJIIIFPFAAvg%gvAIIJLPIIIJLJLJAAAAAAAAAAAAAFJJILUIUUTd ",
+" dTUUUIIIPFAAAAAAAAAAAAAAAPFAFJKIPJLIFPAIAjOOgvAIIFIPIIIJAk%kAPFIJFIIFIPAFFPAAAAFPIAAIFPPFIPIIJLJIJAk%kAIIILJFIPAAvgOOgAIPAJJIFIJFLJFIAAAAAAAAAAAAAAPPFIIIUUTTd ",
+" dUUIUIUIIIAAAAAAAAAAAAAAAAAAPKAAAIFPPIFIFAvgOOgvAIIJIFIAk%kAJIFFIFIJAAFAPALJAAIAAAAAAAPFAAAFIJAIALJAj%kAAJIIIIAvgOOgvAIIFIAIFPAJAAKAJAAAAAAAAAAAAAAFIIIIIIUUTd ",
+" -TYULUIILIJFFIFAAAAAAAAAAAAAAAJFFPAFIPLJIIJAvgOOlAIIIFAg%kAIFIPIPIJAAAAAAAAAAAAAAAAAAAAAJALAJAIJIJLFAk%jAIIIJAkOOgvAFIALJAFPIAAAAAJAAAAAAAAAAAAAAAJFILIIIIYYTd ",
+" -YYUILIIIJFJJAJAAAAAAAAAAAAAAAAPAPFAIAJIFLJFIAvg%gvAFAj*lAAAIPFFAFAAIIAAAAAAAAAAAAAAAAAAAKJIFIAIFIAIJAj%kAJFmg%gvAIIIJIFIIIAJPFAAAAAAAAAAAAAAAAAAAFJFIJIIUITTd ",
+" -YYIUIIIIFIAAAAAAAAAAAAAAAAAAAAAAFJFPAIIPIIIJIIFlOogvvOgAJFIAIJPAFPAAAAAAAAAAAAAAAAAAAAAAAAAAIAALJIJIJAgOcvgOOjAFIJPJFAIIAAPFAFAAAAAAAAAAAAAAAAAAAAIJIIIUUUYTd ",
+" 8YYUUUIILIFIAAAAAAAAAAAAAAAAAAAAAAIJAAIAFAJFIFIJAvgOO-OvJPIJIFLFPPFAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAIIFJLvO-oOgvFIIIJFPIIJAAAFAAPAAAAAAAAAAAAAAAAAAAPFIJLLIIUYTd ",
+" dYYUUUIIIIAAAAAAAAAAAAAAZAAAAAAAAAAAAJFAPAIIJIFIIIAvg%lAFPFIPAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJJJAFIIAIIAk%gvJJIIFIPFIFPFAAPPAAAAAAAAAAAAAAAAAAAAAAAIJIIIIUUTTd ",
+" dYYUIIIIIAIAAAAAAAAAAAAAAAAAAAAAAAAAAAPFFAPPAIIJFJIIFmFAIIFFAPFFAAAAAAAAAAAAAAAAAAAAAAAAAAAAIFFFPPJAIAJFAvAIJJIPIFIPAAIPPFAAAAAAAAAAAAAAAAAAAAAAAAAFIIJIULUTTd ",
+" dUYUULIIFJFAAAAPAAAAAAAAAAAAAAAAAAPAAJFPFAFAIAPJIJJFIIIIIFAPAJAPAPAAAAAAAAAAAAAAAAAAAAAAAAAAAJJLJAFAJIFIFJJFIFIFIAJAAAJFPFJAAAAAAAAAAJAAAAAAAAAAAAAFIILIIUUTTd ",
+" wYYUIULIIIJLAAAFJAAAAIFAAAJAAAAAJAFAALAAPAIJAIFIJIJIIFIAJIPFIFPFAFAAAAAPFAAAAPFAAJAAAAAAIFJAAFIAAAIIFIIJIIIIIIIIAIAFIPFFAPFAAAAPFAPFAFIAAAAAAAAJALAIFIIIILUTTd ",
+" dTTYUIIIIJIFAFPJIFJJIFIAPAIJFJFFFIJIJIIIFIAIIIFIIIIIIIIIIIJJIIIIIPAFIFAAAAFFIFAAFIFIFJJIIFJFIFJJIPFIFIIIFIIFIIFIFIFIFFLIPFIJLAAFJIIJJFJFFJJJFIFFPAJILIIIUUYYTd ",
+" fTTYUUUUIILIIIJFIJIJFJIJFIFIIIIIIJFFIFFJIJIIAIIFLLFIFFIIIFIIFIFPFIJIFIIJIPIJIIPJJPIFIIJFJJIIIIJIFIFIPJPIIIIIIIIIIIIIIILIFPIIAIJIIFJFIIJIIIFIIFIIJPFIIIIIUUUTTd ",
+" dTTYUUUUUIIIIIFIIIFIIJFIIIIIJIFIIIIIILIIIFIIFPIIIIIIIIIIIIIIFLIIIIFIIFIFPIFIFFIJLJIFILIIIIILFILIIJIIIIIIIIIIIIIIIIIIFLIIJIFIFIJIFFLIIIIIJJIIJFIIIIIIIIIUUTTTTf ",
+" dTTTYTTIIIIIIIIFIILIIIIJLIFIIIIJIJIIIILIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIILIIIIIIILIIJILIILJIFIIIILIIIIIJIIIFILIIFIIIIIIIIIIIIIIIIIIIILIJIFIIIIIILIFIIIIIIUTTTTTTd ",
+" dTTTTTTUILUIIIILLILIILLIIIILLIIIIIILIIIIIIIIIIIIIUIIILLIIIIIIUIIIIIIIIIIIIIIIIIIILLIIIIIILLIIIUIIIIIIIIIULIIIIIIIIILIIIUIILIIIILIIIILILIIIILLLLIILLUIIUTTTTTTf ",
+" dTTTTTTUUULIIIUUIIUIIIUIUIIUIIIIUIIUIIUUIULUIIULUIIIUIUIIIUILIIUIIIIUIIUIIIUILUUIUIIIILUIUIIIILUIULIIIUILIUUIUIIUUIUIUIIIIUUIIIILUIIUIIIIUIUIUIUIIUUUUUTTTTTTd ",
+" fTTTTTTTUUUUUUILUIUUUULUIUIULULUIUIULULULIUIUUIULUUUUUIUIUIIUIUIIUUULULIIUUUUILIIUIUUIUIUIIUIIUULLUIUUULUUIUIIUUIIUULULUIULUIUIUUUIUIIUIIIUUIULUILUUUUUTTTTTTg ",
+" gTTTTTTTTUUUIUUUUUUIUIUUUUUUIUUUUUUUIUUUUUUUIUUULULUUIUUUUUUUUUUUUIUUUUUUUIUIUUUUUUUIUUUUUUUUUUUUUUUUIUUUUUUUUUIUIUIUUUUUIUUUUULUUUUUUUUUUUIUUUUUUUUTTTTTTTTTf ",
+" fTTTTTTTTTTTTYTYYTYUYYUYYUYYYYYUYYUYYUYYTUTYYYYYYYYYYYYUYYUYYUYTYYUYYYUTYYUYYYUTYYUYYYUTYYUYYYUUUYYYYYYYYYUYYUYYYYYUYYUYYUYYTUYUYYUYYUYYTUYUYYUYTTTTTTTTTTTTTg ",
+" gTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTUTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTg ",
+" Oggfggffdddfddddddddddddddddddddddddddddwd8dddddddddddddddddddddddddddddddddddddddddddddddddddd8wddddddddddddddddddddddddddddddddddddddddddddddddddddfgfdgflgO ",
+" "
+};
diff --git a/src/lingot-complex.c b/src/lingot-complex.c
new file mode 100644
index 0000000..6bee5ef
--- /dev/null
+++ b/src/lingot-complex.c
@@ -0,0 +1,71 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "lingot-complex.h"
+
+/**
+ * addition. All parameters are overlapables.
+ */
+void lingot_complex_add(LingotComplex* a, LingotComplex* b, LingotComplex* c) {
+ c->r = a->r + b->r;
+ c->i = a->i + b->i;
+}
+
+/**
+ * substraction. All parameters are overlapables.
+ */
+void lingot_complex_sub(LingotComplex* a, LingotComplex* b, LingotComplex* c) {
+ c->r = a->r - b->r;
+ c->i = a->i - b->i;
+}
+
+/**
+ * multiplication. All parameters are overlapables.
+ */
+void lingot_complex_mul(LingotComplex* a, LingotComplex* b, LingotComplex* c) {
+ if ((c != a) && (c != b)) {
+ c->r = a->r * b->r - a->i * b->i;
+ c->i = a->i * b->r + a->r * b->i;
+ } else {
+ LingotComplex r;
+ r.r = a->r * b->r - a->i * b->i;
+ r.i = a->i * b->r + a->r * b->i;
+ *c = r;
+ }
+}
+
+/**
+ * division. All parameters are overlapables.
+ */
+void lingot_complex_div(LingotComplex* a, LingotComplex* b, LingotComplex* c) {
+ FLT bm2 = b->r * b->r + b->i * b->i;
+
+ if ((c != a) && (c != b)) {
+ c->r = (a->r * b->r + a->i * b->i) / bm2;
+ c->i = (a->i * b->r - a->r * b->i) / bm2;
+ } else {
+ LingotComplex r;
+ r.r = (a->r * b->r + a->i * b->i) / bm2;
+ r.i = (a->i * b->r - a->r * b->i) / bm2;
+ *c = r;
+ }
+}
diff --git a/src/lingot-complex.h b/src/lingot-complex.h
new file mode 100644
index 0000000..1fc78cc
--- /dev/null
+++ b/src/lingot-complex.h
@@ -0,0 +1,44 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _LINGOT_COMPLEX_H_
+#define _LINGOT_COMPLEX_H_
+
+#include <math.h>
+#include "lingot-defs.h"
+
+// single complex arithmetic :)
+
+typedef struct _LingotComplex LingotComplex;
+
+struct _LingotComplex
+ {
+ FLT r;
+ FLT i;
+ };
+
+void lingot_complex_add(LingotComplex* a, LingotComplex* b, LingotComplex* c);
+void lingot_complex_sub(LingotComplex* a, LingotComplex* b, LingotComplex* c);
+void lingot_complex_mul(LingotComplex* a, LingotComplex* b, LingotComplex* c);
+void lingot_complex_div(LingotComplex* a, LingotComplex* b, LingotComplex* c);
+
+#endif
diff --git a/src/lingot-config-scale.c b/src/lingot-config-scale.c
new file mode 100644
index 0000000..17f0415
--- /dev/null
+++ b/src/lingot-config-scale.c
@@ -0,0 +1,255 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+
+#include "lingot-config-scale.h"
+
+LingotScale* lingot_config_scale_new() {
+
+ LingotScale* scale = malloc(sizeof(LingotScale));
+
+ scale->name = NULL;
+ scale->notes = 0;
+ scale->note_name = NULL;
+ scale->offset_cents = NULL;
+ scale->offset_ratios[0] = NULL;
+ scale->offset_ratios[1] = NULL;
+ scale->base_frequency = 0.0;
+
+ return scale;
+}
+
+void lingot_config_scale_allocate(LingotScale* scale, unsigned short int notes) {
+ scale->notes = notes;
+ scale->note_name = malloc(notes * sizeof(char*));
+ scale->offset_cents = malloc(notes * sizeof(FLT));
+ scale->offset_ratios[0] = malloc(notes * sizeof(short int));
+ scale->offset_ratios[1] = malloc(notes * sizeof(short int));
+}
+
+void lingot_config_scale_destroy(LingotScale* scale) {
+ unsigned short int i;
+ for (i = 0; i < scale->notes; i++) {
+ free(scale->note_name[i]);
+ }
+
+ if (scale->offset_cents != NULL)
+ free(scale->offset_cents);
+
+ if (scale->offset_ratios[0] != NULL)
+ free(scale->offset_ratios[0]);
+ if (scale->offset_ratios[1] != NULL)
+ free(scale->offset_ratios[1]);
+
+ if (scale->note_name != NULL)
+ free(scale->note_name);
+ if (scale->name != NULL)
+ free(scale->name);
+
+ scale->name = NULL;
+ scale->notes = 0;
+ scale->note_name = NULL;
+ scale->offset_cents = NULL;
+ scale->offset_ratios[0] = NULL;
+ scale->offset_ratios[1] = NULL;
+ scale->base_frequency = 0.0;
+}
+
+void lingot_config_scale_restore_default_values(LingotScale* scale) {
+
+ unsigned short int i;
+ static char* tone_string[] = { "C", "C#", "D", "D#", "E", "F", "F#", "G",
+ "G#", "A", "A#", "B", };
+
+ lingot_config_scale_destroy(scale);
+
+ // default 12 tones equal-tempered scale hard-coded
+ scale->name = strdup("Default equal-tempered scale");
+ lingot_config_scale_allocate(scale, 12);
+
+ scale->base_frequency = MID_C_FREQUENCY;
+
+ scale->note_name[0] = strdup(tone_string[0]);
+ scale->offset_cents[0] = 0.0;
+ scale->offset_ratios[0][0] = 1;
+ scale->offset_ratios[1][0] = 1; // 1/1
+
+ for (i = 1; i < scale->notes; i++) {
+ scale->note_name[i] = strdup(tone_string[i]);
+ scale->offset_cents[i] = 100.0 * i;
+ scale->offset_ratios[0][i] = -1; // not used
+ scale->offset_ratios[1][i] = -1; // not used
+ }
+}
+
+void lingot_config_scale_copy(LingotScale* dst, LingotScale* src) {
+ unsigned short int i;
+
+ lingot_config_scale_destroy(dst);
+
+ *dst = *src;
+
+ dst->name = strdup(src->name);
+ lingot_config_scale_allocate(dst, dst->notes);
+
+ for (i = 0; i < dst->notes; i++) {
+ dst->note_name[i] = strdup(src->note_name[i]);
+ dst->offset_cents[i] = src->offset_cents[i];
+ dst->offset_ratios[0][i] = src->offset_ratios[0][i];
+ dst->offset_ratios[1][i] = src->offset_ratios[1][i];
+ }
+}
+
+int lingot_config_scale_parse_shift(char* char_buffer, double* cents,
+ short int* numerator, short int* denominator) {
+ const static char* delim = "/";
+ char* char_buffer_pointer1 = strtok(char_buffer, delim);
+ char* char_buffer_pointer2 = strtok(NULL, delim);
+ short int num, den;
+ int result = 1;
+
+ if (numerator != NULL) {
+ *numerator = -1;
+ }
+
+ if (denominator != NULL) {
+ *denominator = -1;
+ }
+
+ int n = 0;
+ if (!char_buffer_pointer2) {
+ n = sscanf(char_buffer_pointer1, "%lf", cents);
+ if (!n) {
+ result = 0;
+ }
+ } else {
+ n = sscanf(char_buffer_pointer1, "%hd", &num);
+ if (!n) {
+ result = 0;
+ } else {
+ n = sscanf(char_buffer_pointer2, "%hd", &den);
+ if (!n) {
+ result = 0;
+ } else {
+ *cents = 1200.0 * log2(1.0 * num / den);
+ if (numerator != NULL) {
+ *numerator = num;
+ }
+ if (denominator != NULL) {
+ *denominator = den;
+ }
+ }
+ }
+ }
+
+ if (!result) {
+ *numerator = 1;
+ *denominator = 1;
+ *cents = 0.0;
+ }
+
+ return result;
+}
+
+void lingot_config_scale_format_shift(char* char_buffer, double cents,
+ short int numerator, short int denominator) {
+ if (numerator < 0) {
+ sprintf(char_buffer, "%0.4lf", cents);
+ } else {
+ sprintf(char_buffer, "%hd/%hd", numerator, denominator);
+ }
+}
+
+int lingot_config_scale_load_scl(LingotScale* scale, char* filename) {
+ FILE* fp;
+ int i;
+ char* char_buffer_pointer1;
+ char* nl;
+ const static char* delim = " \t\n";
+ int result = 1;
+
+# define MAX_LINE_SIZE 1000
+
+ char char_buffer[MAX_LINE_SIZE];
+
+ if ((fp = fopen(filename, "r")) == NULL) {
+ sprintf(char_buffer, "error opening scale file %s", filename);
+ perror(char_buffer);
+ return 0;
+ }
+
+ scale->base_frequency = MID_C_FREQUENCY;
+
+ fgets(char_buffer, MAX_LINE_SIZE, fp);
+ if (strchr(char_buffer, '!') != char_buffer) {
+ fclose(fp);
+ return 0;
+ }
+
+ fgets(char_buffer, MAX_LINE_SIZE, fp);
+ fgets(char_buffer, MAX_LINE_SIZE, fp);
+
+ nl = strrchr(char_buffer, '\r');
+ if (nl)
+ *nl = '\0';
+ nl = strrchr(char_buffer, '\n');
+ if (nl)
+ *nl = '\0';
+ scale->name = strdup(char_buffer);
+
+ fgets(char_buffer, MAX_LINE_SIZE, fp);
+ sscanf(char_buffer, "%hu", &scale->notes);
+
+ fgets(char_buffer, MAX_LINE_SIZE, fp);
+ lingot_config_scale_allocate(scale, scale->notes);
+
+ scale->note_name[0] = strdup("1");
+ scale->offset_cents[0] = 0.0;
+ scale->offset_ratios[0][0] = 1;
+ scale->offset_ratios[1][0] = 1; // 1/1
+
+ for (i = 1; i < scale->notes; i++) {
+
+ fgets(char_buffer, MAX_LINE_SIZE, fp);
+
+ char_buffer_pointer1 = strtok(char_buffer, delim);
+
+ int r = lingot_config_scale_parse_shift(char_buffer_pointer1,
+ &scale->offset_cents[i], &scale->offset_ratios[0][i],
+ &scale->offset_ratios[1][i]);
+ if (!r) {
+ result = 0;
+ }
+
+ sprintf(char_buffer, "%d", i + 1);
+ scale->note_name[i] = strdup(char_buffer);
+ }
+
+ fclose(fp);
+
+# undef MAX_LINE_SIZE
+ return result;
+}
diff --git a/src/lingot-config-scale.h b/src/lingot-config-scale.h
new file mode 100644
index 0000000..781d02b
--- /dev/null
+++ b/src/lingot-config-scale.h
@@ -0,0 +1,52 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef LINGOT_CONFIG_SCALE_H_
+#define LINGOT_CONFIG_SCALE_H_
+
+#include "lingot-defs.h"
+
+typedef struct _LingotScale LingotScale;
+
+struct _LingotScale {
+ char* name; // name of the scale
+ unsigned short int notes; // number of notes
+ FLT* offset_cents; // offset in cents
+ short int* offset_ratios[2]; // offset in ratios (pairs of integers)
+ FLT base_frequency; // frequency of the first note
+ char** note_name; // note names
+
+ // -- internal parameters --
+
+ FLT max_offset_rounded; // round version of maximum offset in cents
+};
+
+LingotScale* lingot_config_scale_new();
+void lingot_config_scale_allocate(LingotScale* scale, unsigned short int notes);
+void lingot_config_scale_destroy(LingotScale* scale);
+int lingot_config_scale_load_scl(LingotScale* scale, char* filename);
+int lingot_config_scale_parse_shift(char*, double*, short int*, short int*);
+void lingot_config_scale_format_shift(char*, double, short int, short int);
+void lingot_config_scale_copy(LingotScale* dst, LingotScale* src);
+void lingot_config_scale_restore_default_values(LingotScale* scale);
+
+#endif /* LINGOT_CONFIG_SCALE_H_ */
diff --git a/src/lingot-config.c b/src/lingot-config.c
new file mode 100644
index 0000000..e0a1343
--- /dev/null
+++ b/src/lingot-config.c
@@ -0,0 +1,458 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include <locale.h>
+
+#include "lingot-defs.h"
+#include "lingot-config.h"
+#include "lingot-config-scale.h"
+#include "lingot-msg.h"
+#include "lingot-i18n.h"
+
+#define MAX(a, b) (((a) > (b)) ? (a) : (b))
+
+#define N_OPTIONS 20
+
+// the following tokens will appear in the config file. The options after | are deprecated options.
+char* options[] = { "AUDIO_SYSTEM", "AUDIO_DEV", "AUDIO_DEV_ALSA",
+ "SAMPLE_RATE", "OVERSAMPLING", "ROOT_FREQUENCY_ERROR", "MIN_FREQUENCY",
+ "FFT_SIZE", "TEMPORAL_WINDOW", "NOISE_THRESHOLD", "CALCULATION_RATE",
+ "VISUALIZATION_RATE", "PEAK_NUMBER", "PEAK_HALF_WIDTH",
+ "PEAK_REJECTION_RELATION", "DFT_NUMBER", "DFT_SIZE", "GAIN", "|",
+ "PEAK_ORDER", NULL // NULL terminated array
+ };
+
+// print/scan param formats.
+const char* option_formats = "mssddffdffffddfddf|d";
+
+// converts an audio_system_t to a string
+const char* audio_system_t_to_str(audio_system_t audio_system) {
+ const char* values[] = { "OSS", "ALSA", "JACK" };
+ return values[audio_system];
+}
+
+// converts a string to an audio_system_t
+audio_system_t str_to_audio_system_t(char* audio_system) {
+ audio_system_t result = -1;
+ const char* values[] = { "OSS", "ALSA", "JACK", NULL };
+ int i;
+ for (i = 0; values[i] != NULL; i++) {
+ if (!strcmp(audio_system, values[i])) {
+ result = i;
+ break;
+ }
+ }
+ return result;
+}
+
+//----------------------------------------------------------------------------
+
+LingotConfig* lingot_config_new() {
+
+ LingotConfig* config = malloc(sizeof(LingotConfig));
+
+ config->max_nr_iter = 10; // iterations
+ config->window_type = HAMMING;
+ config->scale = lingot_config_scale_new();
+ return config;
+}
+
+void lingot_config_destroy(LingotConfig* config) {
+ lingot_config_scale_destroy(config->scale);
+ free(config->scale);
+ free(config);
+}
+
+void lingot_config_copy(LingotConfig* dst, LingotConfig* src) {
+ LingotScale* dst_scale = dst->scale;
+ *dst = *src;
+ dst->scale = dst_scale;
+ lingot_config_scale_copy(dst->scale, src->scale);
+}
+
+//----------------------------------------------------------------------------
+
+void lingot_config_restore_default_values(LingotConfig* config) {
+
+ config->audio_system = AUDIO_SYSTEM_ALSA;
+ sprintf(config->audio_dev[AUDIO_SYSTEM_OSS], "%s", "/dev/dsp");
+ sprintf(config->audio_dev[AUDIO_SYSTEM_ALSA], "%s", "plughw:0");
+
+ config->sample_rate = 44100; // Hz
+ config->oversampling = 25;
+ config->root_frequency_error = 0; // Hz
+ config->min_frequency = 15; // Hz
+ config->fft_size = 512; // samples
+ config->temporal_window = 0.32; // seconds
+ config->calculation_rate = 20; // Hz
+ config->visualization_rate = 30; // Hz
+ config->noise_threshold_db = 20.0; // dB
+ config->gain = 0;
+
+ config->peak_number = 3; // peaks
+ config->peak_half_width = 1; // samples
+ config->peak_rejection_relation_db = 20; // dB
+
+ config->dft_number = 2; // DFTs
+ config->dft_size = 15; // samples
+
+ //--------------------------------------------------------------------------
+
+ lingot_config_scale_restore_default_values(config->scale);
+ lingot_config_update_internal_params(config);
+}
+
+//----------------------------------------------------------------------------
+
+void lingot_config_update_internal_params(LingotConfig* config) {
+
+ // derived parameters.
+ config->temporal_buffer_size = (unsigned int) ceil(config->temporal_window
+ * config->sample_rate / config->oversampling);
+ config->peak_rejection_relation_nu = pow(10.0,
+ config->peak_rejection_relation_db / 10.0);
+ config->noise_threshold_nu = pow(10.0, config->noise_threshold_db / 10.0);
+ config->gain_nu = pow(10.0, config->gain / 20.0);
+
+ LingotScale* scale = config->scale;
+ if (scale->notes == 1) {
+ scale->max_offset_rounded = 1200.0;
+ } else {
+ int i;
+ FLT max_offset = 0.0;
+ for (i = 1; i < scale->notes; i++) {
+ max_offset = MAX(max_offset, scale->offset_cents[i]
+ - scale->offset_cents[i - 1]);
+ }
+ scale->max_offset_rounded = max_offset;
+ }
+
+ config->gauge_rest_value = -0.45 * scale->max_offset_rounded;
+ sprintf(config->audio_dev[AUDIO_SYSTEM_JACK], "%s", "");
+}
+
+//----------------------------------------------------------------------------
+
+// internal parameters mapped to each token in the config file.
+void lingot_map_parameters(LingotConfig* config, void* params[]) {
+ void* c_params[] = { &config->audio_system,
+ &config->audio_dev[AUDIO_SYSTEM_OSS],
+ &config->audio_dev[AUDIO_SYSTEM_ALSA], &config->sample_rate,
+ &config->oversampling, &config->root_frequency_error,
+ &config->min_frequency, &config->fft_size,
+ &config->temporal_window, &config->noise_threshold_db,
+ &config->calculation_rate, &config->visualization_rate,
+ &config->peak_number, &config->peak_half_width,
+ &config->peak_rejection_relation_db, &config->dft_number,
+ &config->dft_size, &config->gain, NULL, &config->peak_half_width };
+
+ memcpy(params, c_params, N_OPTIONS * sizeof(void*));
+}
+
+void lingot_config_save(LingotConfig* config, char* filename) {
+ unsigned int i;
+ FILE* fp;
+ char* lc_all;
+ void* params[N_OPTIONS]; // parameter pointer array.
+ void* param = NULL;
+ char* option = NULL;
+ char buff[80];
+
+ lingot_map_parameters(config, params);
+
+ lc_all = setlocale(LC_ALL, NULL);
+ // duplicate the string, as the next call to setlocale will destroy it
+ if (lc_all)
+ lc_all = strdup(lc_all);
+ setlocale(LC_ALL, "C");
+
+ if ((fp = fopen(filename, "w")) == NULL) {
+ char buff[100];
+ sprintf(buff, "error saving config file %s ", filename);
+ perror(buff);
+ return;
+ }
+
+ fprintf(fp, "# Config file automatically created by lingot %s\n\n", VERSION);
+
+ for (i = 0; strcmp(options[i], "|"); i++) {
+
+ option = options[i];
+ param = params[i];
+
+ switch (option_formats[i]) {
+ case 's':
+ fprintf(fp, "%s = %s\n", option, (char*) param);
+ break;
+ case 'd':
+ fprintf(fp, "%s = %d\n", option, *((unsigned int*) param));
+ break;
+ case 'f':
+ fprintf(fp, "%s = %0.3f\n", option, *((FLT*) param));
+ break;
+ case 'm':
+ if (!strcmp("AUDIO_SYSTEM", option)) {
+ fprintf(fp, "%s = %s\n", option, audio_system_t_to_str(
+ *((audio_system_t*) param)));
+ }
+ break;
+ }
+ }
+
+ fprintf(fp, "\n");
+ fprintf(fp, "SCALE = {\n");
+ fprintf(fp, "NAME = %s\n", config->scale->name);
+ fprintf(fp, "BASE_FREQUENCY = %f\n", config->scale->base_frequency);
+ fprintf(fp, "NOTE_COUNT = %d\n", config->scale->notes);
+ fprintf(fp, "NOTES = {\n");
+
+ for (i = 0; i < config->scale->notes; i++) {
+ lingot_config_scale_format_shift(buff, config->scale->offset_cents[i],
+ config->scale->offset_ratios[0][i],
+ config->scale->offset_ratios[1][i]);
+ fprintf(fp, "%s\t%s\n", config->scale->note_name[i], buff);
+ }
+
+ fprintf(fp, "}\n"), fprintf(fp, "}\n"),
+
+ fclose(fp);
+
+ if (lc_all) {
+ setlocale(LC_ALL, lc_all);
+ free(lc_all);
+ }
+}
+
+//----------------------------------------------------------------------------
+
+void lingot_config_load(LingotConfig* config, char* filename) {
+ FILE* fp;
+ float aux;
+ int line;
+ int option_index;
+ int deprecated_option = 0;
+ char* char_buffer_pointer;
+ const static char* delim = " \t=\n";
+ const static char* delim2 = " \t\n";
+ void* params[N_OPTIONS]; // parameter pointer array.
+ void* param = NULL;
+ char* option = NULL;
+ int reading_scale = 0;
+ char* nl;
+ int parse_errors = 0;
+ int command_count = 0;
+
+ // restore default values for non specified parameters
+ lingot_config_restore_default_values(config);
+
+ lingot_map_parameters(config, params);
+
+# define MAX_LINE_SIZE 100
+
+ char char_buffer[MAX_LINE_SIZE];
+
+ if ((fp = fopen(filename, "r")) == NULL) {
+ sprintf(char_buffer,
+ "error opening config file %s, assuming default values ",
+ filename);
+ perror(char_buffer);
+ return;
+ }
+
+ line = 0;
+
+ for (;;) {
+
+ line++;
+
+ if (!fgets(char_buffer, MAX_LINE_SIZE, fp))
+ break;;
+
+ if (char_buffer[0] == '#')
+ continue;
+
+ // tokens into the line.
+ char_buffer_pointer = strtok(char_buffer, delim);
+
+ if (!char_buffer_pointer)
+ continue; // blank line.
+
+
+ if (!strcmp(char_buffer_pointer, "SCALE")) {
+ reading_scale = 1;
+ config->scale = lingot_config_scale_new();
+ command_count++;
+ continue;
+ }
+
+ if (reading_scale) {
+
+ if (!strcmp(char_buffer_pointer, "NAME")) {
+ char_buffer_pointer += 4;
+ while (1) {
+ nl = strchr(delim, *char_buffer_pointer);
+ if (!nl)
+ break;
+ char_buffer_pointer++;
+ }
+ nl = strrchr(char_buffer_pointer, '\r');
+ if (nl)
+ *nl = '\0';
+ nl = strrchr(char_buffer_pointer, '\n');
+ if (nl)
+ *nl = '\0';
+ config->scale->name = strdup(char_buffer_pointer);
+ continue;
+ }
+ if (!strcmp(char_buffer_pointer, "BASE_FREQUENCY")) {
+ char_buffer_pointer = strtok(NULL, delim);
+ sscanf(char_buffer_pointer, "%lg",
+ &config->scale->base_frequency);
+ continue;
+ }
+ if (!strcmp(char_buffer_pointer, "NOTE_COUNT")) {
+ char_buffer_pointer = strtok(NULL, delim);
+ sscanf(char_buffer_pointer, "%hu", &config->scale->notes);
+ lingot_config_scale_allocate(config->scale,
+ config->scale->notes);
+ continue;
+ }
+
+ if (!strcmp(char_buffer_pointer, "NOTES")) {
+ int i = 0;
+ for (i = 0; i < config->scale->notes; i++) {
+ line++;
+ if (!fgets(char_buffer, MAX_LINE_SIZE, fp))
+ break;
+ // tokens into the line.
+ char_buffer_pointer = strtok(char_buffer, delim2);
+ config->scale->note_name[i] = strdup(char_buffer_pointer);
+ char_buffer_pointer = strtok(NULL, delim2);
+ if (!lingot_config_scale_parse_shift(char_buffer_pointer,
+ &config->scale->offset_cents[i],
+ &config->scale->offset_ratios[0][i],
+ &config->scale->offset_ratios[1][i])) {
+ parse_errors = 1;
+ }
+ }
+ line++;
+ if (!fgets(char_buffer, MAX_LINE_SIZE, fp))
+ break; // }
+
+ continue;
+ }
+
+ if (!strcmp(char_buffer_pointer, "}")) {
+ reading_scale = 0;
+ continue;
+ }
+
+ }
+
+ deprecated_option = 0;
+ for (option_index = 0; options[option_index]; option_index++) {
+ if (!strcmp(char_buffer_pointer, options[option_index])) {
+ break; // found token.
+ } else if (!strcmp("|", options[option_index])) {
+ deprecated_option = 1;
+ }
+ }
+
+ option = options[option_index];
+ param = params[option_index];
+
+ if (!option) {
+ fprintf(stderr,
+ "warning: parse error at line %i: unknown keyword %s\n",
+ line, char_buffer_pointer);
+ parse_errors = 1;
+ continue;
+ }
+
+ if (deprecated_option) {
+ fprintf(stdout, "warning: deprecated option %s\n",
+ char_buffer_pointer);
+ }
+
+ // take the attribute value.
+ char_buffer_pointer = strtok(NULL, delim);
+
+ if (!char_buffer_pointer) {
+ fprintf(stderr,
+ "warning: parse error at line %i: value expected\n", line);
+ parse_errors = 1;
+ continue;
+ }
+
+ // asign the value to the parameter.
+ switch (option_formats[option_index]) {
+ case 's':
+ sprintf(((char*) param), "%s", char_buffer_pointer);
+ command_count++;
+ break;
+ case 'd':
+ sscanf(char_buffer_pointer, "%d", (unsigned int*) param);
+ command_count++;
+ break;
+ case 'f':
+ sscanf(char_buffer_pointer, "%f", &aux);
+ *((FLT*) param) = aux;
+ command_count++;
+ break;
+ case 'm':
+ if (!strcmp("AUDIO_SYSTEM", option)) {
+ command_count++;
+ *((audio_system_t*) param) = str_to_audio_system_t(
+ char_buffer_pointer);
+ if (*((audio_system_t*) param) == (audio_system_t) -1) {
+ *((audio_system_t*) param) = AUDIO_SYSTEM_ALSA;
+ char buff[1000];
+ sprintf(
+ buff,
+ _(
+ "Error parsing the configuration file, line %i: unrecognized audio system '%s', assuming default audio system.\n"),
+ line, char_buffer_pointer);
+
+ lingot_msg_add_warning(buff);
+ parse_errors = 1;
+ }
+ }
+ break;
+ }
+ }
+
+ fclose(fp);
+
+ if (parse_errors) {
+ lingot_msg_add_warning(
+ _(
+ "The configuration file contains errors, and hence some default values have been chosen. Consider checking the settings and fixing the problem using the configuration dialog."));
+ }
+
+ lingot_config_update_internal_params(config);
+
+# undef MAX_LINE_SIZE
+}
diff --git a/src/lingot-config.h b/src/lingot-config.h
new file mode 100644
index 0000000..157baa6
--- /dev/null
+++ b/src/lingot-config.h
@@ -0,0 +1,123 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LINGOT_CONFIG_H__
+#define __LINGOT_CONFIG_H__
+
+#include "lingot-defs.h"
+#include "lingot-config-scale.h"
+
+typedef enum audio_system_t {
+ AUDIO_SYSTEM_OSS = 0, AUDIO_SYSTEM_ALSA = 1, AUDIO_SYSTEM_JACK = 2
+} audio_system_t;
+
+typedef enum window_type_t {
+ NONE = 0, RECTANGULAR = 1, HANNING = 2, HAMMING = 3
+} window_type_t;
+
+
+typedef struct _LingotConfig LingotConfig;
+
+// Configuration struct. Determines the tuner behaviour.
+// Some parameters are internal only.
+struct _LingotConfig {
+
+ audio_system_t audio_system;
+
+ char audio_dev[3][80];
+ int sample_rate; // soundcard sample rate.
+ unsigned int oversampling; // oversampling factor.
+
+ // root_frequency_reference_note_t root_frequency_referente_note;
+ FLT root_frequency_error; // deviation of the above root frequency.
+
+ FLT min_frequency; // minimum valid frequency.
+
+ unsigned int fft_size; // number of samples of the FFT.
+
+ FLT calculation_rate;
+ FLT visualization_rate;
+
+ FLT temporal_window; // duration in seconds of the temporal window.
+
+ // samples stored in the temporal window (internal parameter).
+ unsigned int temporal_buffer_size;
+
+ FLT noise_threshold_db; // dB
+ FLT noise_threshold_nu; // natural units (internal parameter)
+
+ window_type_t window_type;
+
+ // frequency finding algorithm configuration
+ //-------------------------------------------
+
+ unsigned int peak_number; // number of maximum peaks considered.
+
+ // number of adjacent samples needed to consider a peak.
+ unsigned int peak_half_width;
+
+ /* maximum amplitude relation between principal and secondary peaks.
+ The max peak doesn't has to be the fundamental frequency carrier if it
+ has an amplitude relation with the fundamental considered peak lower than
+ this parameter. */
+ FLT peak_rejection_relation_db; // dBs
+ FLT peak_rejection_relation_nu; // natural units (internal)
+
+ FLT gain; // dBs
+ FLT gain_nu; // natural units (internal)
+
+ // DFT approximation
+ unsigned int dft_number; // number of DFTs.
+ unsigned int dft_size; // samples of each DFT.
+
+ // max iterations for Newton-Raphson algorithm.
+ unsigned int max_nr_iter;
+
+ //----------------------------------------------------------------------------
+
+ // gauge rest value. (gauge contemplates [-0.5, 0.5])
+ FLT gauge_rest_value;
+
+ //----------------------------------------------------------------------------
+
+ LingotScale* scale;
+};
+
+// converts an audio_system_t to a string
+const char* audio_system_t_to_str(audio_system_t audio_system);
+// converts a string to an audio_system_t
+audio_system_t str_to_audio_system_t(char* audio_system);
+
+LingotConfig* lingot_config_new();
+void lingot_config_destroy(LingotConfig*);
+void lingot_config_copy(LingotConfig* dst, LingotConfig* src);
+
+// back to default configuration.
+void lingot_config_restore_default_values(LingotConfig*);
+
+// derivate internal parameters from external ones.
+void lingot_config_update_internal_params(LingotConfig*);
+
+void lingot_config_save(LingotConfig*, char* filename);
+void lingot_config_load(LingotConfig*, char* filename);
+
+#endif // __LINGOT_CONFIG_H__
diff --git a/src/lingot-core.c b/src/lingot-core.c
new file mode 100644
index 0000000..a7554a6
--- /dev/null
+++ b/src/lingot-core.c
@@ -0,0 +1,535 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <stdio.h>
+#include <math.h>
+#include <sys/soundcard.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/time.h>
+#include <time.h>
+#include <stdlib.h>
+
+#include "lingot-complex.h"
+
+#include "lingot-fft.h"
+#include "lingot-signal.h"
+#include "lingot-core.h"
+#include "lingot-config.h"
+#include "lingot-i18n.h"
+#include "lingot-msg.h"
+
+int
+lingot_core_read_callback(FLT* read_buffer, int read_buffer_size, void *arg);
+
+void lingot_core_run_reading_thread(LingotCore* core);
+void lingot_core_run_computation_thread(LingotCore* core);
+
+int decimation_input_index = 0;
+
+LingotCore* lingot_core_new(LingotConfig* conf) {
+
+ char buff[1000];
+ LingotCore* core = malloc(sizeof(LingotCore));
+
+ core->conf = conf;
+ core->running = 0;
+ core->audio = NULL;
+ core->spd_fft = NULL;
+ core->X = NULL;
+ core->spd_dft = NULL;
+ core->diff2_spd_fft = NULL;
+ core->flt_read_buffer = NULL;
+ core->temporal_buffer = NULL;
+ core->windowed_temporal_buffer = NULL;
+ core->windowed_fft_buffer = NULL;
+ core->hamming_window_temporal = NULL;
+ core->hamming_window_fft = NULL;
+ core->antialiasing_filter = NULL;
+
+ int requested_sample_rate = conf->sample_rate;
+
+ if (conf->sample_rate <= 0) {
+ conf->sample_rate = 0;
+ }
+
+ core->audio = lingot_audio_new(conf->audio_system,
+ conf->audio_dev[conf->audio_system], conf->sample_rate,
+ (LingotAudioProcessCallback) lingot_core_read_callback, core);
+
+ if (core->audio != NULL) {
+
+ if (requested_sample_rate != core->audio->real_sample_rate) {
+ conf->sample_rate = core->audio->real_sample_rate;
+ lingot_config_update_internal_params(conf);
+ sprintf(
+ buff,
+ _("The requested sample rate is not available, the real sample rate has been set to %d Hz"),
+ core->audio->real_sample_rate);
+ lingot_msg_add_warning(buff);
+ }
+
+ if (conf->temporal_buffer_size < conf->fft_size) {
+ conf->temporal_window = ((double) conf->fft_size
+ * conf->oversampling) / conf->sample_rate;
+ conf->temporal_buffer_size = conf->fft_size;
+ lingot_config_update_internal_params(conf);
+ sprintf(
+ buff,
+ _(
+ "The temporal buffer is smaller than FFT size. It has been increased to %0.3f seconds"),
+ conf->temporal_window);
+ lingot_msg_add_warning(buff);
+ }
+
+ // since the SPD is simmetrical, we only store the 1st half.
+ if (core->conf->fft_size > 256) {
+ core->spd_fft = malloc((core->conf->fft_size >> 1) * sizeof(FLT));
+ core->X = malloc((core->conf->fft_size >> 1) * sizeof(FLT));
+ memset(core->spd_fft, 0, (core->conf->fft_size >> 1) * sizeof(FLT));
+ memset(core->X, 0, (core->conf->fft_size >> 1) * sizeof(FLT));
+ } else { // if the fft size is 256, we store the whole signal for representation.
+ core->spd_fft = malloc((core->conf->fft_size) * sizeof(FLT));
+ core->X = malloc((core->conf->fft_size) * sizeof(FLT));
+ memset(core->spd_fft, 0, core->conf->fft_size * sizeof(FLT));
+ memset(core->X, 0, (core->conf->fft_size) * sizeof(FLT));
+ }
+
+ core->spd_dft = malloc((core->conf->dft_size) * sizeof(FLT));
+ memset(core->spd_dft, 0, core->conf->dft_size * sizeof(FLT));
+
+ core->diff2_spd_fft = malloc(core->conf->fft_size * sizeof(FLT)); // 2nd derivative from SPD.
+ memset(core->diff2_spd_fft, 0, core->conf->fft_size * sizeof(FLT));
+
+ memset(core->spd_dft, 0, core->conf->dft_size * sizeof(FLT));
+
+ lingot_fft_create_phase_factors(conf); // creates the phase factors for FFT.
+ core->fft_out = malloc((core->conf->fft_size) * sizeof(LingotComplex)); // complex signal in freq domain.
+ memset(core->fft_out, 0, core->conf->fft_size * sizeof(LingotComplex));
+
+ // audio source read in floating point format.
+ core->flt_read_buffer = malloc(core->audio->read_buffer_size
+ * sizeof(FLT));
+ memset(core->flt_read_buffer, 0, core->audio->read_buffer_size
+ * sizeof(FLT));
+
+ // stored samples.
+ core->temporal_buffer = malloc((core->conf->temporal_buffer_size)
+ * sizeof(FLT));
+ memset(core->temporal_buffer, 0, core->conf->temporal_buffer_size
+ * sizeof(FLT));
+
+ core->hamming_window_temporal = NULL;
+ core->hamming_window_fft = NULL;
+
+ if (conf->window_type != NONE) {
+ core->hamming_window_temporal = malloc(
+ (core->conf->temporal_buffer_size) * sizeof(FLT));
+ core->hamming_window_fft = malloc((core->conf->fft_size)
+ * sizeof(FLT));
+
+ lingot_signal_window(core->conf->temporal_buffer_size,
+ core->hamming_window_temporal, conf->window_type);
+ lingot_signal_window(core->conf->fft_size,
+ core->hamming_window_fft, conf->window_type);
+ }
+
+ core->windowed_temporal_buffer = malloc(
+ (core->conf->temporal_buffer_size) * sizeof(FLT));
+ memset(core->windowed_temporal_buffer, 0,
+ core->conf->temporal_buffer_size * sizeof(FLT));
+ core->windowed_fft_buffer
+ = malloc((core->conf->fft_size) * sizeof(FLT));
+ memset(core->windowed_fft_buffer, 0, core->conf->fft_size * sizeof(FLT));
+
+ /*
+ * 8 order Chebyshev filters, with wc=0.9/i (normalized respect to
+ * Pi). We take 0.9 instead of 1 to leave a 10% of safety margin,
+ * in order to avoid aliased frequencies near to w=Pi, due to non
+ * ideality of the filter.
+ *
+ * The cut frequencies wc=Pi/i, with i=1..20, correspond with the
+ * oversampling factor, avoiding aliasing at decimation.
+ *
+ * Why Chebyshev filters?, for a given order, those filters yield
+ * abrupt falls than other ones as Butterworth, making the most of
+ * the order. Although Chebyshev filters affects more to the phase,
+ * it doesn't matter due to the analysis is made on the signal
+ * power distribution (only module).
+ */
+ core->antialiasing_filter = lingot_filter_cheby_design(8, 0.5, 0.9
+ / core->conf->oversampling);
+
+ pthread_mutex_init(&core->temporal_buffer_mutex, NULL);
+
+ // ------------------------------------------------------------
+
+ core->running = 1;
+ }
+
+ core->freq = 0.0;
+ return core;
+}
+
+// -----------------------------------------------------------------------
+
+/* Deallocate resources */
+void lingot_core_destroy(LingotCore* core) {
+
+ if (core->audio != NULL) {
+ lingot_fft_destroy_phase_factors(); // destroy phase factors.
+ free(core->fft_out);
+
+ lingot_audio_destroy(core->audio);
+
+ free(core->spd_fft);
+ free(core->X);
+ free(core->spd_dft);
+ free(core->diff2_spd_fft);
+ free(core->flt_read_buffer);
+ free(core->temporal_buffer);
+
+ if (core->hamming_window_fft != NULL) {
+ free(core->hamming_window_temporal);
+ }
+
+ if (core->windowed_temporal_buffer != NULL) {
+ free(core->windowed_temporal_buffer);
+ }
+
+ if (core->hamming_window_fft != NULL) {
+ free(core->hamming_window_fft);
+ }
+
+ if (core->windowed_fft_buffer != NULL) {
+ free(core->windowed_fft_buffer);
+ }
+
+ if (core->antialiasing_filter != NULL)
+ lingot_filter_destroy(core->antialiasing_filter);
+
+ pthread_mutex_destroy(&core->temporal_buffer_mutex);
+ }
+
+ free(core);
+}
+
+// -----------------------------------------------------------------------
+
+// reads a new piece of signal from audio source, apply filtering and
+// decimation and appends it to the buffer
+int lingot_core_read_callback(FLT* read_buffer, int read_buffer_size, void *arg) {
+
+ unsigned int i, decimation_output_index; // loop variables.
+ int decimation_output_len;
+ FLT* decimation_in;
+ FLT* decimation_out;
+ LingotCore* core = (LingotCore*) arg;
+ LingotConfig* conf = core->conf;
+
+ memcpy(core->flt_read_buffer, read_buffer, read_buffer_size * sizeof(FLT));
+
+ // double freq = 100.0;
+ // for (i = 0; i < read_buffer_size; i++) {
+ // core->flt_read_buffer[i] = 5e2 * cos(2.0 * M_PI * freq * i
+ // / conf->sample_rate);
+ // }
+
+ if (conf->gain_nu != 1.0) {
+ for (i = 0; i < read_buffer_size; i++)
+ core->flt_read_buffer[i] *= conf->gain_nu;
+ }
+
+ //
+ // just readed:
+ //
+ // ----------------------------
+ // |bxxxbxxxbxxxbxxxbxxxbxxxbxxx|
+ // ----------------------------
+ //
+ // <----------------------------> read_buffer_size*oversampling
+ //
+
+ decimation_output_len = 1 + (read_buffer_size
+ - (decimation_input_index + 1)) / conf->oversampling;
+
+ pthread_mutex_lock(&core->temporal_buffer_mutex);
+
+ /* we shift the temporal window to leave a hollow where place the new piece
+ of data read. The buffer is actually a queue. */
+ if (conf->temporal_buffer_size > decimation_output_len) {
+ memmove(core->temporal_buffer,
+ &core->temporal_buffer[decimation_output_len],
+ (conf->temporal_buffer_size - decimation_output_len)
+ * sizeof(FLT));
+ }
+
+ //
+ // previous buffer situation:
+ //
+ // ------------------------------------------
+ // | xxxxxxxxxxxxxxxxxxxxxx | yyyyy | aaaaaaa |
+ // ------------------------------------------
+ // <------> read_buffer_size
+ // <---------------> fft_size
+ // <----------------------------------------> temporal_buffer_size
+ //
+ // new situation:
+ //
+ // ------------------------------------------
+ // | xxxxxxxxxxxxxxxxyyyyaa | aaaaa | |
+ // ------------------------------------------
+ //
+
+ // decimation with lowpass filtering
+
+ /* we decimate the read signal and put it at the end of the buffer. */
+ if (conf->oversampling > 1) {
+
+ decimation_in = core->flt_read_buffer;
+ decimation_out = &core->temporal_buffer[conf->temporal_buffer_size
+ - decimation_output_len];
+
+ // low pass filter to avoid aliasing.
+ lingot_filter_filter(core->antialiasing_filter, read_buffer_size,
+ decimation_in, decimation_in);
+
+ // compression.
+ for (decimation_output_index = 0; decimation_input_index
+ < read_buffer_size; decimation_output_index++, decimation_input_index
+ += conf->oversampling)
+ decimation_out[decimation_output_index]
+ = decimation_in[decimation_input_index];
+ decimation_input_index -= read_buffer_size;
+ } else
+ memcpy(&core->temporal_buffer[conf->temporal_buffer_size
+ - decimation_output_len], core->flt_read_buffer,
+ decimation_output_len * sizeof(FLT));
+ //
+ // ------------------------------------------
+ // | xxxxxxxxxxxxxxxxyyyyaa | aaaaa | bbbbbbb |
+ // ------------------------------------------
+ //
+
+ pthread_mutex_unlock(&core->temporal_buffer_mutex);
+
+ return 0;
+}
+
+void lingot_core_compute_fundamental_fequency(LingotCore* core) {
+
+ register unsigned int i, k; // loop variables.
+ LingotConfig* conf = core->conf;
+ FLT delta_w_FFT = 2.0 * M_PI / conf->fft_size; // FFT resolution in rads.
+
+ // ----------------- TRANSFORMATION TO FREQUENCY DOMAIN ----------------
+
+ FLT _1_N2 = 1.0 / (conf->fft_size * conf->fft_size);
+ // SPD normalization constant
+
+ //printf("%d samples transformed of a total of %d\n", conf->fft_size,
+ // conf->temporal_buffer_size);
+
+ pthread_mutex_lock(&core->temporal_buffer_mutex);
+
+ // windowing
+ if (conf->window_type != NONE) {
+ for (i = 0; i < conf->fft_size; i++) {
+ core->windowed_fft_buffer[i]
+ = core->temporal_buffer[conf->temporal_buffer_size
+ - conf->fft_size + i] * core->hamming_window_fft[i];
+ }
+ } else {
+ memmove(core->windowed_fft_buffer,
+ &core->temporal_buffer[conf->temporal_buffer_size
+ - conf->fft_size], conf->fft_size * sizeof(FLT));
+ }
+
+ // transformation.
+ lingot_fft_fft(core->windowed_fft_buffer, core->fft_out, conf->fft_size);
+
+ // esteem of SPD from FFT. (normalized squared module)
+ for (i = 0; i < ((conf->fft_size > 256) ? (conf->fft_size >> 1) : 256); i++)
+ core->spd_fft[i] = (core->fft_out[i].r * core->fft_out[i].r
+ + core->fft_out[i].i * core->fft_out[i].i) * _1_N2;
+
+ // representable piece
+ memcpy(core->X, core->spd_fft, ((conf->fft_size > 256) ? (conf->fft_size
+ >> 1) : 256) * sizeof(FLT));
+
+ // truncated 2nd derivative esteem, to enhance peaks
+ core->diff2_spd_fft[0] = 0.0;
+ for (i = 1; i < (conf->fft_size >> 1) - 1; i++) {
+ core->diff2_spd_fft[i] = 2.0 * core->spd_fft[i] - core->spd_fft[i - 1]
+ - core->spd_fft[i + 1]; // centred 2nd order derivative, to avoid group delay.
+ if (core->diff2_spd_fft[i] < 0.0)
+ core->diff2_spd_fft[i] = 0.0; // truncation
+ }
+
+ // peaks searching in that signal.
+ int Mi = lingot_signal_get_fundamental_peak(conf, core->spd_fft,
+ core->diff2_spd_fft, (conf->fft_size >> 1)); // take the fundamental peak.
+
+ if (Mi == (signed) (conf->fft_size >> 1)) {
+ core->freq = 0.0;
+ pthread_mutex_unlock(&core->temporal_buffer_mutex);
+ return;
+ }
+
+ FLT w = (Mi - 1) * delta_w_FFT;
+ // frequency of sample previous to the peak
+
+ // Approximation to fundamental frequency by selective DFTs
+ // ---------------------------------------------------------
+
+ FLT d_w = delta_w_FFT;
+ for (k = 0; k < conf->dft_number; k++) {
+
+ d_w = 2.0 * d_w / (conf->dft_size - 1); // resolution in rads.
+
+ if (k == 0) {
+ lingot_fft_spd(core->windowed_fft_buffer, conf->fft_size, w + d_w,
+ d_w, &core->spd_dft[1], conf->dft_size - 2);
+ core->spd_dft[0] = core->spd_fft[Mi - 1];
+ core->spd_dft[conf->dft_size - 1] = core->spd_fft[Mi + 1]; // 2 samples known.
+ } else
+ lingot_fft_spd(core->windowed_fft_buffer, conf->fft_size, w, d_w,
+ core->spd_dft, conf->dft_size);
+
+ lingot_signal_get_max(core->spd_dft, conf->dft_size, &Mi); // search the maximum.
+
+ w += (Mi - 1) * d_w; // previous sample to the peak.
+ }
+
+ w += d_w; // DFT approximation.
+
+ // windowing
+ if (conf->window_type != NONE) {
+ for (i = 0; i < conf->temporal_buffer_size; i++) {
+ core->windowed_temporal_buffer[i] = core->temporal_buffer[i]
+ * core->hamming_window_temporal[i];
+ }
+ } else {
+ memmove(core->windowed_temporal_buffer, core->temporal_buffer,
+ conf->temporal_buffer_size * sizeof(FLT));
+ }
+
+ pthread_mutex_unlock(&core->temporal_buffer_mutex);
+
+ // Maximum finding by Newton-Raphson
+ // -----------------------------------
+
+ FLT wk = -1.0e5;
+ FLT wkm1 = w;
+ // first iterator set to the current approximation.
+ FLT d1_SPD, d2_SPD;
+
+ for (k = 0; (k < conf->max_nr_iter) && (fabs(wk - wkm1) > 1.0e-8); k++) {
+ wk = wkm1;
+
+ // ! we use the WHOLE temporal window for greater precission.
+ lingot_fft_spd_diffs(core->windowed_temporal_buffer,
+ conf->temporal_buffer_size, wk, &d1_SPD, &d2_SPD);
+ //printf("%f %f %f\n", wk, d1_SPD, d2_SPD);
+ wkm1 = wk - d1_SPD / d2_SPD;
+ }
+
+ w = wkm1; // frequency in rads.
+ core->freq = (w * conf->sample_rate) / (2.0 * M_PI * conf->oversampling); // analog frequency.
+}
+
+/* start running the core in another thread */
+void lingot_core_start(LingotCore* core) {
+
+ int audio_status = 0;
+ decimation_input_index = 0;
+
+ if (core->audio != NULL) {
+ audio_status = lingot_audio_start(core->audio);
+
+ if (audio_status == 0) {
+ pthread_mutex_init(&core->thread_computation_mutex, NULL);
+ pthread_cond_init(&core->thread_computation_cond, NULL);
+
+ pthread_attr_init(&core->thread_computation_attr);
+ pthread_create(&core->thread_computation,
+ &core->thread_computation_attr,
+ (void* (*)(void*)) lingot_core_run_computation_thread, core);
+ }
+
+ core->running = 1;
+ }
+}
+
+/* stop running the core */
+void lingot_core_stop(LingotCore* core) {
+ void* thread_result;
+
+ if (core->running == 1) {
+ core->running = 0;
+
+ // threads cancelation
+ pthread_cancel(core->thread_computation);
+ pthread_join(core->thread_computation, &thread_result);
+ // printf("%p %p %i\n", thread_result, PTHREAD_CANCELED, thread_result
+ // == PTHREAD_CANCELED);
+
+ pthread_attr_destroy(&core->thread_computation_attr);
+
+ memset(core->X, 0,
+ ((core->conf->fft_size > 256) ? (core->conf->fft_size >> 1)
+ : core->conf->fft_size) * sizeof(FLT));
+ core->freq = 0.0;
+ }
+
+ if (core->audio != NULL)
+ lingot_audio_stop(core->audio);
+}
+
+/* run the core */
+void lingot_core_run_computation_thread(LingotCore* core) {
+ struct timeval t, tout;
+ struct timespec tspec;
+
+ gettimeofday(&tout, NULL);
+ t.tv_sec = 0;
+ t.tv_usec = 1e6 / core->conf->calculation_rate;
+
+ while (core->running) {
+ lingot_core_compute_fundamental_fequency(core);
+ timeradd(&t, &tout, &tout);
+ tspec.tv_sec = tout.tv_sec;
+ tspec.tv_nsec = 1000 * tout.tv_usec;
+ pthread_cond_timedwait(&core->thread_computation_cond,
+ &core->thread_computation_mutex, &tspec);
+
+ if (core->audio != NULL) {
+ if (core->audio->interrupted) {
+ memset(core->X, 0,
+ ((core->conf->fft_size > 256) ? (core->conf->fft_size
+ >> 1) : core->conf->fft_size) * sizeof(FLT));
+ core->freq = 0.0;
+ core->running = 0;
+ }
+ }
+ }
+}
diff --git a/src/lingot-core.h b/src/lingot-core.h
new file mode 100644
index 0000000..d4434f6
--- /dev/null
+++ b/src/lingot-core.h
@@ -0,0 +1,92 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LINGOT_CORE_H__
+#define __LINGOT_CORE_H__
+
+#include <pthread.h>
+
+#include "lingot-defs.h"
+#include "lingot-complex.h"
+#include "lingot-filter.h"
+#include "lingot-config.h"
+
+#include "lingot-audio.h"
+
+typedef struct _LingotCore LingotCore;
+
+struct _LingotCore {
+
+ // -- shared data --
+ FLT freq; // analog frequency calculated.
+ FLT* X; // visual portion of FFT.
+ // -- shared data --
+
+ LingotAudioHandler* audio; // audio handler.
+
+ FLT* flt_read_buffer;
+ FLT* temporal_buffer; // sample memory.
+
+ // precomputed hamming windows
+ FLT* hamming_window_temporal;
+ FLT* hamming_window_fft;
+
+ // windowed signals
+ FLT* windowed_temporal_buffer;
+ FLT* windowed_fft_buffer;
+
+ // spectral power distribution esteem.
+ FLT* spd_fft;
+ FLT* spd_dft;
+ FLT* diff2_spd_fft;
+
+ LingotComplex* fft_out; // complex signal in freq.
+
+ LingotFilter* antialiasing_filter; // antialiasing filter for decimation.
+
+ int running;
+
+ LingotConfig* conf; // configuration structure
+
+ pthread_t thread_computation;
+ pthread_attr_t thread_computation_attr;
+ pthread_cond_t thread_computation_cond;
+ pthread_mutex_t thread_computation_mutex;
+
+ pthread_mutex_t temporal_buffer_mutex;
+
+};
+
+//----------------------------------------------------------------
+
+LingotCore* lingot_core_new(LingotConfig*);
+void lingot_core_destroy(LingotCore*);
+
+// start process
+void lingot_core_start(LingotCore*);
+
+// stop process
+void lingot_core_stop(LingotCore*);
+
+//int lingot_core_read(LingotCore* core);
+
+#endif //__LINGOT_CORE_H__
diff --git a/src/lingot-defs.h b/src/lingot-defs.h
new file mode 100644
index 0000000..a3b077c
--- /dev/null
+++ b/src/lingot-defs.h
@@ -0,0 +1,67 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LINGOT_DEFS_H__
+#define __LINGOT_DEFS_H__
+
+#include <sys/types.h>
+#include "../config.h"
+
+// floating point precission.
+#define FLT double
+
+#define SAMPLE_TYPE int16_t
+#define SAMPLE_FORMAT AFMT_S16_LE
+
+#define CONFIG_DIR_NAME ".lingot/"
+#define DEFAULT_CONFIG_FILE_NAME "lingot.conf"
+extern char CONFIG_FILE_NAME[];
+
+#define QUICK_MESSAGES
+
+#define GTK_EVENTS_RATE 20.0
+#define GAUGE_RATE 60.0
+#define ERROR_DISPATCH_RATE 5.0
+
+#define MID_A_FREQUENCY 440.0
+#define MID_C_FREQUENCY 261.625565
+
+/* object forward declaration */
+typedef struct _LingotMainFrame LingotMainFrame;
+
+// optionally we can use the following libraries
+//#define LIB_FFTW
+//#define LIBSNDOBJ
+
+// simple try-catch simulation, do not use throw inside loops nor nest try-catch
+// blocks
+#define try exception = 0; do
+#define throw(a) {exception = a;break;}
+#define catch while (0); if (exception != 0)
+
+// this option allows us to throw exception from loops, it contains a goto
+// statement, but totally controlled, and it fails to indent the code.
+//#define try exception = 0;do
+//#define throw(a) {exception = a;goto catch_label;}
+//#define catch while (0);catch_label: if (exception != 0)
+
+#endif
diff --git a/src/lingot-fft.c b/src/lingot-fft.c
new file mode 100644
index 0000000..4d21b0a
--- /dev/null
+++ b/src/lingot-fft.c
@@ -0,0 +1,167 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <math.h>
+#include <stdlib.h>
+
+#include "lingot-fft.h"
+#include "lingot-config.h"
+
+/*
+ DFT functions.
+ */
+
+#ifndef LIB_FFTW
+
+#include "lingot-complex.h"
+
+// phase factor table, for FFT optimization.
+LingotComplex* wn = NULL;
+
+// creates the phase factor table.
+void lingot_fft_create_phase_factors(LingotConfig* conf) {
+ FLT alpha;
+ unsigned int i;
+
+ wn = (LingotComplex*) malloc((conf->fft_size >> 1) * sizeof(LingotComplex));
+
+ for (i = 0; i < (conf->fft_size >> 1); i++) {
+ alpha = -2.0 * i * M_PI / conf->fft_size;
+ wn[i].r = cos(alpha);
+ wn[i].i = sin(alpha);
+ }
+}
+
+void lingot_fft_destroy_phase_factors() {
+ if (wn != NULL) {
+ free(wn);
+ }
+}
+
+//------------------------------------------------------------------------
+
+// Fast Fourier Transform.
+void _lingot_fft_fft(FLT* in, LingotComplex* out, unsigned long int N,
+ unsigned long int offset, unsigned long int d1, unsigned long int step) {
+ LingotComplex X1, X2;
+ unsigned long int Np2 = (N >> 1); // N/2
+ register unsigned long int a, b, c, q;
+
+ if (N == 2) { // butterfly for N = 2;
+
+ X1.r = in[offset];
+ X1.i = 0.0;
+ X2.r = in[offset + step];
+ X2.i = 0.0;
+
+ lingot_complex_add(&X1, &X2, &out[d1]);
+ lingot_complex_sub(&X1, &X2, &out[d1 + Np2]);
+
+ return;
+ }
+
+ _lingot_fft_fft(in, out, Np2, offset, d1, step << 1);
+ _lingot_fft_fft(in, out, Np2, offset + step, d1 + Np2, step << 1);
+
+ for (q = 0, c = 0; q < (N >> 1); q++, c += step) {
+
+ a = q + d1;
+ b = a + Np2;
+
+ X1 = out[a];
+ lingot_complex_mul(&out[b], &wn[c], &X2);
+ lingot_complex_add(&X1, &X2, &out[a]);
+ lingot_complex_sub(&X1, &X2, &out[b]);
+ }
+}
+
+void lingot_fft_fft(FLT* in, LingotComplex* out, unsigned long int N) {
+ _lingot_fft_fft(in, out, N, 0, 0, 1);
+}
+
+#endif
+
+//------------------------------------------------------------------------
+
+
+/* Spectral Power Distribution esteem, selectively in frequency, by DFT.
+ transforms signal in of N1 samples from frequency wi, with sample
+ separation of dw rads, storing the result on buffer out with N2 samples. */
+void lingot_fft_spd(FLT* in, int N1, FLT wi, FLT dw, FLT* out, int N2) {
+ FLT Xr, Xi;
+ FLT wn;
+ FLT N1_2 = N1 * N1;
+ register int i, n;
+
+ for (i = 0; i < N2; i++) {
+
+ Xr = 0.0;
+ Xi = 0.0;
+
+ for (n = 0; n < N1; n++) { // O(n1*n2) :(
+
+ wn = (wi + dw * i) * n;
+ Xr = Xr + cos(wn) * in[n];
+ Xi = Xi - sin(wn) * in[n];
+ }
+
+ out[i] = (Xr * Xr + Xi * Xi) / N1_2; // normalized squared module.
+ }
+}
+
+//------------------------------------------------------------------------
+
+/*
+ Evaluates 1st and 2nd derivatives from SPD at frequency w.
+ */
+void lingot_fft_spd_diffs(FLT* in, int N, FLT w, FLT* out_d1, FLT* out_d2) {
+ FLT x_cos_wn;
+ FLT x_sin_wn;
+ register int n;
+
+ FLT SUM_x_sin_wn = 0.0;
+ FLT SUM_x_cos_wn = 0.0;
+ FLT SUM_x_n_sin_wn = 0.0;
+ FLT SUM_x_n_cos_wn = 0.0;
+ FLT SUM_x_n2_sin_wn = 0.0;
+ FLT SUM_x_n2_cos_wn = 0.0;
+
+ for (n = 0; n < N; n++) {
+
+ x_cos_wn = in[n] * cos(w * n);
+ x_sin_wn = in[n] * sin(w * n);
+
+ SUM_x_sin_wn += x_sin_wn;
+ SUM_x_cos_wn += x_cos_wn;
+ SUM_x_n_sin_wn += x_sin_wn * n;
+ SUM_x_n_cos_wn += x_cos_wn * n;
+ SUM_x_n2_sin_wn += x_sin_wn * n * n;
+ SUM_x_n2_cos_wn += x_cos_wn * n * n;
+ }
+
+ FLT N_2 = N * N;
+ *out_d1 = 2.0 * (SUM_x_sin_wn * SUM_x_n_cos_wn - SUM_x_cos_wn
+ * SUM_x_n_sin_wn) / N_2;
+ *out_d2 = 2.0 * (SUM_x_n_cos_wn * SUM_x_n_cos_wn - SUM_x_sin_wn
+ * SUM_x_n2_sin_wn + SUM_x_n_sin_wn * SUM_x_n_sin_wn - SUM_x_cos_wn
+ * SUM_x_n2_cos_wn) / N_2;
+}
diff --git a/src/lingot-fft.h b/src/lingot-fft.h
new file mode 100644
index 0000000..6195da0
--- /dev/null
+++ b/src/lingot-fft.h
@@ -0,0 +1,51 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _LINGOT_FFT_H_
+#define _LINGOT_FFT_H_
+
+/*
+ Fourier transforms.
+ */
+
+#include "lingot-defs.h"
+
+#ifndef LIB_FFTW
+
+# include "lingot-complex.h"
+# include "lingot-config.h"
+
+void lingot_fft_create_phase_factors(LingotConfig* conf);
+void lingot_fft_destroy_phase_factors();
+
+// Fast Fourier Transform implementation.
+void lingot_fft_fft(FLT* in, LingotComplex* out, unsigned long int N);
+
+#endif // not LIB_FFTW
+
+// Spectral Power Distribution (SPD) esteem, selectively in frequency.
+void lingot_fft_spd(FLT* in, int N1, FLT wi, FLT dw, FLT* out, int N2);
+
+// first and second SPD derivatives at frequency w.
+void lingot_fft_spd_diffs(FLT* in, int N, FLT w, FLT* out_d1, FLT* out_d2);
+
+#endif
diff --git a/src/lingot-filter.c b/src/lingot-filter.c
new file mode 100644
index 0000000..abc499b
--- /dev/null
+++ b/src/lingot-filter.c
@@ -0,0 +1,243 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <memory.h>
+#include <math.h>
+
+#include "lingot-complex.h"
+#include "lingot-filter.h"
+
+#define max(a,b) (((a)<(b))?(b):(a))
+
+// given each polynomial order and coefs, with optional initial status.
+LingotFilter* lingot_filter_new(unsigned int Na, unsigned int Nb, FLT* a,
+ FLT* b) {
+ unsigned int i;
+ LingotFilter* filter = malloc(sizeof(LingotFilter));
+ filter->N = max(Na, Nb);
+
+ filter->a = malloc((filter->N + 1) * sizeof(FLT));
+ filter->b = malloc((filter->N + 1) * sizeof(FLT));
+ filter->s = malloc((filter->N + 1) * sizeof(FLT));
+
+ for (i = 0; i < filter->N + 1; i++)
+ filter->a[i] = filter->b[i] = filter->s[i] = 0.0;
+
+ memcpy(filter->a, a, (Na + 1) * sizeof(FLT));
+ memcpy(filter->b, b, (Nb + 1) * sizeof(FLT));
+
+ for (i = 0; i < filter->N + 1; i++) {
+ filter->a[i] /= a[0]; // polynomial normalization.
+ filter->b[i] /= a[0];
+ }
+
+ return filter;
+}
+
+void lingot_filter_destroy(LingotFilter* filter) {
+ free(filter->a);
+ free(filter->b);
+ free(filter->s);
+
+ free(filter);
+}
+
+// Digital Filter Implementation II, in & out overlapables.
+void lingot_filter_filter(LingotFilter* filter, unsigned int n, FLT* in,
+ FLT* out) {
+ FLT w, y;
+ register unsigned int i;
+ register int j;
+
+ for (i = 0; i < n; i++) {
+
+ w = in[i];
+ y = 0.0;
+
+ for (j = filter->N - 1; j >= 0; j--) {
+ w -= filter->a[j + 1] * filter->s[j];
+ y += filter->b[j + 1] * filter->s[j];
+ filter->s[j + 1] = filter->s[j];
+ }
+
+ y += w * filter->b[0];
+ filter->s[0] = w;
+
+ out[i] = y;
+ }
+}
+
+// single sample filtering
+FLT lingot_filter_filter_sample(LingotFilter* filter, FLT in) {
+ FLT result;
+
+ lingot_filter_filter(filter, 1, &in, &result);
+ return result;
+}
+
+// vector prod
+void lingot_filter_vector_product(int n, LingotComplex* vector,
+ LingotComplex* result) {
+ register int i;
+ LingotComplex aux1;
+
+ result->r = 1.0;
+ result->i = 0.0;
+
+ for (i = 0; i < n; i++) {
+ aux1.r = -vector[i].r;
+ aux1.i = -vector[i].i;
+ lingot_complex_mul(result, &aux1, result);
+ }
+
+}
+
+// Chebyshev filters
+LingotFilter* lingot_filter_cheby_design(unsigned int n, FLT Rp, FLT wc) {
+ int i; // loops
+ int k;
+ int p;
+
+ FLT a[n + 1];
+ FLT b[n + 1];
+
+ FLT new_a[n + 1];
+ FLT new_b[n + 1];
+
+ // locate poles
+ LingotComplex pole[n];
+
+ for (i = 0; i < n; i++) {
+ pole[i].r = 0.0;
+ pole[i].i = 0.0;
+ }
+
+ FLT T = 2.0;
+ // 2Hz
+ FLT W = 2.0 / T * tan(M_PI * wc / T);
+
+ FLT epsilon = sqrt(pow(10.0, 0.1 * Rp) - 1);
+ FLT v0 = asinh(1 / epsilon) / n;
+
+ FLT sv0 = sinh(v0);
+ FLT cv0 = cosh(v0);
+
+ FLT t;
+
+ for (i = -(n - 1), k = 0; k < n; i += 2, k++) {
+ t = M_PI * i / (2.0 * n);
+ pole[k].r = -sv0 * cos(t);
+ pole[k].i = cv0 * sin(t);
+ }
+
+ LingotComplex gain;
+
+ lingot_filter_vector_product(n, pole, &gain);
+
+ if ((n & 1) == 0) {// even
+ FLT f = pow(10.0, -0.05 * Rp);
+ gain.r *= f;
+ gain.i *= f;
+ }
+
+ FLT f = pow(W, n);
+ gain.r *= f;
+ gain.i *= f;
+
+ for (i = 0; i < n; i++) {
+ pole[i].r *= W;
+ pole[i].i *= W;
+ }
+
+ // bilinear transform
+ LingotComplex sp[n];
+
+ for (i = 0; i < n; i++) {
+ sp[i].r = (2.0 - pole[i].r * T) / T;
+ sp[i].i = (0.0 - pole[i].i * T) / T;
+ }
+
+ LingotComplex tmp1;
+ LingotComplex aux2;
+
+ lingot_filter_vector_product(n, sp, &tmp1);
+
+ lingot_complex_div(&gain, &tmp1, &gain);
+
+ for (i = 0; i < n; i++) {
+ tmp1.r = (2.0 + pole[i].r * T);
+ tmp1.i = (0.0 + pole[i].i * T);
+ aux2.r = (2.0 - pole[i].r * T);
+ aux2.i = (0.0 - pole[i].i * T);
+ lingot_complex_div(&tmp1, &aux2, &pole[i]);
+ }
+
+ // compute filter coefficients from pole/zero values
+ a[0] = 1.0;
+ b[0] = 1.0;
+ new_a[0] = 1.0;
+ new_b[0] = 1.0;
+
+ for (i = 1; i <= n; i++) {
+ a[i] = 0.0;
+ b[i] = 0.0;
+ new_a[i] = 0.0;
+ new_b[i] = 0.0;
+ }
+
+ if ((n & 1) == 1) // odd
+ {
+ // first subfilter is first order
+ a[1] = -pole[n / 2].r;
+ b[1] = 1.0;
+ }
+
+ // iterate over the conjugate pairs
+ for (p = 0; p < n / 2; p++) {
+ FLT b1 = 2.0;
+ FLT b2 = 1.0;
+
+ FLT a1 = -2.0 * pole[p].r;
+ FLT a2 = pole[p].r * pole[p].r + pole[p].i * pole[p].i;
+
+ // 2nd order subfilter per each pair
+ new_a[1] = a[1] + a1 * a[0];
+ new_b[1] = b[1] + b1 * b[0];
+
+ // poly multiplication
+ for (i = 2; i <= n; i++) {
+ new_a[i] = a[i] + a1 * a[i - 1] + a2 * a[i - 2];
+ new_b[i] = b[i] + b1 * b[i - 1] + b2 * b[i - 2];
+ }
+ for (i = 1; i <= n; i++) {
+ a[i] = new_a[i];
+ b[i] = new_b[i];
+ }
+ }
+
+ gain.r = fabs(gain.r);
+ for (i = 0; i <= n; i++) {
+ b[i] *= gain.r;
+ }
+
+ return lingot_filter_new(n, n, a, b);
+}
diff --git a/src/lingot-filter.h b/src/lingot-filter.h
new file mode 100644
index 0000000..6da7c99
--- /dev/null
+++ b/src/lingot-filter.h
@@ -0,0 +1,65 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LINGOT_FILTER_H__
+#define __LINGOT_FILTER_H__
+
+#include <fcntl.h>
+#include <stdlib.h>
+
+#include "lingot-defs.h"
+
+/*
+ digital filtering implementation.
+ */
+
+typedef struct _LingotFilter LingotFilter;
+
+struct _LingotFilter
+ {
+
+ FLT* a;
+ FLT* b; // coefs
+ FLT* s; // status
+
+ unsigned int N;
+
+ };
+
+LingotFilter
+ * lingot_filter_new(unsigned int Na, unsigned int Nb, FLT* a, FLT* b);
+
+/**
+ * Design a Chebyshev type I low pass filter with Rp dB of pass band ripple
+ * with cutoff pi*wc radians.
+ */
+LingotFilter* lingot_filter_cheby_design(unsigned int order, FLT Rp, FLT wc);
+
+void lingot_filter_destroy(LingotFilter*);
+
+// Digital Filter Implementation II, in & out overlapables. Vector filtering
+void lingot_filter_filter(LingotFilter*, unsigned int n, FLT* in, FLT* out);
+
+// sample filtering
+FLT lingot_filter_filter_sample(LingotFilter*, FLT in);
+
+#endif
diff --git a/src/lingot-gauge.c b/src/lingot-gauge.c
new file mode 100644
index 0000000..4e5a17f
--- /dev/null
+++ b/src/lingot-gauge.c
@@ -0,0 +1,91 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "lingot-gauge.h"
+
+LingotGauge* lingot_gauge_new(FLT initial_position)
+ {
+
+ //
+ // ----- ERROR GAUGE FILTER CONFIGURATION -----
+ //
+ // dynamic model of the gauge:
+ //
+ // 2
+ // d d
+ // --- s(t) = k (e(t) - s(t)) - q -- s(t)
+ // 2 dt
+ // dt
+ //
+ // acceleration of gauge position 's(t)' linealy depends on the difference
+ // respect to the input stimulus 'e(t)' (destination position). Inserting
+ // a friction coefficient 'q', acceleration proportionaly diminish with
+ // velocity (typical friction in mechanics). 'k' is the adaptation constant,
+ // and depends on the gauge mass.
+ //
+ // with the following derivatives approximation (valid for high sample rate):
+ //
+ // d
+ // -- s(t) ~= (s[n] - s[n - 1])*fs
+ // dt
+ //
+ // 2
+ // d 2
+ // --- s(t) ~= (s[n] - 2*s[n - 1] + s[n - 2])*fs
+ // 2
+ // dt
+ //
+ // we can obtain a difference equation, and implement it with an IIR digital
+ // filter.
+ //
+
+ FLT k = 60;
+ // adaptation constant.
+ FLT q = 6;
+ // friction coefficient.
+
+ FLT a[] =
+ {
+ k + GAUGE_RATE*(q + GAUGE_RATE),
+ -GAUGE_RATE*(q + 2.0*GAUGE_RATE),
+ GAUGE_RATE*GAUGE_RATE};
+ FLT b[] =
+ { k};
+
+ LingotGauge* gauge = malloc(sizeof(LingotGauge));
+
+ gauge->filter = lingot_filter_new( 2, 0, a, b );
+ lingot_gauge_compute(gauge, initial_position);
+ return gauge;
+ }
+
+void lingot_gauge_destroy(LingotGauge* gauge)
+ {
+ lingot_filter_destroy(gauge->filter);
+ free(gauge);
+ }
+
+void lingot_gauge_compute(LingotGauge* gauge, FLT sample)
+ {
+ gauge->position = lingot_filter_filter_sample(gauge->filter, sample);
+ }
+
diff --git a/src/lingot-gauge.h b/src/lingot-gauge.h
new file mode 100644
index 0000000..cda38c5
--- /dev/null
+++ b/src/lingot-gauge.h
@@ -0,0 +1,45 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LINGOT_GAUGE_H__
+#define __LINGOT_GAUGE_H__
+
+#include "lingot-defs.h"
+#include "lingot-filter.h"
+
+/*
+ * Implements the dynamic behaviour of the gauge with a digital filter.
+ */
+
+typedef struct _LingotGauge LingotGauge;
+
+struct _LingotGauge
+ {
+ LingotFilter* filter;
+ FLT position;
+ };
+
+LingotGauge* lingot_gauge_new(FLT);
+void lingot_gauge_destroy(LingotGauge*);
+void lingot_gauge_compute(LingotGauge*, FLT);
+
+#endif /*__LINGOT_GAUGE_H__*/
diff --git a/src/lingot-gui-config-dialog-scale.c b/src/lingot-gui-config-dialog-scale.c
new file mode 100644
index 0000000..844701b
--- /dev/null
+++ b/src/lingot-gui-config-dialog-scale.c
@@ -0,0 +1,671 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <glade/glade.h>
+#include <math.h>
+
+#include "lingot-gui-config-dialog.h"
+#include "lingot-gui-config-dialog-scale.h"
+#include "lingot-msg.h"
+#include "lingot-i18n.h"
+
+enum {
+ COLUMN_NAME = 0, COLUMN_SHIFT = 1, COLUMN_FREQUENCY = 2, NUM_COLUMNS = 3
+};
+
+void lingot_gui_config_dialog_scale_tree_add_row_tree(gpointer data,
+ GtkTreeView *treeview) {
+ GtkTreeModel *model;
+ GtkTreeStore *model_store;
+ GtkTreeIter iter1, iter2;
+ gdouble freq;
+
+ model = gtk_tree_view_get_model(treeview);
+ model_store = (GtkTreeStore *) model;
+
+ GtkTreeSelection *selection = gtk_tree_view_get_selection(treeview);
+
+ if (gtk_tree_selection_count_selected_rows(selection) == 0) {
+ gtk_tree_store_append(model_store, &iter2, NULL);
+ } else {
+ GList *list = gtk_tree_selection_get_selected_rows(selection, &model);
+
+ int ipath = atoi(gtk_tree_path_to_string(list->data));
+ GString *fixed_path = g_string_new("");
+ g_string_printf(fixed_path, "%d", ipath);
+
+ GtkTreePath *path = gtk_tree_path_new_from_string(fixed_path->str);
+ g_string_free(fixed_path, TRUE);
+
+ gboolean valid = FALSE;
+
+ if (path) {
+ if (gtk_tree_model_get_iter(model, &iter1, path)) { // get iter from specified path
+ valid = TRUE;
+ } else { // invalid path
+ // g_error("Error!!!\n");
+ // TODO
+ }
+ gtk_tree_path_free(path);
+ } else {
+ // g_error("Error!!!\n");
+ // TODO
+ }
+
+ g_list_foreach(list, (GFunc) gtk_tree_path_free, NULL);
+ g_list_free(list);
+
+ if (!valid)
+ return;
+
+ if (ipath == 0) {
+ lingot_msg_add_warning(
+ _("You cannot insert before the reference note."));
+ return;
+ }
+
+ // g_free(path_str);
+ gtk_tree_store_insert_before(model_store, &iter2, NULL, &iter1);
+ }
+
+ gtk_tree_model_get_iter_first(model, &iter1);
+ gtk_tree_model_get(model, &iter1, COLUMN_FREQUENCY, &freq, -1);
+
+ gtk_tree_store_set(model_store, &iter2, COLUMN_NAME, "?", COLUMN_SHIFT,
+ "1/1", COLUMN_FREQUENCY, freq, -1);
+}
+
+void lingot_gui_config_dialog_scale_tree_remove_selected_items(gpointer data,
+ GtkTreeView *treeview) {
+ GtkTreeStore *store;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ GtkTreeSelection *selection = gtk_tree_view_get_selection(treeview);
+
+ if (gtk_tree_selection_count_selected_rows(selection) == 0)
+ return;
+
+ GList *list = gtk_tree_selection_get_selected_rows(selection, &model);
+ store = GTK_TREE_STORE(model);
+
+ int nRemoved = 0;
+ while (list) {
+ int ipath = atoi(gtk_tree_path_to_string(list->data));
+ ipath -= nRemoved;
+ GString *fixed_path = g_string_new("");
+ g_string_printf(fixed_path, "%d", ipath);
+
+ GtkTreePath *path = gtk_tree_path_new_from_string(fixed_path->str);
+ g_string_free(fixed_path, TRUE);
+ if (path) {
+ if (ipath != 0) {
+ if (gtk_tree_model_get_iter(model, &iter, path)) { // get iter from specified path
+ gtk_tree_store_remove(store, &iter); // remove item
+ nRemoved++;
+ } else { // invalid path
+ // g_error("Error!!!\n");
+ // TODO
+ }
+ }
+ gtk_tree_path_free(path);
+ } else {
+ // g_error("Error!!!\n");
+ // TODO
+ }
+ list = list->next;
+ }
+ g_list_foreach(list, (GFunc) gtk_tree_path_free, NULL);
+ g_list_free(list);
+}
+
+void lingot_gui_config_dialog_scale_tree_cell_edited_callback(
+ GtkCellRendererText *cell, gchar *path_string, gchar *new_text,
+ gpointer user_data) {
+ GtkTreeView *treeview;
+ GtkTreeModel *model;
+ GtkTreeStore *model_store;
+ GtkTreeIter iter, iter2;
+ GtkCellRenderer *renderer;
+ char* shift_char;
+ char* stored_shift_char;
+ gdouble freq, stored_freq, base_freq, stored_shift;
+ double shift_cents;
+ short int shift_numerator, shift_denominator;
+ gdouble shiftf2, freq2;
+ char* char_pointer;
+ char buff[80];
+ const char* delim = " \t\n";
+ LingotConfigDialog* config_dialog = (LingotConfigDialog*) user_data;
+ int index;
+
+ treeview = config_dialog->scale_treeview;
+ model_store = (GtkTreeStore *) gtk_tree_view_get_model(treeview);
+
+ GtkTreeSelection *selection = gtk_tree_view_get_selection(treeview);
+
+ if (gtk_tree_selection_count_selected_rows(selection) != 1)
+ return;
+
+ GList *list = gtk_tree_selection_get_selected_rows(selection, &model);
+ // model_store = GTK_TREE_STORE ( model );
+
+ int ipath = atoi(gtk_tree_path_to_string(list->data));
+ GString *fixed_path = g_string_new("");
+ g_string_printf(fixed_path, "%d", ipath);
+
+ GtkTreePath *path = gtk_tree_path_new_from_string(fixed_path->str);
+ g_string_free(fixed_path, TRUE);
+
+ gboolean valid = FALSE;
+
+ if (path) {
+ if (gtk_tree_model_get_iter(model, &iter, path)) { // get iter from specified path
+ valid = TRUE;
+ } else { // invalid path
+ // g_error("Error!!!\n");
+ // TODO
+ }
+ gtk_tree_path_free(path);
+ } else {
+ // g_error("Error!!!\n");
+ // TODO
+ }
+
+ g_list_foreach(list, (GFunc) gtk_tree_path_free, NULL);
+ g_list_free(list);
+
+ if (!valid)
+ return;
+
+ renderer = &cell->parent;
+ guint column_number = GPOINTER_TO_UINT(g_object_get_data(
+ G_OBJECT(renderer), "my_column_num"));
+
+ switch (column_number) {
+
+ case COLUMN_NAME:
+ if (strchr(new_text, ' ') || strchr(new_text, '\t')) {
+ lingot_msg_add_warning(
+ _("Do not use space characters for the note names."));
+ } else if (strchr(new_text, '\n') || strchr(new_text, '{') || strchr(
+ new_text, '}')) {
+ lingot_msg_add_warning(_("The name contains illegal characters."));
+ } else {
+ char_pointer = strtok(new_text, delim);
+ gtk_tree_store_set(model_store, &iter, COLUMN_NAME, (char_pointer
+ == NULL) ? "?" : new_text, -1);
+ }
+ break;
+
+ case COLUMN_SHIFT:
+
+ lingot_config_scale_parse_shift(new_text, &shift_cents,
+ &shift_numerator, &shift_denominator);
+
+ // TODO: full validation
+
+ if ((ipath == 0) && (fabs(shift_cents - 0.0) > 1e-10)) {
+ lingot_msg_add_warning(
+ _("You cannot change the first shift, it must be 1/1."));
+ break;
+ }
+
+ if (isnan(shift_cents) || (shift_cents <= 0.0 - 1e-10) || (shift_cents
+ > 1200.0)) {
+ lingot_msg_add_warning(
+ _("The shift must be between 0 and 1200 cents, or between 1/1 and 2/1."));
+ break;
+ }
+
+ gtk_tree_model_get(model, &iter, COLUMN_SHIFT, &stored_shift_char,
+ COLUMN_FREQUENCY, &stored_freq, -1);
+ lingot_config_scale_parse_shift(stored_shift_char, &stored_shift, NULL,
+ NULL);
+ free(stored_shift_char);
+ lingot_config_scale_format_shift(buff, shift_cents, shift_numerator,
+ shift_denominator);
+ gtk_tree_store_set(model_store, &iter, COLUMN_SHIFT, buff,
+ COLUMN_FREQUENCY, stored_freq * pow(2.0, (shift_cents
+ - stored_shift) / 1200.0), -1);
+ break;
+
+ case COLUMN_FREQUENCY:
+
+ if (!strcmp(new_text, "mid-A")) {
+ freq = MID_A_FREQUENCY;
+ } else if (!strcmp(new_text, "mid-C")) {
+ freq = MID_C_FREQUENCY;
+ } else {
+ sscanf(new_text, "%lg", &freq);
+ // TODO: validation
+ }
+
+ gtk_tree_model_get(model, &iter, COLUMN_SHIFT, &shift_char,
+ COLUMN_FREQUENCY, &stored_freq, -1);
+ lingot_config_scale_parse_shift(shift_char, &shift_cents, NULL, NULL);
+ free(shift_char);
+
+ freq *= pow(2.0, -gtk_spin_button_get_value_as_float(
+ config_dialog->root_frequency_error) / 1200.0);
+ base_freq = freq * pow(2.0, -shift_cents / 1200.0);
+
+ gtk_tree_model_get_iter_first(model, &iter2);
+
+ index = 0;
+ do {
+ gtk_tree_model_get(model, &iter2, COLUMN_SHIFT, &shift_char, -1);
+ lingot_config_scale_parse_shift(shift_char, &shiftf2, NULL, NULL);
+ free(shift_char);
+ freq2 = base_freq * pow(2.0, shiftf2 / 1200.0);
+ gtk_tree_store_set(model_store, &iter2, COLUMN_FREQUENCY, (index
+ == ipath) ? freq : freq2, -1);
+ index++;
+ } while (gtk_tree_model_iter_next(model, &iter2));
+
+ //gtk_spin_button_set_value(config_dialog->root_frequency_error, 0.0);
+
+ break;
+ }
+
+}
+
+void lingot_gui_config_dialog_scale_tree_frequency_cell_data_function(
+ GtkTreeViewColumn *col, GtkCellRenderer *renderer, GtkTreeModel *model,
+ GtkTreeIter *iter, gpointer user_data) {
+ gdouble freq;
+ gchar buf[20];
+ LingotConfigDialog* config_dialog = (LingotConfigDialog*) user_data;
+
+ gtk_tree_model_get(model, iter, COLUMN_FREQUENCY, &freq, -1);
+ freq *= pow(2.0, gtk_spin_button_get_value_as_float(
+ config_dialog->root_frequency_error) / 1200.0);
+
+ if (fabs(freq - MID_A_FREQUENCY) < 1e-3) {
+ g_object_set(renderer, "text", "mid-A", NULL);
+ } else if (fabs(freq - MID_C_FREQUENCY) < 1e-3) {
+ g_object_set(renderer, "text", "mid-C", NULL);
+ } else {
+ g_snprintf(buf, sizeof(buf), "%.4f", freq);
+ g_object_set(renderer, "text", buf, NULL);
+ }
+}
+
+void lingot_gui_config_dialog_scale_tree_add_column(
+ LingotConfigDialog* config_dialog) {
+ GtkCellRenderer *renderer;
+ GtkTreeViewColumn *column;
+ GtkTreeView *treeview = config_dialog->scale_treeview;
+
+ column = gtk_tree_view_column_new();
+
+ gtk_tree_view_column_set_title(column, _("Name"));
+
+ renderer = gtk_cell_renderer_text_new();
+ gtk_tree_view_column_pack_start(column, renderer, FALSE);
+ gtk_tree_view_column_set_attributes(column, renderer, "text", COLUMN_NAME,
+ NULL);
+ g_object_set(renderer, "editable", TRUE, NULL);
+ g_object_set_data(G_OBJECT(renderer), "my_column_num", GUINT_TO_POINTER(
+ COLUMN_NAME));
+ g_signal_connect(
+ renderer,
+ "edited",
+ (GCallback) lingot_gui_config_dialog_scale_tree_cell_edited_callback,
+ config_dialog);
+
+ gtk_tree_view_append_column(treeview, column);
+ column = gtk_tree_view_column_new();
+ gtk_tree_view_column_set_title(column, _("Shift"));
+
+ renderer = gtk_cell_renderer_text_new();
+ gtk_tree_view_column_pack_start(column, renderer, FALSE);
+ gtk_tree_view_column_set_attributes(column, renderer, "text", COLUMN_SHIFT,
+ NULL);
+ g_object_set(renderer, "editable", TRUE, NULL);
+ g_object_set_data(G_OBJECT(renderer), "my_column_num", GUINT_TO_POINTER(
+ COLUMN_SHIFT));
+ // gtk_tree_view_column_set_cell_data_func(column, renderer,
+ // lingot_config_dialog_scale_tree_shift_cell_data_function, NULL,
+ // NULL);
+
+ g_signal_connect(
+ renderer,
+ "edited",
+ (GCallback) lingot_gui_config_dialog_scale_tree_cell_edited_callback,
+ config_dialog);
+
+ gtk_tree_view_append_column(treeview, column);
+ column = gtk_tree_view_column_new();
+ gtk_tree_view_column_set_title(column, _("Frequency [Hz]"));
+
+ renderer = gtk_cell_renderer_text_new();
+ gtk_tree_view_column_pack_start(column, renderer, FALSE);
+ gtk_tree_view_column_set_attributes(column, renderer, "text",
+ COLUMN_FREQUENCY, NULL);
+ g_object_set(renderer, "editable", TRUE, NULL);
+ g_object_set_data(G_OBJECT(renderer), "my_column_num", GUINT_TO_POINTER(
+ COLUMN_FREQUENCY));
+ gtk_tree_view_column_set_cell_data_func(column, renderer,
+ lingot_gui_config_dialog_scale_tree_frequency_cell_data_function,
+ config_dialog, NULL);
+
+ g_signal_connect(
+ renderer,
+ "edited",
+ (GCallback) lingot_gui_config_dialog_scale_tree_cell_edited_callback,
+ config_dialog);
+
+ gtk_tree_view_append_column(treeview, column);
+}
+
+int lingot_gui_config_dialog_scale_validate(LingotConfigDialog* dialog,
+ LingotScale* scale) {
+
+ GtkTreeIter iter, iter2;
+ GtkTreeModel* model = gtk_tree_view_get_model(dialog->scale_treeview);
+
+ char* name;
+ char* name2;
+ char* shift_char;
+ gdouble shift, last_shift;
+ int empty_names = 0;
+
+ gtk_tree_model_get_iter_first(model, &iter);
+
+ last_shift = -1.0;
+
+ // TODO: full validation
+
+ int row1 = 0;
+
+ do {
+ gtk_tree_model_get(model, &iter, COLUMN_NAME, &name, COLUMN_SHIFT,
+ &shift_char, -1);
+ lingot_config_scale_parse_shift(shift_char, &shift, NULL, NULL);
+ free(shift_char);
+
+ if (!strcmp(name, "") || !strcmp(name, "?")) {
+ empty_names = 1;
+ }
+
+ gtk_tree_model_get_iter_first(model, &iter2);
+ int row2 = 0;
+ do {
+ gtk_tree_model_get(model, &iter2, COLUMN_NAME, &name2, -1);
+ if ((row1 != row2) && !strcmp(name, name2)) {
+ lingot_msg_add_error(_("There are notes with the same name"));
+ // TODO: select the conflictive line
+ free(name);
+ free(name2);
+ return 0;
+ }
+ free(name2);
+ row2++;
+ } while (gtk_tree_model_iter_next(model, &iter2));
+
+ free(name);
+
+ if (shift < last_shift) {
+ lingot_msg_add_error(
+ _("There are invalid values in the scale: the notes should be ordered by frequency / shift"));
+ // TODO: select the conflictive line
+ return 0;
+ }
+
+ if (shift >= 1200.0) {
+ lingot_msg_add_error(
+ _("There are invalid values in the scale: all the notes should be in the same octave"));
+ return 0;
+ }
+
+ last_shift = shift;
+ row1++;
+ } while (gtk_tree_model_iter_next(model, &iter));
+
+ if (empty_names) {
+ lingot_msg_add_warning(_("There are notes without name"));
+ return 0;
+ }
+
+ return 1;
+}
+
+void lingot_gui_config_dialog_scale_apply(LingotConfigDialog* dialog,
+ LingotScale* scale) {
+ GtkTreeIter iter;
+ GtkTreeModel* model = gtk_tree_view_get_model(dialog->scale_treeview);
+ gdouble freq, shift;
+ short int shift_num, shift_den;
+ char* shift_char;
+ gchar* name;
+ int i = 0;
+
+ int rows = gtk_tree_model_iter_n_children(model, NULL);
+
+ gtk_tree_model_get_iter_first(model, &iter);
+ gtk_tree_model_get(model, &iter, COLUMN_FREQUENCY, &freq, -1);
+
+ scale->name = strdup(gtk_entry_get_text(dialog->scale_name));
+ scale->base_frequency = freq;
+ lingot_config_scale_allocate(scale, rows);
+
+ do {
+ gtk_tree_model_get(model, &iter, COLUMN_NAME, &name, COLUMN_SHIFT,
+ &shift_char, -1);
+ lingot_config_scale_parse_shift(shift_char, &shift, &shift_num,
+ &shift_den);
+ free(shift_char);
+
+ scale->note_name[i] = name;
+ scale->offset_cents[i] = shift;
+ scale->offset_ratios[0][i] = shift_num;
+ scale->offset_ratios[1][i] = shift_den;
+ i++;
+ } while (gtk_tree_model_iter_next(model, &iter));
+}
+
+void lingot_gui_config_dialog_scale_rewrite(LingotConfigDialog* dialog,
+ LingotScale* scale) {
+ gtk_entry_set_text(dialog->scale_name, scale->name);
+ GtkTreeStore* store = (GtkTreeStore *) gtk_tree_view_get_model(
+ dialog->scale_treeview);
+ gtk_tree_store_clear(store);
+ GtkTreeIter iter2;
+ char buff[80];
+
+ int i;
+ for (i = 0; i < scale->notes; i++) {
+ gtk_tree_store_append(store, &iter2, NULL);
+ FLT freq = scale->base_frequency * pow(2.0, scale->offset_cents[i]
+ / 1200.0);
+ lingot_config_scale_format_shift(buff, scale->offset_cents[i],
+ scale->offset_ratios[0][i], scale->offset_ratios[1][i]);
+ gtk_tree_store_set(store, &iter2, COLUMN_NAME, scale->note_name[i],
+ COLUMN_SHIFT, buff, COLUMN_FREQUENCY, freq, -1);
+ }
+}
+
+void lingot_gui_config_dialog_import_scl(gpointer data,
+ LingotConfigDialog* config_dialog) {
+ GtkWidget * dialog = gtk_file_chooser_dialog_new(_("Open Scale File"),
+ GTK_WINDOW(config_dialog->win), GTK_FILE_CHOOSER_ACTION_OPEN,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN,
+ GTK_RESPONSE_ACCEPT, NULL);
+ GtkFileFilter *filefilter;
+ filefilter = gtk_file_filter_new();
+ static gchar* filechooser_last_folder = NULL;
+
+ gtk_file_filter_set_name(filefilter, (const gchar *) _("Scala files"));
+ gtk_file_filter_add_pattern(filefilter, "*.scl");
+ gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filefilter);
+
+ if (filechooser_last_folder != NULL) {
+ gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog),
+ filechooser_last_folder);
+ }
+
+ if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
+ char *filename;
+ filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
+ if (filechooser_last_folder != NULL)
+ free(filechooser_last_folder);
+ filechooser_last_folder = strdup(gtk_file_chooser_get_current_folder(
+ GTK_FILE_CHOOSER(dialog)));
+ // TODO
+ LingotScale* scale = lingot_config_scale_new();
+ if (!lingot_config_scale_load_scl(scale, filename)) {
+ lingot_msg_add_error(_(
+ "The scale cannot be imported: file format error"));
+ lingot_config_scale_destroy(scale);
+ free(scale);
+ } else {
+ lingot_gui_config_dialog_scale_rewrite(config_dialog, scale);
+ }
+
+ g_free(filename);
+ }
+ gtk_widget_destroy(dialog);
+ //g_free(filefilter);
+}
+
+gint lingot_gui_config_dialog_scale_key_press_cb(GtkWidget *widget,
+ GdkEventKey *kevent, gpointer data) {
+
+ LingotConfigDialog* dialog = (LingotConfigDialog*) data;
+ if (kevent->type == GDK_KEY_PRESS) {
+ if (kevent->keyval == 0xffff) {
+ g_signal_emit_by_name(G_OBJECT(dialog->button_scale_del),
+ "clicked", NULL);
+ } else if (kevent->keyval == 0xff63) {
+ g_signal_emit_by_name(G_OBJECT(dialog->button_scale_add),
+ "clicked", NULL);
+ }
+ }
+
+ return TRUE;
+}
+
+gint lingot_gui_config_dialog_scale_tree_view_column_get_index(
+ GtkTreeViewColumn *column) {
+ GtkTreeView *tree = GTK_TREE_VIEW(column->tree_view);
+ GList *cols = gtk_tree_view_get_columns(tree);
+ int counter = 0;
+
+ while (cols != NULL) {
+ if (column == GTK_TREE_VIEW_COLUMN(cols->data)) {
+ g_list_free(cols);
+ return counter;
+ }
+ cols = cols->next;
+ counter++;
+ }
+
+ g_list_free(cols);
+ return -1;
+}
+
+gboolean lingot_gui_config_dialog_scale_table_query_tooltip(GtkWidget *widget,
+ gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip,
+ gpointer user_data) {
+ GtkTreePath* path;
+ GtkTreeViewColumn* col;
+ gint cx, cy;
+
+ gtk_tree_view_get_path_at_pos((GtkTreeView*) widget, x, y, &path, &col,
+ &cx, &cy);
+
+ gint column_index =
+ lingot_gui_config_dialog_scale_tree_view_column_get_index(col);
+
+ switch (column_index) {
+ case COLUMN_NAME:
+ gtk_tooltip_set_text(
+ tooltip,
+ _("Note identifier, free text that will be displayed in the main window when tuning close to the given note. Don't use space characters here."));
+ break;
+ case COLUMN_SHIFT:
+ gtk_tooltip_set_text(
+ tooltip,
+ _("Shift. You can define it as a deviation in cents from the reference note (the first one), or as a frequency ratio, like '3/2' or '5/4'. All the values must be between 0 and 1200 cents, or between 1/1 and 2/1 (i.e., all the notes must be in the same octave), and they must be well ordered."));
+ break;
+ case COLUMN_FREQUENCY:
+ gtk_tooltip_set_text(
+ tooltip,
+ _("Frequency. You can enter here the absolute frequency for a given note as a reference, and all the other frequencies will shift according to the deviations specified in the 'Shift' column. You can use an absolute numeric value or the keywords 'mid-C' (261.625565 Hz) and 'mid-A' (440 Hz)."));
+ break;
+ }
+
+ return TRUE;
+}
+
+void lingot_gui_config_dialog_scale_show(LingotConfigDialog* dialog,
+ GladeXML* _gladeXML) {
+
+ dialog->scale_name = GTK_ENTRY(
+ glade_xml_get_widget(_gladeXML, "scale_name"));
+ GtkWidget* scroll = glade_xml_get_widget(_gladeXML, "scrolledwindow1");
+
+ /* crea el modelo del arbol */
+ GtkTreeStore *model_store = gtk_tree_store_new(3, G_TYPE_STRING,
+ G_TYPE_STRING, G_TYPE_DOUBLE);
+ GtkTreeModel* model = GTK_TREE_MODEL(model_store);
+
+ /* crea un nuevo widget gtktreeview */
+ dialog->scale_treeview = GTK_TREE_VIEW(gtk_tree_view_new());
+
+ /* agrega columnas al modelo del arbol */
+ lingot_gui_config_dialog_scale_tree_add_column(dialog);
+
+ /* asocia el modelo al gtkteeview */
+ gtk_tree_view_set_model(dialog->scale_treeview, model);
+ gtk_tree_selection_set_mode(gtk_tree_view_get_selection(
+ dialog->scale_treeview), GTK_SELECTION_MULTIPLE);
+
+ g_object_unref(G_OBJECT(model));
+ gtk_container_add(GTK_CONTAINER(scroll), GTK_WIDGET(dialog->scale_treeview));
+
+ dialog->button_scale_del = GTK_BUTTON(glade_xml_get_widget(_gladeXML,
+ "button_scale_del"));
+ dialog->button_scale_add = GTK_BUTTON(glade_xml_get_widget(_gladeXML,
+ "button_scale_add"));
+ GtkButton* button_import = GTK_BUTTON(glade_xml_get_widget(_gladeXML,
+ "button_scale_import"));
+
+ g_signal_connect(G_OBJECT(dialog->scale_treeview), "key_press_event",
+ G_CALLBACK(lingot_gui_config_dialog_scale_key_press_cb), dialog);
+
+ g_signal_connect(G_OBJECT(dialog->button_scale_add), "clicked", G_CALLBACK(
+ lingot_gui_config_dialog_scale_tree_add_row_tree),
+ dialog->scale_treeview);
+ g_signal_connect(G_OBJECT(dialog->button_scale_del), "clicked", G_CALLBACK(
+ lingot_gui_config_dialog_scale_tree_remove_selected_items),
+ dialog->scale_treeview);
+ g_signal_connect(G_OBJECT(button_import), "clicked", G_CALLBACK(
+ lingot_gui_config_dialog_import_scl), dialog);
+
+ gtk_widget_set_has_tooltip(GTK_WIDGET(dialog->scale_treeview), TRUE);
+ g_signal_connect(G_OBJECT(dialog->scale_treeview), "query-tooltip",
+ (GCallback) lingot_gui_config_dialog_scale_table_query_tooltip,
+ NULL);
+}
diff --git a/src/lingot-gui-config-dialog-scale.h b/src/lingot-gui-config-dialog-scale.h
new file mode 100644
index 0000000..5b7b522
--- /dev/null
+++ b/src/lingot-gui-config-dialog-scale.h
@@ -0,0 +1,47 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef LINGOT_GUI_CONFIG_DIALOG_SCALE_H_
+#define LINGOT_GUI_CONFIG_DIALOG_SCALE_H_
+
+#include <gtk/gtk.h>
+
+struct LingotConfigDialog;
+struct LingotScale;
+struct GladeXML;
+
+// initialize and show the components
+void lingot_gui_config_dialog_scale_show(LingotConfigDialog*, GladeXML*);
+
+// validate the information stored in the table
+int lingot_gui_config_dialog_scale_validate(LingotConfigDialog* dialog,
+ LingotScale* scale);
+
+// copies the information stores in the table to the internal data structure
+void lingot_gui_config_dialog_scale_apply(LingotConfigDialog* dialog,
+ LingotScale* scale);
+
+// fills the table with the information carried by the structure
+void lingot_gui_config_dialog_scale_rewrite(LingotConfigDialog* dialog,
+ LingotScale* scale);
+
+#endif /* LINGOT_GUI_CONFIG_DIALOG_SCALE_H_ */
diff --git a/src/lingot-gui-config-dialog.c b/src/lingot-gui-config-dialog.c
new file mode 100644
index 0000000..ef76889
--- /dev/null
+++ b/src/lingot-gui-config-dialog.c
@@ -0,0 +1,435 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <stdio.h>
+#include <math.h>
+#include <unistd.h>
+#include <signal.h>
+#include <string.h>
+#include <glade/glade.h>
+
+#include "lingot-defs.h"
+
+#include "lingot-core.h"
+#include "lingot-config.h"
+#include "lingot-gui-mainframe.h"
+#include "lingot-gui-config-dialog.h"
+#include "lingot-i18n.h"
+#include "lingot-config.h"
+#include "lingot-gui-config-dialog-scale.h"
+#include "lingot-msg.h"
+
+int lingot_gui_config_dialog_apply(LingotConfigDialog*);
+void lingot_gui_config_dialog_close(LingotConfigDialog*);
+void lingot_gui_config_dialog_rewrite(LingotConfigDialog*);
+void lingot_gui_config_dialog_combo_select_value(GtkWidget* combo, int value);
+audio_system_t lingot_gui_config_dialog_get_audio_system(GtkComboBox* combo);
+
+/* button press event attention routine. */
+
+void lingot_gui_config_dialog_callback_button_cancel(GtkButton *button,
+ LingotConfigDialog* dialog) {
+ lingot_gui_config_dialog_close(dialog);
+}
+
+void lingot_gui_config_dialog_callback_button_ok(GtkButton *button,
+ LingotConfigDialog* dialog) {
+ if (lingot_gui_config_dialog_apply(dialog)) {
+ // dumps the current config to the config file
+ lingot_config_save(dialog->conf, CONFIG_FILE_NAME);
+ // establish the current config as the old config, so the close rollback
+ // will do nothing.
+ lingot_config_copy(dialog->conf_old, dialog->conf);
+ lingot_gui_config_dialog_close(dialog);
+ }
+}
+
+void lingot_gui_config_dialog_callback_button_apply(GtkButton *button,
+ LingotConfigDialog* dialog) {
+ if (lingot_gui_config_dialog_apply(dialog)) {
+ lingot_gui_config_dialog_rewrite(dialog);
+ }
+}
+
+void lingot_gui_config_dialog_callback_button_default(GtkButton *button,
+ LingotConfigDialog* dialog) {
+ lingot_config_restore_default_values(dialog->conf);
+ lingot_gui_config_dialog_rewrite(dialog);
+}
+
+void lingot_gui_config_dialog_callback_cancel(GtkWidget *widget,
+ LingotConfigDialog* dialog) {
+ //lingot_mainframe_change_config(dialog->mainframe, dialog->conf_old); // restore old configuration.
+ lingot_gui_config_dialog_close(dialog);
+}
+
+void lingot_gui_config_dialog_callback_close(GtkWidget *widget,
+ LingotConfigDialog *dialog) {
+ lingot_gui_mainframe_change_config(dialog->mainframe, dialog->conf_old); // restore old configuration.
+ gtk_widget_destroy(dialog->win);
+ lingot_gui_config_dialog_destroy(dialog);
+}
+
+void lingot_gui_config_dialog_callback_change_sample_rate(GtkWidget *widget,
+ LingotConfigDialog *dialog) {
+
+ const gchar* text = gtk_entry_get_text(GTK_ENTRY(
+ GTK_BIN(dialog->sample_rate)->child));
+
+ int sr;
+ if (text != NULL) {
+ sr = atoi(text);
+ } else {
+ sr = 44100;
+ //g_print("WARNING: cannot get sample rate, assuming 44100\n");
+ }
+
+ char buff1[20];
+ char buff2[20];
+ gdouble srf = sr;
+ gdouble os = gtk_spin_button_get_value_as_float(GTK_SPIN_BUTTON(
+ dialog->oversampling));
+ sprintf(buff1, "%d", sr);
+ sprintf(buff2, " = %0.1f", srf / os);
+ gtk_label_set_text(dialog->label_sample_rate1, buff1);
+ //gtk_label_set_text(dialog->jack_label_sample_rate1, buff1);
+ gtk_label_set_text(dialog->label_sample_rate2, buff2);
+}
+
+void lingot_gui_config_dialog_callback_change_input_system(GtkWidget *widget,
+ LingotConfigDialog *dialog) {
+
+ char buff[10];
+ char* text = gtk_combo_box_get_active_text(dialog->input_system);
+ audio_system_t audio_system = str_to_audio_system_t(text);
+ free(text);
+
+ LingotAudioSystemProperties* properties =
+ lingot_audio_get_audio_system_properties(audio_system);
+
+ if (properties != NULL) {
+ if ((properties->forced_sample_rate)
+ && (properties->n_sample_rates > 0)) {
+ sprintf(buff, "%d", properties->sample_rates[0]);
+ gtk_entry_set_text(GTK_ENTRY(GTK_BIN(dialog->sample_rate)->child),
+ buff);
+ }
+
+ gtk_widget_set_sensitive(GTK_WIDGET(dialog->sample_rate),
+ (gboolean) !properties->forced_sample_rate);
+
+ GtkListStore* model = GTK_LIST_STORE(gtk_combo_box_get_model(
+ GTK_COMBO_BOX(dialog->sample_rate)));
+ gtk_list_store_clear(model);
+
+ int i;
+ for (i = 0; i < properties->n_sample_rates; i++) {
+ sprintf(buff, "%d", properties->sample_rates[i]);
+ gtk_combo_box_append_text(GTK_COMBO_BOX(dialog->sample_rate), buff);
+ }
+
+ // TODO: devices
+
+ gtk_entry_set_text(GTK_ENTRY(GTK_BIN(dialog->input_dev)->child),
+ dialog->conf->audio_dev[audio_system]);
+ gtk_widget_set_sensitive(GTK_WIDGET(dialog->input_dev),
+ (gboolean) (audio_system != AUDIO_SYSTEM_JACK));
+
+ lingot_audio_audio_system_properties_destroy(properties);
+ } else {
+ gtk_entry_set_text(GTK_ENTRY(GTK_BIN(dialog->input_dev)->child), "");
+ gtk_widget_set_sensitive(GTK_WIDGET(dialog->input_dev), FALSE);
+ gtk_widget_set_sensitive(GTK_WIDGET(dialog->sample_rate), FALSE);
+ }
+}
+
+void lingot_gui_config_dialog_callback_change_deviation(GtkWidget *widget,
+ LingotConfigDialog *dialog) {
+ gtk_widget_queue_draw(GTK_WIDGET(dialog->scale_treeview));
+}
+
+void lingot_gui_config_dialog_set_audio_system(GtkComboBox* combo,
+ audio_system_t audio_system) {
+ const char* token = audio_system_t_to_str(audio_system);
+ GtkTreeModel* model = gtk_combo_box_get_model(combo);
+ GtkTreeIter iter;
+
+ gboolean valid = gtk_tree_model_get_iter_first(model, &iter);
+
+ while (valid) {
+ gchar *str_data;
+ gtk_tree_model_get(model, &iter, 0, &str_data, -1);
+ if (!strcmp(str_data, token))
+ gtk_combo_box_set_active_iter(combo, &iter);
+ g_free(str_data);
+ valid = gtk_tree_model_iter_next(model, &iter);
+ }
+}
+
+audio_system_t lingot_gui_config_dialog_get_audio_system(GtkComboBox* combo) {
+ char* text = gtk_combo_box_get_active_text(combo);
+ int result = str_to_audio_system_t(text);
+ free(text);
+ return result;
+}
+
+void lingot_gui_config_dialog_combo_select_value(GtkWidget* combo, int value) {
+
+ GtkTreeModel* model = gtk_combo_box_get_model(GTK_COMBO_BOX(combo));
+ GtkTreeIter iter;
+
+ gboolean valid = gtk_tree_model_get_iter_first(model, &iter);
+
+ while (valid) {
+ gchar *str_data;
+ gtk_tree_model_get(model, &iter, 0, &str_data, -1);
+ if (atoi(str_data) == value)
+ gtk_combo_box_set_active_iter(GTK_COMBO_BOX(combo), &iter);
+ g_free(str_data);
+ valid = gtk_tree_model_iter_next(model, &iter);
+ }
+}
+
+void lingot_gui_config_dialog_rewrite(LingotConfigDialog* dialog) {
+ LingotConfig* conf = dialog->conf;
+
+ lingot_gui_config_dialog_set_audio_system(dialog->input_system,
+ conf->audio_system);
+ // gtk_entry_set_text(dialog->oss_input_dev, conf->audio_dev);
+ // gtk_entry_set_text(dialog->alsa_input_dev, conf->audio_dev_alsa);
+ gtk_entry_set_text(GTK_ENTRY(GTK_BIN(dialog->input_dev)->child),
+ conf->audio_dev[conf->audio_system]);
+
+ gtk_range_set_value(GTK_RANGE(dialog->calculation_rate),
+ conf->calculation_rate);
+ gtk_range_set_value(GTK_RANGE(dialog->visualization_rate),
+ conf->visualization_rate);
+ gtk_range_set_value(GTK_RANGE(dialog->noise_threshold),
+ conf->noise_threshold_db);
+ gtk_range_set_value(GTK_RANGE(dialog->gain), conf->gain);
+ gtk_spin_button_set_value(dialog->oversampling, conf->oversampling);
+ // lingot_config_dialog_set_root_reference_note(
+ // dialog->combo_root_frequency_reference_note,
+ // conf->root_frequency_referente_note);
+ gtk_spin_button_set_value(dialog->root_frequency_error,
+ conf->root_frequency_error);
+ gtk_spin_button_set_value(dialog->temporal_window, conf->temporal_window);
+ gtk_spin_button_set_value(dialog->dft_number, conf->dft_number);
+ gtk_spin_button_set_value(dialog->dft_size, conf->dft_size);
+ gtk_spin_button_set_value(dialog->peak_number, conf->peak_number);
+ gtk_spin_button_set_value(dialog->peak_halfwidth, conf->peak_half_width);
+ gtk_spin_button_set_value(dialog->minimum_frequency, conf->min_frequency);
+ gtk_range_set_value(GTK_RANGE(dialog->rejection_peak_relation),
+ conf->peak_rejection_relation_db);
+ lingot_gui_config_dialog_combo_select_value(GTK_WIDGET(dialog->fft_size),
+ (int) conf->fft_size);
+
+ char buff[10];
+ sprintf(buff, "%d", conf->sample_rate);
+ gtk_entry_set_text(GTK_ENTRY(GTK_BIN(dialog->sample_rate)->child), buff);
+
+ lingot_gui_config_dialog_scale_rewrite(dialog, conf->scale);
+}
+
+void lingot_gui_config_dialog_destroy(LingotConfigDialog* dialog) {
+ dialog->mainframe->config_dialog = NULL;
+ lingot_config_destroy(dialog->conf);
+ lingot_config_destroy(dialog->conf_old);
+ free(dialog);
+}
+
+int lingot_gui_config_dialog_apply(LingotConfigDialog* dialog) {
+
+ gchar* text1;
+ const gchar* text2;
+ LingotConfig* conf = dialog->conf;
+
+ if (!lingot_gui_config_dialog_scale_validate(dialog, conf->scale)) {
+ return 0;
+ }
+
+ conf->audio_system = lingot_gui_config_dialog_get_audio_system(
+ dialog->input_system);
+ sprintf(conf->audio_dev[conf->audio_system], "%s", gtk_entry_get_text(
+ GTK_ENTRY(GTK_BIN(dialog->input_dev)->child)));
+ conf->root_frequency_error = gtk_spin_button_get_value_as_float(
+ dialog->root_frequency_error);
+ conf->calculation_rate = gtk_range_get_value(GTK_RANGE(
+ dialog->calculation_rate));
+ conf->visualization_rate = gtk_range_get_value(GTK_RANGE(
+ dialog->visualization_rate));
+ conf->temporal_window = gtk_spin_button_get_value_as_float(
+ dialog->temporal_window);
+ conf->noise_threshold_db = gtk_range_get_value(GTK_RANGE(
+ dialog->noise_threshold));
+ conf->gain = gtk_range_get_value(GTK_RANGE(dialog->gain));
+ conf->oversampling = gtk_spin_button_get_value_as_int(dialog->oversampling);
+ conf->dft_number = gtk_spin_button_get_value_as_int(dialog->dft_number);
+ conf->dft_size = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(
+ dialog->dft_size));
+ conf->peak_number = gtk_spin_button_get_value_as_int(dialog->peak_number);
+ conf->peak_half_width = gtk_spin_button_get_value_as_int(
+ dialog->peak_halfwidth);
+ conf->peak_rejection_relation_db = gtk_range_get_value(GTK_RANGE(
+ dialog->rejection_peak_relation));
+ conf->min_frequency = gtk_spin_button_get_value_as_int(
+ dialog->minimum_frequency);
+ text1 = gtk_combo_box_get_active_text(dialog->fft_size);
+ conf->fft_size = atoi(text1);
+ g_free(text1);
+ text2 = gtk_entry_get_text(GTK_ENTRY(GTK_BIN(dialog->sample_rate)->child));
+ conf->sample_rate = atoi(text2);
+
+ LingotScale* scale = conf->scale;
+ lingot_config_scale_destroy(scale);
+
+ lingot_gui_config_dialog_scale_apply(dialog, scale);
+
+ lingot_config_update_internal_params(conf);
+ lingot_gui_mainframe_change_config(dialog->mainframe, conf);
+
+ if (scale->max_offset_rounded > 200) {
+ lingot_msg_add_warning(
+ _("The provided scale contains wide gaps in frequency that increase the gauge range and produce a loss of visual accuracy. Consider providing scales with at least 12 tones, or with a maximum distance between adjacent notes below 200 cents."));
+ }
+
+ return 1;
+}
+
+void lingot_gui_config_dialog_close(LingotConfigDialog* dialog) {
+ dialog->mainframe->config_dialog = NULL;
+ gtk_widget_destroy(dialog->win);
+}
+
+void lingot_gui_config_dialog_show(LingotMainFrame* frame, LingotConfig* config) {
+ GladeXML* _gladeXML = NULL;
+
+ if (frame->config_dialog == NULL) {
+
+ LingotConfigDialog* dialog = malloc(sizeof(LingotConfigDialog));
+
+ dialog->mainframe = frame;
+ dialog->conf = lingot_config_new();
+ dialog->conf_old = lingot_config_new();
+
+ // config copy
+ lingot_config_copy(dialog->conf, (config == NULL) ? frame->conf
+ : config);
+ lingot_config_copy(dialog->conf_old, frame->conf);
+
+ // TODO: obtain glade files installation dir by other way
+# define FILE_NAME "lingot-config-dialog.glade"
+ FILE* fd = fopen("src/glade/" FILE_NAME, "r");
+ if (fd != NULL) {
+ fclose(fd);
+ _gladeXML = glade_xml_new("src/glade/" FILE_NAME, "dialog1", NULL);
+ } else {
+ _gladeXML = glade_xml_new(LINGOT_GLADEDIR FILE_NAME, "dialog1",
+ NULL);
+ }
+# undef FILE_NAME
+
+ dialog->win = glade_xml_get_widget(_gladeXML, "dialog1");
+
+ gtk_window_set_icon(GTK_WINDOW(dialog->win), gtk_window_get_icon(
+ GTK_WINDOW(frame->win)));
+ //gtk_window_set_position(GTK_WINDOW(dialog->win), GTK_WIN_POS_CENTER_ALWAYS);
+ dialog->mainframe->config_dialog = dialog;
+
+ dialog->input_system
+ = GTK_COMBO_BOX(glade_xml_get_widget(_gladeXML, "input_system"));
+ dialog->input_dev
+ = GTK_COMBO_BOX_ENTRY(glade_xml_get_widget(_gladeXML, "input_dev"));
+ dialog->sample_rate
+ = GTK_COMBO_BOX_ENTRY(glade_xml_get_widget(_gladeXML, "sample_rate"));
+ dialog->calculation_rate
+ = GTK_HSCALE(glade_xml_get_widget(_gladeXML, "calculation_rate"));
+ dialog->visualization_rate
+ = GTK_HSCALE(glade_xml_get_widget(_gladeXML, "visualization_rate"));
+ dialog->noise_threshold
+ = GTK_HSCALE(glade_xml_get_widget(_gladeXML, "noise_threshold"));
+ dialog->gain = GTK_HSCALE(glade_xml_get_widget(_gladeXML, "gain"));
+ dialog->oversampling
+ = GTK_SPIN_BUTTON(glade_xml_get_widget(_gladeXML, "oversampling"));
+ dialog->fft_size
+ = GTK_COMBO_BOX(glade_xml_get_widget(_gladeXML, "fft_size"));
+ dialog->temporal_window
+ = GTK_SPIN_BUTTON(glade_xml_get_widget(_gladeXML, "temporal_window"));
+ dialog->root_frequency_error
+ = GTK_SPIN_BUTTON(glade_xml_get_widget(_gladeXML,
+ "root_frequency_error"));
+ dialog->dft_number
+ = GTK_SPIN_BUTTON(glade_xml_get_widget(_gladeXML, "dft_number"));
+ dialog->dft_size
+ = GTK_SPIN_BUTTON(glade_xml_get_widget(_gladeXML, "dft_size"));
+ dialog->peak_number
+ = GTK_SPIN_BUTTON(glade_xml_get_widget(_gladeXML, "peak_number"));
+ dialog->peak_halfwidth
+ = GTK_SPIN_BUTTON(glade_xml_get_widget(_gladeXML, "peak_halfwidth"));
+ dialog->rejection_peak_relation
+ = GTK_HSCALE(glade_xml_get_widget(_gladeXML,
+ "rejection_peak_relation"));
+ dialog->label_sample_rate1 = GTK_LABEL(glade_xml_get_widget(_gladeXML,
+ "label_sample_rate1"));
+ dialog->label_sample_rate2 = GTK_LABEL(glade_xml_get_widget(_gladeXML,
+ "label_sample_rate2"));
+ dialog->minimum_frequency
+ = GTK_SPIN_BUTTON(glade_xml_get_widget(_gladeXML,
+ "minimum_frequency"));
+
+ lingot_gui_config_dialog_scale_show(dialog, _gladeXML);
+
+ gtk_signal_connect(GTK_OBJECT(dialog->input_system), "changed",
+ GTK_SIGNAL_FUNC (lingot_gui_config_dialog_callback_change_input_system), dialog);
+ gtk_signal_connect(GTK_OBJECT(GTK_BIN(dialog->sample_rate)->child), "changed",
+ GTK_SIGNAL_FUNC (lingot_gui_config_dialog_callback_change_sample_rate), dialog);
+
+ gtk_signal_connect (GTK_OBJECT (dialog->oversampling), "value_changed",
+ GTK_SIGNAL_FUNC (lingot_gui_config_dialog_callback_change_sample_rate), dialog);
+ gtk_signal_connect (GTK_OBJECT (dialog->root_frequency_error), "value_changed",
+ GTK_SIGNAL_FUNC (lingot_gui_config_dialog_callback_change_deviation), dialog);
+
+ g_signal_connect(GTK_OBJECT(glade_xml_get_widget(_gladeXML, "button_default")), "clicked", GTK_SIGNAL_FUNC(lingot_gui_config_dialog_callback_button_default), dialog);
+ g_signal_connect(GTK_OBJECT(glade_xml_get_widget(_gladeXML, "button_apply")), "clicked", GTK_SIGNAL_FUNC(lingot_gui_config_dialog_callback_button_apply), dialog);
+ g_signal_connect(GTK_OBJECT(glade_xml_get_widget(_gladeXML, "button_accept")), "clicked", GTK_SIGNAL_FUNC(lingot_gui_config_dialog_callback_button_ok), dialog);
+ g_signal_connect(GTK_OBJECT(glade_xml_get_widget(_gladeXML, "button_cancel")), "clicked", GTK_SIGNAL_FUNC(lingot_gui_config_dialog_callback_button_cancel), dialog);
+ g_signal_connect(GTK_OBJECT(dialog->win), "destroy", GTK_SIGNAL_FUNC(lingot_gui_config_dialog_callback_close), dialog);
+
+ lingot_gui_config_dialog_rewrite(dialog);
+
+ gtk_widget_show(dialog->win);
+ GtkWidget* scroll = glade_xml_get_widget(_gladeXML, "scrolledwindow1");
+ gtk_widget_show_all(scroll);
+ g_object_unref(_gladeXML);
+ } else {
+ if (config != NULL) {
+ lingot_config_copy(frame->config_dialog->conf, config);
+ lingot_gui_config_dialog_rewrite(frame->config_dialog);
+ }
+
+ gtk_window_present(GTK_WINDOW(frame->config_dialog->win));
+ }
+
+ if (config != NULL) {
+ lingot_config_destroy(config);
+ }
+}
diff --git a/src/lingot-gui-config-dialog.h b/src/lingot-gui-config-dialog.h
new file mode 100644
index 0000000..0fcb98c
--- /dev/null
+++ b/src/lingot-gui-config-dialog.h
@@ -0,0 +1,73 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LINGOT_GUI_CONFIG_DIALOG_H__
+#define __LINGOT_GUI_CONFIG_DIALOG_H__
+
+#include <gtk/gtk.h>
+
+#include "lingot-config.h"
+
+typedef struct _LingotConfigDialog LingotConfigDialog;
+
+struct _LingotConfigDialog {
+
+ // widgets that contains configuration information.
+ GtkComboBox* input_system;
+ GtkComboBoxEntry* input_dev;
+ GtkComboBoxEntry* sample_rate;
+ GtkHScale* calculation_rate;
+ GtkHScale* visualization_rate;
+ GtkHScale* noise_threshold;
+ GtkHScale* gain;
+ GtkSpinButton* oversampling;
+ GtkComboBox* fft_size;
+ GtkSpinButton* temporal_window;
+ GtkSpinButton* root_frequency_error;
+ GtkSpinButton* dft_number;
+ GtkSpinButton* dft_size;
+ GtkSpinButton* peak_number;
+ GtkSpinButton* peak_halfwidth;
+ GtkSpinButton* minimum_frequency;
+ GtkHScale* rejection_peak_relation;
+ GtkLabel* label_sample_rate1;
+ GtkLabel* label_sample_rate2;
+
+ GtkButton* button_scale_add;
+ GtkButton* button_scale_del;
+
+ GtkEntry* scale_name;
+ GtkTreeView* scale_treeview;
+
+ LingotConfig* conf; // provisional configuration.
+ LingotConfig* conf_old; // restoration point for cancel.
+
+ LingotMainFrame* mainframe;
+
+ GtkWidget* win; // window
+};
+
+//LingotConfigDialog* lingot_config_dialog_new(LingotMainFrame*);
+void lingot_gui_config_dialog_destroy(LingotConfigDialog*);
+void lingot_gui_config_dialog_show(LingotMainFrame* frame, LingotConfig* config);
+
+#endif // __LINGOT_GUI_CONFIG_DIALOG_H__
diff --git a/src/lingot-gui-mainframe.c b/src/lingot-gui-mainframe.c
new file mode 100644
index 0000000..30c1b69
--- /dev/null
+++ b/src/lingot-gui-mainframe.c
@@ -0,0 +1,861 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <stdio.h>
+#include <math.h>
+#include <unistd.h>
+#include <signal.h>
+#include <string.h>
+#include <glade/glade.h>
+
+#include "lingot-defs.h"
+
+#include "lingot-config.h"
+#include "lingot-gui-mainframe.h"
+#include "lingot-gui-config-dialog.h"
+#include "lingot-gauge.h"
+#include "lingot-i18n.h"
+
+#include "lingot-msg.h"
+
+#include "lingot-background.xpm"
+#include "lingot-logo.xpm"
+
+void lingot_gui_mainframe_redraw(LingotMainFrame*);
+void lingot_mainframe_filter_frequency_value(LingotMainFrame*);
+void lingot_gui_mainframe_draw_gauge(LingotMainFrame*);
+void lingot_gui_mainframe_draw_spectrum_and_labels(LingotMainFrame*);
+
+GdkColor black_color;
+GdkColor cents_color;
+GdkColor gauge_color;
+GdkColor spectrum_background_color;
+GdkColor spectrum_color;
+GdkColor noise_threshold_color;
+GdkColor grid_color;
+GdkColor freq_color;
+
+// sizes
+
+int gauge_size_x = 160;
+int gauge_size_y = 100;
+
+int spectrum_size_y = 64;
+
+// spectrum area margins
+int spectrum_bottom_margin = 16;
+int spectrum_top_margin = 12;
+int spectrum_x_margin = 15;
+
+PangoFontDescription* spectrum_legend_font_desc;
+PangoFontDescription* gauge_cents_font_desc;
+
+gchar* filechooser_config_last_folder = NULL;
+
+void lingot_gui_mainframe_callback_redraw(GtkWidget* w, GdkEventExpose* e,
+ LingotMainFrame* frame) {
+ lingot_gui_mainframe_redraw(frame);
+}
+
+void lingot_gui_mainframe_callback_destroy(GtkWidget* w, LingotMainFrame* frame) {
+ g_source_remove(frame->visualization_timer_uid);
+ g_source_remove(frame->freq_computation_timer_uid);
+ g_source_remove(frame->gauge_computation_uid);
+ gtk_main_quit();
+}
+
+void lingot_gui_mainframe_callback_about(GtkWidget* w, LingotMainFrame* frame) {
+ static const gchar* authors[] = { "Ibán Cereijo Graña <ibancg@gmail.com>",
+ "Jairo Chapela Martínez <jairochapela@gmail.com>", NULL };
+
+ static const gchar* artists[] = { "Matthew Blissett (Logo design)", NULL };
+
+ gtk_show_about_dialog(
+ NULL,
+ "name",
+ "Lingot",
+ "version",
+ VERSION,
+ "copyright",
+ "\xC2\xA9 2004-2011 Ibán Cereijo Graña\n\xC2\xA9 2004-2011 Jairo Chapela Martínez",
+ "comments", _("Accurate and easy to use musical instrument tuner"),
+ "authors", authors, "artists", artists, "website-label",
+ "http://lingot.nongnu.org/", "website",
+ "http://lingot.nongnu.org/", "translator-credits",
+ _("translator-credits"), "logo-icon-name", "lingot-logo",
+ NULL);
+}
+
+void lingot_gui_mainframe_callback_view_spectrum(GtkWidget* w,
+ LingotMainFrame* frame) {
+ gtk_widget_set_visible(frame->spectrum_frame,
+ gtk_check_menu_item_get_active(
+ GTK_CHECK_MENU_ITEM(frame->view_spectrum_item)));
+}
+
+void lingot_gui_mainframe_callback_config_dialog(GtkWidget* w,
+ LingotMainFrame* frame) {
+ lingot_gui_config_dialog_show(frame, NULL);
+}
+
+unsigned short int lingot_gui_mainframe_get_closest_note_index(FLT freq,
+ LingotScale* scale, FLT deviation, FLT* error_cents) {
+ unsigned short note_index = 0;
+ unsigned short int index;
+
+ FLT offset = 1200.0 * log2(freq / scale->base_frequency) - deviation;
+ offset = fmod(offset, 1200.0);
+ if (offset < 0.0) {
+ offset += 1200.0;
+ }
+
+ index = floor(scale->notes * offset / 1200.0);
+
+ FLT pitch_inf;
+ FLT pitch_sup;
+ int n = 0;
+ for (;;) {
+ n++;
+ pitch_inf = scale->offset_cents[index];
+ pitch_sup = ((index + 1) < scale->notes) ? scale->offset_cents[index
+ + 1] : 1200.0;
+
+ if (offset > pitch_sup) {
+ index++;
+ continue;
+ }
+
+ if (offset < pitch_inf) {
+ index--;
+ continue;
+ }
+
+ break;
+ };
+
+ if (fabs(offset - pitch_inf) < fabs(offset - pitch_sup)) {
+ note_index = index;
+ *error_cents = offset - pitch_inf;
+ } else {
+ note_index = index + 1;
+ *error_cents = offset - pitch_sup;
+ }
+
+ return note_index;
+}
+
+/* timeout for gauge and labels visualization */
+gboolean lingot_gui_mainframe_callback_tout_visualization(gpointer data) {
+ unsigned int period;
+
+ LingotMainFrame* frame = (LingotMainFrame*) data;
+
+ period = 1000 / frame->conf->visualization_rate;
+ frame->visualization_timer_uid = g_timeout_add(period,
+ lingot_gui_mainframe_callback_tout_visualization, frame);
+
+ lingot_gui_mainframe_draw_gauge(frame);
+
+ return 0;
+}
+
+/* timeout for spectrum computation and display */
+gboolean lingot_gui_mainframe_callback_tout_spectrum_computation_display(
+ gpointer data) {
+ unsigned int period;
+
+ LingotMainFrame* frame = (LingotMainFrame*) data;
+
+ period = 1000 / frame->conf->calculation_rate;
+ frame->freq_computation_timer_uid = g_timeout_add(period,
+ lingot_gui_mainframe_callback_tout_spectrum_computation_display,
+ frame);
+
+ lingot_gui_mainframe_draw_spectrum_and_labels(frame);
+ //lingot_core_compute_fundamental_fequency(frame->core);
+
+ return 0;
+}
+
+/* timeout for a new gauge position computation */
+gboolean lingot_gui_mainframe_callback_gauge_computation(gpointer data) {
+ unsigned int period;
+ double error_cents;
+ LingotMainFrame* frame = (LingotMainFrame*) data;
+ unsigned short note_index;
+
+ period = 1000 / GAUGE_RATE;
+ frame->gauge_computation_uid = g_timeout_add(period,
+ lingot_gui_mainframe_callback_gauge_computation, frame);
+
+ if (!frame->core->running || isnan(frame->core->freq) || (frame->core->freq
+ < 10.0)) {
+ lingot_gauge_compute(frame->gauge, frame->conf->gauge_rest_value);
+ } else {
+ note_index = lingot_gui_mainframe_get_closest_note_index(
+ frame->core->freq, frame->conf->scale,
+ frame->conf->root_frequency_error, &error_cents);
+ lingot_gauge_compute(frame->gauge, error_cents);
+ }
+
+ return 0;
+}
+
+/* timeout for dispatching the error queue */
+gboolean lingot_gui_mainframe_callback_error_dispatcher(gpointer data) {
+ unsigned int period;
+ GtkWidget* message_dialog;
+ LingotMainFrame* frame = (LingotMainFrame*) data;
+
+ char* error_message = NULL;
+ message_type_t message_type;
+ int more_messages;
+
+ do {
+ more_messages = lingot_msg_get(&error_message, &message_type);
+
+ if (more_messages) {
+ message_dialog
+ = gtk_message_dialog_new(
+ GTK_WINDOW((frame->config_dialog
+ != NULL) ? frame->config_dialog->win : frame->win),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ (message_type == ERROR) ? GTK_MESSAGE_ERROR
+ : ((message_type == WARNING) ? GTK_MESSAGE_WARNING
+ : GTK_MESSAGE_INFO),
+ GTK_BUTTONS_CLOSE, error_message);
+ gtk_window_set_title(GTK_WINDOW(message_dialog), (message_type
+ == ERROR) ? _("Error")
+ : ((message_type == WARNING) ? _("Warning") : _("Info")));
+ gtk_window_set_icon(GTK_WINDOW(message_dialog),
+ gtk_window_get_icon(GTK_WINDOW(frame->win)));
+ gtk_dialog_run(GTK_DIALOG(message_dialog));
+ gtk_widget_destroy(message_dialog);
+ free(error_message);
+ }
+ } while (more_messages);
+
+ period = 1000 / ERROR_DISPATCH_RATE;
+ frame->error_dispatcher_uid = g_timeout_add(period,
+ lingot_gui_mainframe_callback_error_dispatcher, frame);
+
+ return 0;
+}
+
+void lingot_gui_mainframe_callback_open_config(gpointer data,
+ LingotMainFrame* frame) {
+ GtkWidget * dialog = gtk_file_chooser_dialog_new(
+ _("Open Configuration File"), GTK_WINDOW(frame->win),
+ GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL,
+ GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL);
+ GtkFileFilter *filefilter;
+ LingotConfig* config = NULL;
+ filefilter = gtk_file_filter_new();
+
+ gtk_file_filter_set_name(filefilter,
+ (const gchar *) _("Lingot configuration files"));
+ gtk_file_filter_add_pattern(filefilter, "*.conf");
+ gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filefilter);
+ gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE);
+
+ if (filechooser_config_last_folder != NULL) {
+ gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog),
+ filechooser_config_last_folder);
+ }
+
+ if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
+ char *filename;
+ filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
+ if (filechooser_config_last_folder != NULL)
+ free(filechooser_config_last_folder);
+ filechooser_config_last_folder = strdup(
+ gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(dialog)));
+ config = lingot_config_new();
+ lingot_config_load(config, filename);
+ g_free(filename);
+ }
+ gtk_widget_destroy(dialog);
+ //g_free(filefilter);
+
+ if (config != NULL) {
+ lingot_gui_config_dialog_show(frame, config);
+ }
+}
+
+void lingot_gui_mainframe_callback_save_config(gpointer data,
+ LingotMainFrame* frame) {
+ GtkWidget *dialog = gtk_file_chooser_dialog_new(
+ _("Save Configuration File"), GTK_WINDOW(frame->win),
+ GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL,
+ GTK_RESPONSE_CANCEL, GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL);
+ gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER (dialog),
+ TRUE);
+
+ gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER (dialog),
+ "untitled.conf");
+ GtkFileFilter* filefilter = gtk_file_filter_new();
+
+ gtk_file_filter_set_name(filefilter,
+ (const gchar *) _("Lingot configuration files"));
+ gtk_file_filter_add_pattern(filefilter, "*.conf");
+ gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filefilter);
+ gtk_file_chooser_set_show_hidden(GTK_FILE_CHOOSER(dialog), TRUE);
+
+ if (filechooser_config_last_folder != NULL) {
+ gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog),
+ filechooser_config_last_folder);
+ }
+
+ if (gtk_dialog_run(GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
+ char *filename;
+ filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (dialog));
+ if (filechooser_config_last_folder != NULL)
+ free(filechooser_config_last_folder);
+ filechooser_config_last_folder = strdup(
+ gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(dialog)));
+ lingot_config_save(frame->conf, filename);
+ g_free(filename);
+ }
+ gtk_widget_destroy(dialog);
+}
+
+void lingot_gui_mainframe_color(GdkColor* color, int red, int green, int blue) {
+ color->red = red;
+ color->green = green;
+ color->blue = blue;
+}
+
+void lingot_gui_mainframe_create(int argc, char *argv[]) {
+
+ LingotMainFrame* frame;
+ LingotConfig* conf;
+ GladeXML* _gladeXML = NULL;
+
+ if (filechooser_config_last_folder == NULL) {
+ char buff[1000];
+ sprintf(buff, "%s/%s", getenv("HOME"), CONFIG_DIR_NAME);
+ filechooser_config_last_folder = strdup(buff);
+ }
+
+ frame = malloc(sizeof(LingotMainFrame));
+
+ frame->config_dialog = NULL;
+ frame->pix_stick = NULL;
+
+ frame->conf = lingot_config_new();
+ conf = frame->conf;
+ lingot_config_load(conf, CONFIG_FILE_NAME);
+
+ frame->gauge = lingot_gauge_new(conf->gauge_rest_value); // gauge in rest situation
+
+ // ----- FREQUENCY FILTER CONFIGURATION ------
+
+ // low pass IIR filter.
+ FLT freq_filter_a[] = { 1.0, -0.5 };
+ FLT freq_filter_b[] = { 0.5 };
+
+ frame->freq_filter = lingot_filter_new(1, 0, freq_filter_a, freq_filter_b);
+
+ // ---------------------------------------------------
+
+ gtk_init(&argc, &argv);
+ gtk_set_locale();
+
+# define FILE_NAME "lingot-mainframe.glade"
+ FILE* fd = fopen("src/glade/" FILE_NAME, "r");
+ if (fd != NULL) {
+ fclose(fd);
+ _gladeXML = glade_xml_new("src/glade/" FILE_NAME, "window1", NULL);
+ } else {
+ _gladeXML = glade_xml_new(LINGOT_GLADEDIR FILE_NAME, "window1", NULL);
+ }
+# undef FILE_NAME
+
+ frame->win = glade_xml_get_widget(_gladeXML, "window1");
+
+ GdkPixbuf* logo = gdk_pixbuf_new_from_xpm_data(lingotlogo);
+ gtk_icon_theme_add_builtin_icon("lingot-logo", 64, logo);
+
+ gtk_window_set_icon(GTK_WINDOW(frame->win), logo);
+
+ frame->gauge_area = glade_xml_get_widget(_gladeXML, "gauge_area");
+ frame->spectrum_area = glade_xml_get_widget(_gladeXML, "spectrum_area");
+
+ frame->freq_label = glade_xml_get_widget(_gladeXML, "freq_label");
+ frame->tone_label = glade_xml_get_widget(_gladeXML, "tone_label");
+ frame->error_label = glade_xml_get_widget(_gladeXML, "error_label");
+
+ frame->spectrum_frame = glade_xml_get_widget(_gladeXML, "spectrum_frame");
+ frame->spectrum_scroll
+ = GTK_SCROLLED_WINDOW(glade_xml_get_widget(_gladeXML, "scrolledwindow1"));
+ frame->view_spectrum_item
+ = glade_xml_get_widget(_gladeXML, "spectrum_item");
+
+ gtk_check_menu_item_set_active(
+ GTK_CHECK_MENU_ITEM(frame->view_spectrum_item), TRUE);
+
+ // show all
+ gtk_widget_show_all(frame->win);
+
+ int x = ((conf->fft_size > 256) ? (conf->fft_size >> 1) : 256) + 2
+ * spectrum_x_margin;
+ int y = spectrum_size_y + spectrum_bottom_margin + spectrum_top_margin;
+
+ // two pixmaps for double buffer in gauge and spectrum drawing
+ // (virtual screen)
+ gdk_pixmap_new(frame->gauge_area->window, gauge_size_x, gauge_size_y, -1);
+ frame->pix_spectrum
+ = gdk_pixmap_new(frame->spectrum_area->window, x, y, -1);
+
+ // GTK signals
+ gtk_signal_connect(GTK_OBJECT(glade_xml_get_widget(_gladeXML, "preferences_item")), "activate",
+ GTK_SIGNAL_FUNC(lingot_gui_mainframe_callback_config_dialog), frame);
+ gtk_signal_connect(GTK_OBJECT(glade_xml_get_widget(_gladeXML, "quit_item")), "activate", GTK_SIGNAL_FUNC(
+ lingot_gui_mainframe_callback_destroy), frame);
+ gtk_signal_connect(GTK_OBJECT(glade_xml_get_widget(_gladeXML, "about_item")), "activate", GTK_SIGNAL_FUNC(
+ lingot_gui_mainframe_callback_about), frame);
+ gtk_signal_connect(GTK_OBJECT(glade_xml_get_widget(_gladeXML, "spectrum_item")), "activate",
+ GTK_SIGNAL_FUNC(lingot_gui_mainframe_callback_view_spectrum), frame);
+ gtk_signal_connect(GTK_OBJECT(glade_xml_get_widget(_gladeXML, "open_config_item")), "activate",
+ GTK_SIGNAL_FUNC(lingot_gui_mainframe_callback_open_config), frame);
+ gtk_signal_connect(GTK_OBJECT(glade_xml_get_widget(_gladeXML, "save_config_item")), "activate",
+ GTK_SIGNAL_FUNC(lingot_gui_mainframe_callback_save_config), frame);
+
+ gtk_signal_connect(GTK_OBJECT(frame->gauge_area), "expose_event",
+ GTK_SIGNAL_FUNC(lingot_gui_mainframe_callback_redraw), frame);
+ gtk_signal_connect(GTK_OBJECT(frame->spectrum_area), "expose_event",
+ GTK_SIGNAL_FUNC(lingot_gui_mainframe_callback_redraw), frame);
+ gtk_signal_connect(GTK_OBJECT(frame->win), "destroy", GTK_SIGNAL_FUNC(
+ lingot_gui_mainframe_callback_destroy), frame);
+
+ GtkAccelGroup* accel_group = gtk_accel_group_new();
+ gtk_widget_add_accelerator(glade_xml_get_widget(_gladeXML,
+ "preferences_item"), "activate", accel_group, 'p',
+ GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+ gtk_window_add_accel_group(GTK_WINDOW(frame->win), accel_group);
+
+ unsigned int period;
+ period = 1000 / conf->visualization_rate;
+ frame->visualization_timer_uid = g_timeout_add(period,
+ lingot_gui_mainframe_callback_tout_visualization, frame);
+
+ period = 1000 / conf->calculation_rate;
+ frame->freq_computation_timer_uid = g_timeout_add(period,
+ lingot_gui_mainframe_callback_tout_spectrum_computation_display,
+ frame);
+
+ period = 1000 / GAUGE_RATE;
+ frame->gauge_computation_uid = g_timeout_add(period,
+ lingot_gui_mainframe_callback_gauge_computation, frame);
+
+ period = 1000 / ERROR_DISPATCH_RATE;
+ frame->error_dispatcher_uid = g_timeout_add(period,
+ lingot_gui_mainframe_callback_error_dispatcher, frame);
+
+ lingot_gui_mainframe_color(&gauge_color, 0xC000, 0x0000, 0x2000);
+ lingot_gui_mainframe_color(&spectrum_background_color, 0x1111, 0x3333,
+ 0x1111);
+ lingot_gui_mainframe_color(&spectrum_color, 0x2222, 0xEEEE, 0x2222);
+ lingot_gui_mainframe_color(&noise_threshold_color, 0x8888, 0x8888, 0x2222);
+ lingot_gui_mainframe_color(&grid_color, 0x9000, 0x9000, 0x9000);
+ lingot_gui_mainframe_color(&freq_color, 0xFFFF, 0x2222, 0x2222);
+ lingot_gui_mainframe_color(&cents_color, 0x3000, 0x3000, 0x3000);
+
+ gdk_color_alloc(gdk_colormap_get_system(), &gauge_color);
+ gdk_color_alloc(gdk_colormap_get_system(), &spectrum_color);
+ gdk_color_alloc(gdk_colormap_get_system(), &spectrum_background_color);
+ gdk_color_alloc(gdk_colormap_get_system(), &noise_threshold_color);
+ gdk_color_alloc(gdk_colormap_get_system(), &grid_color);
+ gdk_color_alloc(gdk_colormap_get_system(), &freq_color);
+ gdk_color_black(gdk_colormap_get_system(), &black_color);
+ gdk_color_alloc(gdk_colormap_get_system(), &cents_color);
+
+ spectrum_legend_font_desc = pango_font_description_from_string(
+ "Helvetica Plain 7");
+ gauge_cents_font_desc = pango_font_description_from_string(
+ "Helvetica Plain 7");
+
+ frame->core = lingot_core_new(conf);
+ lingot_core_start(frame->core);
+
+ g_object_unref(_gladeXML);
+
+ gtk_main();
+}
+
+void lingot_gui_mainframe_destroy(LingotMainFrame* frame) {
+
+ lingot_core_stop(frame->core);
+ lingot_core_destroy(frame->core);
+
+ lingot_gauge_destroy(frame->gauge);
+ lingot_filter_destroy(frame->freq_filter);
+ lingot_config_destroy(frame->conf);
+ if (frame->config_dialog)
+ lingot_gui_config_dialog_destroy(frame->config_dialog);
+
+ free(frame);
+}
+
+// ---------------------------------------------------------------------------
+
+void lingot_gui_mainframe_redraw(LingotMainFrame* frame) {
+ lingot_gui_mainframe_draw_gauge(frame);
+ lingot_gui_mainframe_draw_spectrum_and_labels(frame);
+}
+
+// ---------------------------------------------------------------------------
+
+void lingot_gui_mainframe_draw_gauge(LingotMainFrame* frame) {
+ GdkGC* gc = frame->gauge_area->style->fg_gc[frame->gauge_area->state];
+ GdkWindow* w = frame->gauge_area->window;
+ GdkGCValues gv;
+
+ gdk_gc_get_values(gc, &gv);
+
+ static FLT gauge_size = 90.0;
+ FLT max = 1.0;
+
+ // draws background
+ if (!frame->pix_stick) {
+ frame->pix_stick = gdk_pixmap_create_from_xpm_d(w, NULL, NULL,
+ background2_xpm);
+ }
+ gdk_draw_pixmap(w, gc, frame->pix_stick, 0, 0, 0, 0, 160, 100);
+
+ // and draws gauge
+ gdk_gc_set_foreground(gc, &gauge_color);
+
+ FLT normalized_error = frame->gauge->position
+ / frame->conf->scale->max_offset_rounded;
+ FLT angle = normalized_error * M_PI / (1.5 * max);
+ gdk_draw_line(w, gc, gauge_size_x >> 1, gauge_size_y - 1, (gauge_size_x
+ >> 1) + (int) rint(gauge_size * sin(angle)), gauge_size_y - 1
+ - (int) rint(gauge_size * cos(angle)));
+
+ gdk_gc_set_foreground(gc, &cents_color);
+ char buff[10];
+ sprintf(buff, (frame->conf->scale->max_offset_rounded > 1.0) ? "-%.0f c"
+ : "-%.1f c", 0.5 * frame->conf->scale->max_offset_rounded);
+ PangoLayout* layout1 = gtk_widget_create_pango_layout(frame->gauge_area,
+ buff);
+ sprintf(buff, (frame->conf->scale->max_offset_rounded > 1.0) ? "+%.0f c"
+ : "+%.1f c", 0.5 * frame->conf->scale->max_offset_rounded);
+ PangoLayout* layout2 = gtk_widget_create_pango_layout(frame->gauge_area,
+ buff);
+ pango_layout_set_font_description(layout1, gauge_cents_font_desc);
+ gdk_draw_layout(w, gc, 0.05 * gauge_size_x, 0.8 * gauge_size_y, layout1);
+ pango_layout_set_font_description(layout2, gauge_cents_font_desc);
+ gdk_draw_layout(w, gc, 0.75 * gauge_size_x, 0.8 * gauge_size_y, layout2);
+ g_object_unref(layout1);
+ g_object_unref(layout2);
+
+ gdk_flush();
+}
+
+void lingot_gui_mainframe_draw_spectrum_and_labels(LingotMainFrame* frame) {
+
+ char* current_tone;
+ GtkWidget* widget = NULL;
+
+ static char error_string[30], freq_string[30];
+
+ PangoLayout* layout;
+
+ int
+ spectrum_size_x =
+ ((frame->conf->fft_size > 256) ? (frame->conf->fft_size
+ >> 1) : 256);
+
+ // minimum grid size in pixels
+ static int minimum_grid_width = 50;
+
+ // scale factors (in KHz) to draw the grid. We will choose the smaller
+ // factor that respects the minimum_grid_width
+ static double scales[] =
+ { 0.01, 0.05, 0.1, 0.2, 0.5, 1, 2, 4, 11, 22, -1.0 };
+
+ // spectrum drawing mode
+ static gboolean spectrum_drawing_filled = TRUE;
+
+ // grid division in dB
+ static FLT grid_db_height = 25;
+
+ register unsigned int i;
+ int j;
+ int old_j;
+ unsigned short note_index;
+
+ GdkGC * gc =
+ frame->spectrum_area->style->fg_gc[frame->spectrum_area->state];
+ GdkPixmap* pixmap = frame->pix_spectrum; //spectrum->window;
+ GdkGCValues gv;
+ gdk_gc_get_values(gc, &gv);
+
+ // clear all
+ gdk_gc_set_foreground(gc, &spectrum_background_color);
+ gdk_draw_rectangle(pixmap, gc, TRUE, 0, 0, spectrum_size_x + 2
+ * spectrum_x_margin, spectrum_size_y + spectrum_bottom_margin
+ + spectrum_top_margin);
+
+ gdk_gc_set_foreground(gc, &grid_color);
+
+ gdk_draw_line(pixmap, gc, spectrum_x_margin, spectrum_size_y
+ + spectrum_top_margin, spectrum_x_margin + spectrum_size_x,
+ spectrum_size_y + spectrum_top_margin);
+
+ // choose scale factor
+ for (i = 0; scales[i] > 0.0; i++) {
+ if ((1e3 * scales[i] * frame->conf->fft_size
+ * frame->conf->oversampling / frame->conf->sample_rate)
+ > minimum_grid_width)
+ break;
+ }
+
+ if (scales[i] < 0.0)
+ i--;
+
+ FLT scale = scales[i];
+
+ int grid_width = 1e3 * scales[i] * frame->conf->fft_size
+ * frame->conf->oversampling / frame->conf->sample_rate;
+
+ char buff[10];
+
+ FLT freq = 0.0;
+ for (i = 0; i <= spectrum_size_x; i += grid_width) {
+ gdk_draw_line(pixmap, gc, spectrum_x_margin + i, spectrum_top_margin,
+ spectrum_x_margin + i, spectrum_size_y + spectrum_top_margin
+ + 3);
+
+ if (freq == 0.0) {
+ sprintf(buff, "0 Hz");
+ } else if (floor(freq) == freq)
+ sprintf(buff, "%0.0f kHz", freq);
+ else if (floor(10 * freq) == 10 * freq) {
+ if (freq <= 1000.0)
+ sprintf(buff, "%0.0f Hz", 1e3 * freq);
+ else
+ sprintf(buff, "%0.1f kHz", freq);
+ } else {
+ if (freq <= 100.0)
+ sprintf(buff, "%0.0f Hz", 1e3 * freq);
+ else
+ sprintf(buff, "%0.2f kHz", freq);
+ }
+
+ layout = gtk_widget_create_pango_layout(frame->spectrum_area, buff);
+ pango_layout_set_font_description(layout, spectrum_legend_font_desc);
+ gdk_draw_layout(pixmap, gc, spectrum_x_margin - 8 + i, spectrum_size_y
+ + spectrum_top_margin + 5, layout);
+ g_object_unref(layout);
+ freq += scale;
+ }
+
+# define PLOT_GAIN 8
+
+ sprintf(buff, "dB");
+
+ layout = gtk_widget_create_pango_layout(frame->spectrum_area, buff);
+ pango_layout_set_font_description(layout, spectrum_legend_font_desc);
+ gdk_draw_layout(pixmap, gc, spectrum_x_margin - 6, 2, layout);
+ g_object_unref(layout);
+
+ int grid_height = (int) (PLOT_GAIN
+ * log10(pow(10.0, grid_db_height / 10.0))); // dB.
+ j = 0;
+ for (i = 0; i <= spectrum_size_y; i += grid_height) {
+ if (j == 0)
+ sprintf(buff, " %i", j);
+ else
+ sprintf(buff, "%i", j);
+
+ layout = gtk_widget_create_pango_layout(frame->spectrum_area, buff);
+ pango_layout_set_font_description(layout, spectrum_legend_font_desc);
+ gdk_draw_layout(pixmap, gc, 2, spectrum_size_y + spectrum_top_margin
+ - i - 5, layout);
+ g_object_unref(layout);
+
+ gdk_draw_line(pixmap, gc, spectrum_x_margin, spectrum_size_y
+ + spectrum_top_margin - i, spectrum_x_margin + spectrum_size_x,
+ spectrum_size_y + spectrum_top_margin - i);
+
+ j += grid_db_height;
+ }
+
+ gdk_gc_set_foreground(gc, &noise_threshold_color);
+
+ // noise threshold drawing.
+ j = -1;
+ for (i = 0; (i < frame->conf->fft_size) && (i < spectrum_size_x); i++) {
+ if ((i % 10) > 5)
+ continue;
+
+ FLT noise = frame->conf->noise_threshold_nu;
+ old_j = j;
+ j = (noise > 1.0) ? (int) (PLOT_GAIN * log10(noise)) : 0; // dB.
+ if ((old_j >= 0) && (old_j < spectrum_size_y) && (j >= 0) && (j
+ < spectrum_size_y))
+ gdk_draw_line(pixmap, gc, spectrum_x_margin + i - 1,
+ spectrum_size_y + spectrum_top_margin - old_j,
+ spectrum_x_margin + i, spectrum_size_y
+ + spectrum_top_margin - j);
+ }
+
+ gdk_gc_set_foreground(gc, &spectrum_color);
+
+ // TODO: change access to frame->core->X
+ // spectrum drawing.
+ if (frame->core->running) {
+ j = -1;
+
+ GtkAdjustment* adj = gtk_scrolled_window_get_hadjustment(
+ frame->spectrum_scroll);
+ int min = gtk_adjustment_get_value(adj) - spectrum_x_margin;
+ int max = min + 256 + 3 * spectrum_x_margin;
+ if (min < 0)
+ min = 0;
+ if (max >= spectrum_size_x)
+ max = spectrum_size_x;
+
+ if (frame->core->running) {
+ for (i = min; i < max; i++) {
+ j = (frame->core->X[i] > 1.0) ? (int) (PLOT_GAIN * log10(
+ frame->core->X[i])) : 0; // dB.
+ if (j >= spectrum_size_y)
+ j = spectrum_size_y - 1;
+ if (spectrum_drawing_filled) {
+ gdk_draw_line(pixmap, gc, spectrum_x_margin + i,
+ spectrum_size_y + spectrum_top_margin - 1,
+ spectrum_x_margin + i, spectrum_top_margin
+ + spectrum_size_y - j);
+ } else {
+ if ((old_j >= 0) && (old_j < spectrum_size_y) && (j >= 0)
+ && (j < spectrum_size_y))
+ gdk_draw_line(pixmap, gc, spectrum_x_margin + i - 1,
+ spectrum_size_y + spectrum_top_margin - old_j,
+ spectrum_x_margin + i, spectrum_size_y
+ + spectrum_top_margin - j);
+ old_j = j;
+ }
+ }
+
+ if (frame->core->freq != 0.0) {
+
+ // fundamental frequency mark with a red point.
+ gdk_gc_set_foreground(gc, &freq_color);
+
+ // index of closest sample to fundamental frequency.
+ i = (int) rint(frame->core->freq * frame->conf->fft_size
+ * frame->conf->oversampling / frame->conf->sample_rate);
+ if ((i < frame->conf->fft_size - 1)
+ && (i < spectrum_size_x - 1)) {
+ j = (frame->core->X[i] > 1.0) ? (int) (PLOT_GAIN * log10(
+ frame->core->X[i])) : 0; // dB.
+ if (j < spectrum_size_y - 1)
+ gdk_draw_rectangle(pixmap, gc, TRUE, spectrum_x_margin
+ + i - 1, spectrum_size_y + spectrum_top_margin
+ - j - 1, 3, 3);
+ }
+ }
+ }
+ }
+
+# undef PLOT_GAIN
+
+ gdk_gc_set_foreground(gc, &black_color);
+
+ widget = frame->spectrum_area;
+
+ gdk_draw_pixmap(widget->window, widget->style->fg_gc[GTK_WIDGET_STATE(
+ widget)], pixmap, 0, 0, 0, 0, spectrum_size_x + 2
+ * spectrum_x_margin, spectrum_size_y + spectrum_bottom_margin
+ + spectrum_top_margin);
+
+ //gdk_flush();
+
+ // draw note, error and frequency labels
+
+ // ignore continuous component
+ if (!frame->core->running || isnan(frame->core->freq) || (frame->core->freq
+ < 10.0)) {
+ current_tone = "---";
+ strcpy(error_string, "e = ---");
+ strcpy(freq_string, "f = ---");
+ //lingot_gauge_compute(frame->gauge, frame->conf->vr);
+ } else {
+ FLT error_cents; // do not use, unfiltered
+ note_index = lingot_gui_mainframe_get_closest_note_index(
+ frame->core->freq, frame->conf->scale,
+ frame->conf->root_frequency_error, &error_cents);
+ if (note_index == frame->conf->scale->notes) {
+ note_index = 0;
+ }
+
+ current_tone = frame->conf->scale->note_name[note_index];
+ sprintf(error_string, "e = %+2.0f cents", frame->gauge->position);
+ sprintf(freq_string, "f = %6.2f Hz", lingot_filter_filter_sample(
+ frame->freq_filter, frame->core->freq));
+ }
+
+ gtk_label_set_text(GTK_LABEL(frame->freq_label), freq_string);
+ gtk_label_set_text(GTK_LABEL(frame->error_label), error_string);
+
+ char* markup = g_markup_printf_escaped(
+ "<span size=\"xx-large\" weight=\"bold\">%s</span>", current_tone);
+ gtk_label_set_markup(GTK_LABEL(frame->tone_label), markup);
+ g_free(markup);
+}
+
+void lingot_gui_mainframe_change_config(LingotMainFrame* frame,
+ LingotConfig* conf) {
+ lingot_core_stop(frame->core);
+ lingot_core_destroy(frame->core);
+
+ // dup.
+ lingot_config_copy(frame->conf, conf);
+
+ // resize the spectrum area
+ g_object_unref(frame->pix_spectrum);
+
+ int
+ x = ((frame->conf->fft_size > 256) ? (frame->conf->fft_size >> 1)
+ : 256) + 2 * spectrum_x_margin;
+ int y = spectrum_size_y + spectrum_top_margin + spectrum_bottom_margin;
+ gtk_widget_set_size_request(GTK_WIDGET(frame->spectrum_area), x, y);
+ frame->pix_spectrum
+ = gdk_pixmap_new(frame->spectrum_area->window, x, y, -1);
+
+ gtk_scrolled_window_set_policy(frame->spectrum_scroll,
+ (frame->conf->fft_size > 512) ? GTK_POLICY_ALWAYS
+ : GTK_POLICY_NEVER, GTK_POLICY_NEVER);
+ gtk_widget_set_size_request(GTK_WIDGET(frame->spectrum_scroll), 260 + 2
+ * spectrum_x_margin, spectrum_size_y + spectrum_bottom_margin
+ + spectrum_top_margin + 4
+ + ((frame->conf->fft_size > 512) ? 16 : 0));
+
+ frame->core = lingot_core_new(frame->conf);
+ lingot_core_start(frame->core);
+
+ // some parameters may have changed
+ lingot_config_copy(conf, frame->conf);
+}
diff --git a/src/lingot-gui-mainframe.h b/src/lingot-gui-mainframe.h
new file mode 100644
index 0000000..16c1c3b
--- /dev/null
+++ b/src/lingot-gui-mainframe.h
@@ -0,0 +1,81 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LINGOT_GUI_MAIN_FRAME_H__
+#define __LINGOT_GUI_MAIN_FRAME_H__
+
+#include "lingot-defs.h"
+#include "lingot-core.h"
+#include "lingot-gauge.h"
+#include "lingot-config.h"
+#include "lingot-filter.h"
+#include "lingot-gui-config-dialog.h"
+
+#include <gtk/gtk.h>
+
+// Window that contains all controls, graphics, etc. of the tuner.
+
+
+struct _LingotMainFrame {
+
+ // gtk widgets
+ GtkWidget* gauge_area;
+ GtkWidget* spectrum_area;
+ GtkWidget* tone_label;
+ GtkWidget* view_spectrum_item;
+ GtkWidget* spectrum_frame;
+
+ GtkWidget* freq_label;
+ GtkWidget* error_label;
+
+ GdkPixmap* pix_spectrum;
+ GdkPixmap* pix_stick;
+
+ GtkScrolledWindow* spectrum_scroll;
+
+ LingotFilter* freq_filter;
+
+ LingotGauge* gauge;
+
+ LingotCore* core;
+
+ GtkWidget* win;
+
+ GdkColor gauge_color;
+ GdkColor spectrum_color;
+
+ LingotConfigDialog* config_dialog;
+ LingotConfig* conf;
+
+ // timer uids
+ guint visualization_timer_uid;
+ guint freq_computation_timer_uid;
+ guint gauge_computation_uid;
+ guint error_dispatcher_uid;
+};
+
+void lingot_gui_mainframe_create(int argc, char *argv[]);
+void lingot_gui_mainframe_destroy(LingotMainFrame*);
+
+void lingot_gui_mainframe_change_config(LingotMainFrame*, LingotConfig*);
+
+#endif //__LINGOT_GUI_MAIN_FRAME_H__
diff --git a/src/lingot-i18n.h b/src/lingot-i18n.h
new file mode 100644
index 0000000..8900d8d
--- /dev/null
+++ b/src/lingot-i18n.h
@@ -0,0 +1,41 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef LINGOTI18N_H_
+#define LINGOTI18N_H_
+
+#include <libintl.h>
+#include <locale.h>
+#include <langinfo.h>
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef ENABLE_NLS
+#undef _
+# define _(String) (const char*) gettext (String)
+#else
+# define _(String) (String)
+#endif
+
+#endif /*LINGOTI18N_H_*/
diff --git a/src/lingot-logo.xpm b/src/lingot-logo.xpm
new file mode 100644
index 0000000..07c05c8
--- /dev/null
+++ b/src/lingot-logo.xpm
@@ -0,0 +1,364 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2007 Matthew Blissett.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+ /* XPM */
+static const char *lingotlogo[] = {
+/* columns rows colors chars-per-pixel */
+"80 80 257 2",
+" c black",
+". c #2E4E41EA1FB9",
+"X c #2F7542BE2093",
+"o c #348B44B92376",
+"O c #39E8475526C6",
+"+ c #3B8D48A42821",
+"@ c #3E2349B12992",
+"# c #42BB4C972CB8",
+"$ c #47474FF73052",
+"% c #48FB503430FF",
+"& c #4CD853213414",
+"* c #51CB55B43725",
+"= c #564F5A4C3B43",
+"- c #5A7D5D3C3E4E",
+"; c #529657CF388C",
+": c #5C5B603040B4",
+"> c #5E896199422C",
+", c #60A75D8440D7",
+"< c #63CD64104550",
+"1 c #674F67624883",
+"2 c #678169444994",
+"3 c #6C8E6CCB4D3A",
+"4 c #68DA665B4854",
+"5 c #6F0671D250C7",
+"6 c #70DE6D2F4EF6",
+"7 c #7EF96D2055C3",
+"8 c #7D3767F552BA",
+"9 c #745F74285424",
+"0 c #7683792557B9",
+"q c #7CB1741A57F4",
+"w c #7FD8776C59C7",
+"e c #7D4B7CD15BF3",
+"r c #7D6D82F15F40",
+"t c #79BC89195F75",
+"y c #75438A075D75",
+"u c #71C8929C6045",
+"i c #6D1E94FB5F0A",
+"p c #6DA59C5264E9",
+"a c #70079ECD6897",
+"s c #6FD995DC6258",
+"d c #7D7F8B87653F",
+"f c #7B278AA06300",
+"g c #75C694C46609",
+"h c #76F297BD6953",
+"j c #73D69D906BB3",
+"k c #7CA294916B2C",
+"l c #7AEA9C466E26",
+"z c #7EFA9DE57191",
+"x c #67DCA2C865E8",
+"c c #69B6A32F677E",
+"v c #6D33A3B96AD7",
+"b c #7054A9066EC7",
+"n c #72F4A3E06ECE",
+"m c #74D0A4A771B2",
+"M c #7511AB17734D",
+"N c #7AEDA601737E",
+"B c #7ABCACAF7811",
+"V c #7CD4AF197B14",
+"C c #7EFCB2657D9F",
+"Z c #84436ED0579C",
+"A c #864C6FE35915",
+"S c #88DA701159DC",
+"D c #820F70D157E3",
+"F c #85D473A35B19",
+"G c #83777C2A5EF3",
+"H c #89E8735A5BF1",
+"J c #8C4E794E5F9F",
+"K c #85587D7B6153",
+"L c #8D7577E36092",
+"P c #8DA17B94627A",
+"I c #8F237F6B6934",
+"U c #92DD7D2E6445",
+"Y c #93FC7F2569D2",
+"T c #812F81225F81",
+"R c #838B84A0628D",
+"E c #84518AE36654",
+"W c #8F4983806686",
+"Q c #8D5485E169D9",
+"! c #8CD68D956B97",
+"~ c #87268DA668AF",
+"^ c #90588ED67342",
+"/ c #8D9E92D06DDC",
+"( c #857791776C44",
+") c #84029CB772D7",
+"_ c #8DE597117233",
+"` c #8EA19A3D75CF",
+"' c #91A88511681E",
+"] c #93CC86706B43",
+"[ c #949A8BF56DAD",
+"{ c #995F833D67AA",
+"} c #9A7C850D6B28",
+"| c #9D7C8A5F6CA9",
+" . c #96588B2B71A4",
+".. c #9BC98BA5750F",
+"X. c #9F898E617A67",
+"o. c #935091BF6FC0",
+"O. c #93EC961172E4",
+"+. c #94C29BFD7561",
+"@. c #97AE9EA37AE0",
+"#. c #9A9895AD7646",
+"$. c #9A109B6B7728",
+"%. c #9B7E9E7579B6",
+"&. c #98E9958A7AE9",
+"*. c #8443A8D17B68",
+"=. c #8120B2D17EA4",
+"-. c #96F1A2117A1A",
+";. c #9BF6A4EE7CEF",
+":. c #9CD1A9A97FC5",
+">. c #A17D8C156E36",
+",. c #A42E8F787241",
+"<. c #A1E18FC77BA7",
+"1. c #A6F192E672F6",
+"2. c #A39793257D69",
+"3. c #AA4795E2753D",
+"4. c #AE389A5D78AC",
+"5. c #B30D9EE07BFF",
+"6. c #B6C7A3137F4A",
+"7. c #983F9F0B808C",
+"8. c #8C8DAE8E8457",
+"9. c #884BB0A5845A",
+"0. c #84D2B602836E",
+"q. c #8943B971878D",
+"w. c #8D8FBB9A8BDB",
+"e. c #8BD8B86388AD",
+"r. c #95C6A3BD82AE",
+"t. c #9F54ACF182B4",
+"y. c #9A1DA87E8829",
+"u. c #9168BDC38FD9",
+"i. c #9701BC539207",
+"p. c #A53F960382A8",
+"a. c #A6DB9A3684C9",
+"s. c #AC659BE684D9",
+"d. c #AA7397B180C1",
+"f. c #A5A4A40A861B",
+"g. c #A1EDADE18417",
+"h. c #A988AA688C0F",
+"j. c #B018ABF193A6",
+"k. c #A3CEB29F8728",
+"l. c #A5AAB6FB8A31",
+"z. c #A757BB5F8D2C",
+"x. c #A981BF438FFC",
+"c. c #AA06B6778D5A",
+"v. c #AA8BC025916C",
+"b. c #AFF6B2629531",
+"n. c #B7BAA4C9831B",
+"m. c #B9FFA681829E",
+"M. c #BA8AA84D8A3E",
+"N. c #B95EA8B58C7A",
+"B. c #BDA2AE1797A2",
+"V. c #B39EABAF95A1",
+"C. c #B8B4B69B9CC1",
+"Z. c #BC91AF6BA17F",
+"A. c #BE02B505A4AF",
+"S. c #BD15BCAEA5D5",
+"D. c #B8A4BEB9A1FC",
+"F. c #AC4FC5299459",
+"G. c #AFB7C58C9903",
+"H. c #AE87CB4B9844",
+"J. c #AEC8CBF898BB",
+"K. c #B413C5DE9DB1",
+"L. c #B26ECE2A9CF0",
+"P. c #B7B9C894A238",
+"I. c #B553CFD5A1AE",
+"U. c #BA0BC89DA479",
+"Y. c #BB3BCA51A68D",
+"T. c #BF93CD67AC76",
+"R. c #BE7BC86BAA3F",
+"E. c #B6DDD175A3D0",
+"W. c #BA16D33EA74D",
+"Q. c #BDD2D5B2AC06",
+"!. c #C1CBAECD87BC",
+"~. c #C315AFFE88E3",
+"^. c #C5D5B3178B8F",
+"/. c #C9C7B7C88EB1",
+"(. c #CB2FB8E2903D",
+"). c #CE7EBC989254",
+"_. c #C684B6F19D30",
+"`. c #D224BFD694C3",
+"'. c #CA84BE10ABD3",
+"]. c #C5FBB9F1A700",
+"[. c #D4B0C3559720",
+"{. c #D7A2C6AC99DF",
+"}. c #D907C7749A12",
+"|. c #DD3CCC359DE1",
+" X c #C1D1CE48AF76",
+".X c #C9DBC334AD40",
+"XX c #C571CE8AB36D",
+"oX c #CAD0CEDBB923",
+"OX c #C105D785AFF8",
+"+X c #C3DFD694B323",
+"@X c #C548DA3FB579",
+"#X c #C808DC02B94B",
+"$X c #CC45D553BC6E",
+"%X c #CAB8DDA2BCE1",
+"&X c #C8DDD37DB87C",
+"*X c #D7D2C9AFAB07",
+"=X c #D951CCCEB2B0",
+"-X c #DE22D322BC6C",
+";X c #E140D06EA108",
+":X c #E5B3D535A487",
+">X c #EA6BD9F5A805",
+",X c #EE1ADE3FABCD",
+"<X c #E5C7D89CAE0C",
+"1X c #E294D538B2DD",
+"2X c #E830DB8CB90B",
+"3X c #F37AE3D7AF6B",
+"4X c #F619E709B22A",
+"5X c #F752E925B732",
+"6X c #F72CEA14BC70",
+"7X c #D000D805C144",
+"8X c #CEA1DFD7C17B",
+"9X c #D311D51DC431",
+"0X c #D29FDA28C4D8",
+"qX c #D738DD50CAB4",
+"wX c #DB3CDF0ECF59",
+"eX c #DB3BD3BCC7E2",
+"rX c #DDAADE16D202",
+"tX c #CFCFE188C316",
+"yX c #D2BAE2E4C6C8",
+"uX c #D69AE57BCB88",
+"iX c #D9EBE692CF48",
+"pX c #DD68E4FCD35D",
+"aX c #DE08EA70D50C",
+"sX c #E3B1DB62C8FC",
+"dX c #E4FEE0ABDAC4",
+"fX c #E215DE2AD715",
+"gX c #E5AAE293D5A7",
+"hX c #E5B0E57EDC9B",
+"jX c #E140EC3FD8B8",
+"kX c #E45DEE6ADD4C",
+"lX c #EC9CE5CAD492",
+"zX c #F861EBA7C35E",
+"xX c #F8ACEE49CB05",
+"cX c #F913EC91C5FE",
+"vX c #F958EF30CD2D",
+"bX c #F9F4F083D281",
+"nX c #F3AFEC22D68B",
+"mX c #FA66F1D9D5EB",
+"MX c #FB20F421DC8C",
+"NX c #EDD8E516CCE0",
+"BX c #E7CAF0BAE1C9",
+"VX c #EAD5E7ADE2E7",
+"CX c #ED07EA54E5DB",
+"ZX c #E80DF10EE225",
+"AX c #EA9DF261E5B6",
+"SX c #EED8F47DEADD",
+"DX c #F167F044EC18",
+"FX c #F787F2AFE303",
+"GX c #F246F639EE99",
+"HX c #FC03F658E4BE",
+"JX c #FCE7F857E952",
+"KX c #FD88F974EA48",
+"LX c #F4DDF7FFF1DD",
+"PX c #F76AF9F8F4EF",
+"IX c #F9B7FB74F7F9",
+"UX c #FDC7FE48FD59",
+"YX c None",
+/* pixels */
+"YXYXYXYXYXYXYXYXZ S H L Y ..<.p.X.X.X.X.X.X.p.X.X.....X...&...X......... ... ... . . .[ .} [ } [ ] ] ] ] ] ] ] Q ] ' ' ' Q Y Q W W W { H H S S YXYXYXYXYXYXYXYX",
+"YXYXYXYXYXH H S H ..Z.eXdXVXVXVXVXVXhXhXVXaXrXpXrXrXrXqXqXuX0X0X7X7X7X#X&X$X&XXXXXXXXX XT.T.T.Y.U.U.P.P.K.K.G.G.F.F.F.x.x.x.x.x.F.F.z.:.:.$.W H H H J YXYXYXYXYX",
+"YXYXYXYXYXS H Y ].DXUXUXUXUXUXIXPXPXLXLXGXSXSXAXAXAXkXkXkXjXaXaXiXiXiXiXuXyXtXtXtX%X%X#X#X@XQ.#XQ.Q.W.W.W.E.E.E.J.J.J.J.J.J.J.J.J.J.J.J.J.J.F.%.J H H YXYXYXYXYX",
+"YXYXYXYXS S p.rXUXUXUXUXUXIXIXIXPXLXGXGXSXSXAXBXAXkXkXkXaXjXaXiXiXiXiXyXyXtXtXtX%X%X#X@X@X+XQ.Q.Q.W.Q.E.E.E.L.J.H.H.J.J.J.J.J.J.J.J.J.J.J.J.J.H.k.' H H YXYXYXYX",
+"YXYXYXH S p.CXUXUXUXUXUXIXIXIXLXLXGXGXSXAXAXAXBXkXkXkXkXaXaXiXiXuXuXuXyXyXtX%X%X%X#X@X@X@X+XQ.Q.Q.Q.E.E.E.J.E.J.J.H.J.J.J.J.J.J.J.J.J.J.H.J.H.J.J.x.' H H YXYXYX",
+"YXYXS Z <.VXUXUXUXUXUXUXIXPXLXLXLXSXSXAXAXZXBXBXkXaXkXaXiXpXiXiXuXyXyXyXtXtX%X%X#X@X@X@XQ.Q.Q.Q.W.W.E.I.E.J.J.J.J.J.J.J.J.J.J.J.H.J.H.J.J.J.J.J.J.J.z.{ S H YXYX",
+"YXH Z Y eXUXUXUXUXUXIXIXPXLXLXLXGXSXAXAXAXZXBXkXkXkXaXaXiXiXiXiXyXyXtXtXtX%X%X#X#X@XQ.@XQ.Q.W.W.W.E.I.E.J.J.J.J.H.J.J.J.J.J.J.J.H.J.H.J.J.J.J.J.J.J.J.k.J H H YX",
+"YXH H ].UXUXUXUXUXUXIXIXLXLXGXDXSXAXAXAXAXkXkXkXaXaXaXaXiXiXuXyXyXyXtX%X%X%X#X@X@X@X@XQ.Q.Q.W.W.E.I.J.J.J.J.J.J.H.J.J.J.J.J.J.J.J.J.J.J.J.H.H.J.J.J.J.H.$.H H YX",
+"YXA ..CXUXUXUXUXIXIXIXLXLXGXSXSXSXAXAXAXkXkXaXkXaXaXiXiXuXuXuXyXyXtXtX%X%X#X#X@XQ.Q.Q.Q.Q.W.W.E.L.L.L.H.J.J.J.J.J.J.J.J.J.J.H.J.H.J.J.J.J.J.J.J.J.J.J.J.F.W S YX",
+"A S ].UXUXUXUXIXIXIXLXLXLXSXSXSXAXBXBXkXaXkXaXaXaXiXiXiXuXuXyXyXtXtX%X%X%X#X@X@XQ.@XQ.Q.W.W.E.E.L.L.H.H.H.H.J.H.H.J.H.J.H.J.H.J.J.J.J.H.J.H.H.J.H.J.J.J.F.$.S S ",
+"A Y dXUXUXUXIXIXPXLXLXGXSXSXSXAXAXBXkXkXkXaXaXaXaXiXiXuXuXyXtX%X#XR.D.C.b.h.f.f.f.f.k.h.h.c.G.G.L.L.H.H.J.J.H.J.J.J.J.J.H.J.J.J.H.J.H.J.J.J.J.J.J.J.H.J.H.z.W S ",
+"S p.IXUXUXUXIXIXLXLXLXSXSXAXAXAXBXBXkXkXkXaXaXpXiXiXuX7XXXD.j.X.} ' P P U U { } { ' U U L P P ' [ $.:.F.F.J.H.H.J.H.J.H.J.J.H.J.J.J.J.J.J.H.H.J.H.J.J.J.J.F.{ H ",
+"S A.UXUXUXIXPXLXLXLXSXSXAXAXAXAXkXkXkXkXjXaXiXpXyXXXj.#.U L U ..s.B.'.*X*X=X2X2X2X=X1X*X{._.M.4.>.U J J ] -.k.F.H.H.J.H.J.H.J.J.J.H.J.J.H.J.J.J.J.H.J.J.J.J.3.H ",
+"S eXUXIXIXPXLXLXSXGXSXAXAXAXBXkXkXkXaXaXaXiX&Xb...P Y X.B.=XsXNXnXMXmXmXmXvXvXvXxXxXvXcXcX6X6X4X,X<X}.m.>.U J { %.c.H.J.J.J.H.J.J.J.J.H.J.J.J.J.J.J.H.J.J.J.:.T ",
+"L fXUXUXPXLXLXLXGXSXAXAXAXBXkXkXkXkXaXiXXXs.U U <._.-XnXMXMXHXMXbXMXbXbXvXbXxXvXxXcXcXcXcXcX6X6X6X6X6X5X,X|.!.1.U J o.l.H.H.J.J.J.H.H.J.J.J.H.J.H.J.J.J.J.J.:.T ",
+"Y dXIXPXLXLXGXGXSXAXAXAXBXkXkXkXaXpX.Xa.P ] N.eXnXHXHXMXMXMXMXmXbXbXbXbXbXvXcXxXcXcXcX6X6X6X6X6X5X5X5X4X4X4X4X,X}.6.U J [ k.H.J.J.J.J.J.J.H.J.J.J.J.J.H.J.J.z.W ",
+"<.VXIXLXLXGXSXSXAXAXAXAXkXkXkXaX7Xs.U Y ].sXFXHXHXMXMXMXMXbXmXmXbXbXbXvXxXxXxXzXcXcXzXzX6X5X6X5X5X5X4X4X4X3X4X4X4X3X|.6.{ J #.z.H.H.H.J.H.J.J.J.J.J.J.H.J.J.x.' ",
+"X.VXLXLXLXGXSXSXAXAXBXkXkXkXiXA.Y Y B.fXFXHXHXHXMXMXMXMXMXbXbXbXbXbXvXxXxXxXzXzX6XzX6X6X6X5X6X5X4X4X4X4X4X3X4X4X4X4X4X3X:X6.U W ;.F.J.H.J.H.H.J.H.J.J.J.J.J.x.' ",
+"X.hXLXGXSXSXSXAXAXBXkXkXkXoXp.L a.eXHXJXHXHXHXMXMXMXMXMXmXbXbXbXvXvXxXxXxXzXzXzXcX6X6X6X6X5X4X5X4X3X4X4X;X4.|.4X4X4X4X4X4X4X}.1.T { :.H.J.H.H.J.J.H.J.H.J.J.x.' ",
+"X.hXLXSXSXAXAXAXBXBXkXkXS.Y Y '.nXKXJXHXHXMXHXMXMXMXmXmXbXbXbXbXvXvXxXxXxXzXzXzX6X6X5X6X6X5X4X4X4X4X4X3X6.Z 1.,X4X4X4X4X4X4X4X>X/.{ W 4.H.H.H.H.J.J.J.J.J.J.x.' ",
+"X.hXSXSXSXAXAXBXkXkXpXV.L p.sXJXHXHXHXHXHXMXMXMXMXmXmXbXmXvXbXvXvXxXxXcXzXzXzXzX6X6X6X5X4X4X4X4X4X4X4X:X{ J S /.4X4X4X4X4X4X4X4X4X;X1.T +.F.J.J.J.H.J.H.J.J.x.' ",
+"X.hXSXAXAXAXBXBXBX9Xa.L N.lXKXJXHXHXHXHXMXMXMXMXMXmXbXbXvXvXvXxXxXxXcXcXzXzX6X5X6X6X5X5X4X4X4X4X4X4X4X(.H ( e Y :X4X4X4X4X4X3X4X4X4X>X6.J | x.J.J.J.J.J.J.J.x.W ",
+"X.pXSXAXBXBXkXBXqXp.L ].FXJXJXHXHXHXHXMXMXMXMXMXmXbXbXbXmXvXxXxXcXcXcX6XzXzX6X6X6X5X5X5X4X4X4X4X4X4X3X3.W N y Z m.4X4X4X4X4X4X4X4X3X4X3X^.{ W :.H.H.J.H.J.J.x.' ",
+"X.fXAXAXBXBXkXqXp.Y '.FXJXJXHXHXHXHXMXMXMXMXbXbXmXbXbXbXvXvXxXxXcXcXcX6X6XzX6X5X5X5X4X4X4X4X4X4X4X4X>X{ O.=.p e J |.4X3X4X3X4X4X4X4X4X4X3X/.{ W x.J.J.J.J.J.x.{ ",
+"X.rXAXZXkXkXwX7.U '.JXJXHXHXHXHXMXMXMXMXMXmXbXbXmXbXbXxXxXxXcXcXcXcX6X6X6X6X6X5X4X4X4X4X3X4X4X4X4X4X).L -.N d f Z 3.3X3X4X4X4X4X4X4X4X4X4X3X).{ ' F.J.H.H.H.F.' ",
+"X.rXAXkXkXrXa.I '.JXJXJXHXHXHXMXMXMXMXMXMXmXbXbXbXbXvXxXxXxXcXcXcX6X6X6X6X6X6X4X4X4X4X4X4X4X4X4X4X4X6.P 8.f P ( T S [.3X4X3X4X4X4X4X4X4X4X4X3X/.J [ F.H.H.H.F.' ",
+"..iXZXkXaXj.L ].FXJXJXHXHXHXMXMXMXMXMXbXbXbXbXbXvXvXxXxXcXzXzXzX6XcX6X6X6X5X5X4X4X4X4X4X4X4X4X4X4X>X{ ! m e Z ! u D 1.,X4X4X4X3X4X4X4X4X3X4X4X3X^.J $.H.H.H.x.{ ",
+"X.qXkXkX'.L V.HXJXJXHXHXHXHXMXMXMXMXMXbXbXbXbXvXvXvXxXcXzXzXzXzX6X6X6X5X5X5X4X3X4X4X4X4X4X4X4X4X5X}.G ` a F Z P ) t H [.4X4X4X4X4X4X3X4X4X4X4X4X4X6.H :.H.H.x.W ",
+"..qXBX9X} <.lXKXJXJXHXHXMXMXMXMXMXbXbXbXbXbXvXvXvXxXcXzXcXzXzXzX6X6X5X5X5X4X4X4X4X4X4X4X4X4X4X4X4Xn.P *.u D 1.P +.u G >.>X4X4X4X4X4X4X4X4X4X4X4X4X:X1.W z.J.F.W ",
+"..qXrXa.U eXHXHXJXHXHXFXMXMXMXMXMXbXbXbXbXbXvXxXxXcXzXzXzXzX6X6X5X6X5X5X4X4X4X4X4X4X4X4X4X3X4X4X,X| W n r J [.| ! *.u H /.4X4X4X3X4X3X4X4X4X4X3X4X4X[.{ | F.F.W ",
+"..0XA.H <.dXHXHXHXHXFXMXMXMXMXMXbXbXbXbXvXvXxXxXcXcXzXzX6X6X6X6X5X5X5X4X4X4X4X3X4X4X4X3X3X4X4X4X}.J ( v e | 3Xm.J :.a T 3.3X4X3X4X4X4X4X3X4X3X4X4X4X;X1.H ;.F.' ",
+"..7XoX7.U ..'.nXFXMXMXMXMXMXbXbXbXbXbXbXvXxXcXxXcXzXzX6X6X6X6X6X6X5X4X4X3X4X4X4X4X4X4X4X4X4X4X3X!.J l g D 6.4X).G r.b T W :X4X4X3X4X4X3X4X4X4X4X>X^.| J o.:.F.W ",
+"X.0XaXuXS.<.L <..XnXMXMXMXmXmXmXmXbXvXxXxXxXxXxX6XzX6X6X6X6X6X6X5X4X4X3X4X4X4X3X3X4X4X4X4X4X4X3X>.W n t Z {.4X|.J +.V d F {.4X4X4X4X4X4X4X4X>X/.>.J ' :.F.J.F.{ ",
+" .$XiXuXuX%XC. .U <.*XnXmXMXvXmXvXvXxXxXcXcXcXzXzXzX6X6X6X6X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X4X3X|.U ! v e { :X4X,X' .8.d S [.4X4X4X4X4X4X>X[.1.J { :.H.J.J.J.x.W ",
+"..$XiXuXuXuXtX&Xb.] L d.=XxXvXvXvXvXxXxXcXxXzX6X6X6X6X5X5X5X5X4X4X3X4X3X3X4X3X4X4X3X4X4X4X4X4X!.J ) u D 6.3X3X>X{ .9.E Z {.5X4X4X4X3X[.1.J { ;.F.J.H.H.J.J.F.W ",
+"X.$XuXuXyXtXtXtX#XXXh.U U s.=XvXvXxXcXcXcXcXzX6X6X6X5X5X5X4X4X4X4X4X4X4X4X4X4X4X4X4X3X4X4X4X3X3.T n y A (.4X4X;XH _ 9.d H }.5X4X3X}.3.U W $.F.F.H.H.J.H.J.J.z.W ",
+" .$XuXyXyXtX%X%X#X#X@XR.2.' U n.1XcXcXzXxX6XzX6X6X6X5X5X4X4X4X4X4X4X4X3X4X3X3X3X3X3X4X4X4X4X:XP ! v r J :X4X3X~.F -.*.r { :X3X|.6.W J %.F.J.J.J.H.H.J.J.J.J.F.T ",
+"..&XyXtXtX%X%X%X%X#X+X@XOXK.%.P ' M.1XzXcX6X6X6X6X6X5X5X4X4X4X4X4X4X3X>X{.^.6.6.6.n.~.[.:X4X/.Z ) p F >.4X4X;XU K *.l F 1.|.6.U J +.l.H.H.J.J.H.H.H.H.J.J.J.F.{ ",
+"| &XyX8XtX%X%X#X#X#X@X+XQ.Q.T.v.#.J } B.<X6X6X5X5X5X6X4X4X4X3X4X3X}.6.{ U J J J F H L P } n.} P n u Z ~.4X|.| Z d N E Z >.{ J o.l.H.H.H.H.H.J.J.H.H.J.J.J.J.F.W ",
+" .&XtX8X%X%X#X@X@XQ.OXQ.Q.Q.Q.W.L.c.[ J | ^.<X6X5X5X4X4X4X4X4X;X6.U J [ o.R J J P J G Q [ H 8 Q j T J |.,X>.Z E l k D Z J o.k.J.J.H.H.H.H.H.H.J.H.H.J.H.J.J.F.W ",
+" .XX%X%X%X#X@X@XOXOXOXQ.Q.W.W.E.I.L.H.g.[ J >./.,X3X4X3X4X4X[.{ J o.:.] K .&.r.@. .W F ^ ^ S k a w | 3X`.L d m l K Z Q g.F.J.J.J.J.H.J.H.J.J.J.J.J.J.H.H.H.F.' ",
+" .XXtX%X#X#X@X+XOXOXQ.Q.E.E.E.I.L.L.L.J.G.:.Q J >.).,X4X3X`.{ U k.k.R ' y.i.i.u.w.w.8.` K 7 K l g Z 4.4X`.P d k K F @.G.J.J.J.J.H.J.J.J.H.J.H.J.H.H.J.J.H.H.l.{ ",
+" . X%X#X#X@X@X+XQ.Q.Q.W.W.E.I.L.J.L.J.J.H.L.F.;.W J 1.[.}.U ' z.G.K U y.u.u.w.q.q.0.0.9.) L e a f 8 U {.(.H 7 H K t.H.H.J.J.J.J.J.J.H.J.J.H.J.J.J.J.J.J.H.J.z.W ",
+"| X%X@X@X@XQ.Q.Q.Q.W.W.E.L.L.L.J.J.J.J.H.H.H.H.x.;.W U U U l.J.+.F y.u.w.q.q.q.0.=.V M m k h n G F H U U P [ :.G.H.H.H.J.J.J.J.H.J.J.J.J.J.J.H.H.J.J.J.J.J.F.W ",
+"[ T.#X#XQ.@XQ.Q.Q.W.W.E.L.L.L.J.J.J.J.J.H.H.H.J.J.J.F.+.W :.H.F.K Q w.q.0.0.0.C V b v v v v v h q ! t.I %.x.J.J.J.J.J.J.J.J.J.J.J.H.J.H.H.J.J.J.J.J.J.J.H.H.F.W ",
+"} T.@X@XQ.Q.Q.Q.W.E.E.L.L.L.L.J.H.J.H.J.H.H.J.J.H.J.H.F.F.H.H.z.F +.0.0.C 0.C B b c c v v v m d Z :.F.F.J.J.J.J.J.F.J.J.J.J.J.J.J.H.J.J.J.J.H.J.J.H.J.H.H.H.F.W ",
+" .Y.@XQ.Q.Q.Q.W.W.E.L.L.L.L.H.J.J.J.J.H.J.J.H.J.H.J.J.J.J.J.J.k.7 ) =.V V B M c p c c v v n n K F z.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.H.J.J.J.H.J.J.J.H.H.H.F.' ",
+"] U.Q.+XQ.Q.W.W.E.E.L.L.J.H.J.J.H.J.J.J.H.H.J.J.J.H.J.J.J.J.J.t.Z h V V M M v x c v v v b m a q Q J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.H.J.J.J.H.J.H.J.H.J.J.H.H.z.' ",
+" .U.Q.Q.Q.W.W.E.J.I.L.J.J.J.J.J.H.J.J.J.J.H.H.J.J.J.J.H.H.J.J.k.Z g b b n c c x v v v v n m k Z @.J.J.J.J.J.H.J.J.H.J.J.H.J.J.H.H.J.J.J.J.H.J.J.J.J.H.J.J.J.F.W ",
+"} U.Q.Q.W.W.I.E.E.J.J.J.J.J.J.J.J.J.H.J.J.J.J.J.J.H.J.J.J.J.J.z.F r c v c c c v v v v v m n G F z.J.J.J.H.J.J.H.H.J.H.J.J.H.H.J.J.J.H.J.J.J.H.J.H.J.J.J.H.J.F.W ",
+"! P.Q.W.W.I.E.E.J.J.J.J.J.J.J.J.H.J.J.J.H.J.H.H.J.J.J.H.H.J.H.H.o.w i x x c c v v m v m m h F O.H.J.J.J.H.J.H.J.J.J.H.H.J.J.J.J.H.J.H.J.J.J.J.J.J.J.H.J.H.H.F.' ",
+"] P.W.E.E.E.L.J.J.J.J.J.J.J.J.J.J.J.H.H.J.J.J.J.H.H.J.J.H.H.H.J.z.J w p c c v v v v m m j G K z.J.J.J.J.J.J.J.J.J.H.J.J.H.H.J.H.J.J.J.J.H.J.H.J.J.H.J.J.H.H.z.' ",
+"' K.W.E.I.J.J.J.J.J.J.J.J.J.J.J.J.J.H.J.J.J.J.J.J.J.J.J.J.H.H.J.J.;.F r p v v b m n m j e F :.H.J.J.J.H.J.J.H.J.H.J.J.H.J.J.H.J.H.J.J.J.J.J.J.J.H.J.H.J.J.J.z.W ",
+"' K.E.I.E.J.J.H.J.J.J.J.J.J.J.J.H.J.J.J.H.H.J.H.H.J.H.J.J.J.J.J.J.H.;.J F r g h h g f K F -.H.H.J.J.J.J.H.J.J.J.J.H.J.J.H.J.J.H.J.J.J.H.H.J.J.J.J.J.J.J.J.J.F.' ",
+"] G.I.I.J.J.J.H.H.J.J.J.J.J.J.J.J.J.H.J.J.J.J.J.J.J.J.J.H.H.J.H.J.J.H.k.! F F F F Z 7 I t.J.J.J.J.H.J.H.J.J.J.J.J.H.J.H.H.J.J.H.H.J.H.J.J.J.J.J.H.J.J.J.J.J.F.W ",
+"] G.I.J.G.@.O.l.F.J.J.J.J.J.J.J.H.J.J.J.H.J.H.J.J.H.J.H.J.J.J.J.J.J.J.J.F.z.+.o.o.O.y.F.J.J.J.H.J.J.J.J.J.H.J.H.H.J.J.H.J.J.H.J.J.J.J.J.H.J.J.J.J.J.J.J.J.J.F.W ",
+"' F.L.L.-.; # 5 F.H.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.H.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.H.H.J.J.J.J.H.J.F.F.H.J.J.H.H.F.' ",
+"' F.J.J._ # . 1 x.J.J.J.J.J.J.J.J.J.J.J.H.J.H.J.H.J.H.J.J.J.J.J.J.J.J.F.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.H.H.J.H.J.J.J.J.J.J.H.J.J.F.T 3 -.H.L.H.H.z.' ",
+"' x.J.J.+.& o e F.J.J.J.J.J.J.J.J.J.J.J.J.H.J.J.J.J.J.J.H.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.H.H.J.J.J.J.H.J.H.J.H.H.J.F.+.$ o - +.:.z.H.z.' ",
+"Q F.J.J.+.$ + T G.F.J.J.J.J.J.J.J.J.J.J.J.J.J.H.J.H.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.F.J.J.J.J.J.J.H.J.J.H.J.J.J.H.H.z.O.r - o X o $ * 3 :.F.' ",
+"' z.H.J._ $ + ~ F.J.J.J.J.J.F.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.F.F.F.J.J.J.J.J.J.J.J.H.H.J.J.J.H.J.J.J.J.F.0 # o X X X o + + & #.F.' ",
+"' F.J.J._ # + o.J.J.J.J.J.J.J.J.J.J.J.J.z./ E :.F.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.J.F.t.T 0 T t.J.J.J.J.J.J.J.H.F.F.F.H.J.H.J.J.J.F.T > > $ . O 2 T ! +.F.z.' ",
+"U F.J.J._ # + O.J.J.J.J.J.J.J.J.J.J.J.J.+.& O 9 z.J.J.J.H.z.-.l.J.J.F.J.J.J.J.J.J.J.J.-.> O . + 0 F.J.J.J.J.J.x./ 5 2 5 ` z.J.J.J.H.H.F.l.:.1 . $ +.J.J.J.J.x.Q ",
+"T F.J.J./ # + +.J.J.J.J.J.J.J.J.J.J.J.J.:.6 < / H.J.J.J.z.0 ; e k./ r -.F.J.J.J.J.J.z.5 o @ O o 5 x.J.J.J.J.F.~ & + + o # 0 F.J.J.J.H.H.H.F.> . * :.J.J.H.J.x.Q ",
+"U z.L.H./ # + +.J.J.J.J.J.J.J.H.J.J.J.H.-.< < ;.L.J.J.J.:.* . - < # O ; / J.H.H.J.J.:.- o 7 = X 0 H.J.J.J.J.F.4 X - 0 & X % / F.H.H.J.J.J.:.- X = l.J.J.J.J.z.J ",
+"J l.J.J.! @ # +.J.J.J.J.J.J.J.H.J.H.J.F.9 o # T J.J.J.J.:.* . o X # # X < F.H.H.J.J.:.- O , % X 6 F.J.J.J.J.:.- o T F.! & o = +.J.H.J.J.J.;.& X < z.J.J.J.J.l.H ",
+"H :.L.H.! + + O.H.H.J.J.J.J.J.H.J.J.J.F.1 X * ;.J.J.J.J.+.$ . . # T G o % $.H.H.J.J.H.9 o X X X - :.J.J.H.H.F.- O r H.J.T O o T F.J.J.J.J.! + o 5 F.J.H.J.J.k.H ",
+"H $.J.H.T o + 6 T ! +.+.:.k.F.H.J.J.J.:.= X - z.J.J.J.J.! @ . O 9 F.~ o + / H.H.J.J.J.:.6 - - # @ / J.J.H.H.F.9 O > :.:.T O X T F.J.J.J.J.~ O O T F.J.H.J.J.$.H ",
+"S ! H.l.2 X X o @ # @ # * - e z.J.J.J.;.& o 3 F.H.H.H.H.T # . = :.H./ # # T F.J.J.J.L.J.F.F.:.r O 3 :.H.J.J.H.$.; + > < # o - +.J.H.J.J.F.T O O / H.H.H.J.F.] S ",
+"S J l.F.T < < 3 5 5 3 1 - & 4 -.J.J.J.:.1 - _ H.H.H.H.H.-.2 < ! H.H.:.2 * T F.J.H.F.:.H.H.H.J.+.% # / H.J.J.H.H.+.< & & = 3 +.F.J.J.J.J.H.+.3 3 g.J.H.H.J.z.J S ",
+"S H 3.H.F.l.l.F.F.F.H.x.k.-.:.H.J.J.J.H.k.:.H.J.H.H.H.H.F.F.l.H.H.H.H.:.-.F.H.J.H.T < T F.H.H.F.3 o 3 F.J.H.H.H.J.z.-.;.:.F.H.H.J.J.H.J.J.H.:.H.H.H.J.J.J.+.H S ",
+"YXS T F.J.H.H.H.J.J.J.J.J.J.J.J.J.J.J.J.H.H.H.H.J.H.H.H.H.J.J.H.H.H.H.H.H.H.J.J.F.r o & T :.:.:.> o 5 F.J.H.H.H.J.J.J.J.J.J.J.J.J.J.J.J.H.J.J.J.J.J.J.J.x.' H YX",
+"YXH S $.H.H.H.J.J.J.J.H.J.J.J.J.J.H.J.H.J.J.J.J.J.J.J.J.H.H.J.J.J.J.H.J.H.J.J.J.J.:.3 # + = = * @ - +.H.J.H.J.H.J.H.J.J.J.J.J.J.H.J.H.J.J.J.J.J.J.J.J.H.$.H H YX",
+"YXH H J k.J.H.H.J.H.J.J.J.J.J.J.J.J.J.J.H.J.H.H.J.H.J.H.J.J.H.J.H.J.J.J.H.J.H.J.J.L.:.~ 9 > 2 3 T :.H.H.J.J.J.J.J.J.H.J.H.J.H.J.J.J.J.J.J.H.H.J.H.J.L.:.P S H YX",
+"YXYXH S Q z.J.J.J.H.J.H.J.J.J.J.H.J.H.J.J.J.J.J.J.J.J.J.H.J.J.J.J.J.J.J.J.H.J.J.J.J.J.J.F.:.F.F.H.H.H.H.H.J.H.H.J.J.J.J.J.J.H.H.J.J.H.J.H.H.H.H.H.H.F.W S H YXYX",
+"YXYXYXH H [ x.J.J.J.J.J.J.J.J.J.J.J.J.J.J.H.H.J.H.J.H.J.J.J.J.H.H.J.J.J.J.J.J.H.J.J.J.J.J.L.H.H.H.H.H.H.J.J.H.H.H.J.H.J.H.J.H.H.H.J.H.J.H.H.H.H.H.F.{ H H YXYXYX",
+"YXYXYXYXH H Q k.H.J.J.J.J.J.J.J.H.J.J.J.H.H.H.H.J.H.H.H.J.J.J.J.J.J.J.J.H.H.H.H.J.J.J.J.H.H.H.H.H.H.H.H.H.H.H.H.J.J.H.H.H.H.H.H.J.J.J.J.J.J.H.H.:./ H H YXYXYXYX",
+"YXYXYXYXYXH H P %.x.J.J.J.J.J.J.J.J.J.J.H.F.H.H.J.H.H.H.J.J.J.J.J.J.J.J.H.H.H.F.J.J.J.J.H.F.H.H.H.H.H.H.J.J.H.H.J.J.H.F.J.H.H.H.J.J.J.L.J.J.F.$.W H H YXYXYXYXYX",
+"YXYXYXYXYXH H H J U #.:.z.z.x.x.F.F.F.F.F.F.z.F.F.F.F.l.F.F.F.F.F.z.F.F.F.F.F.F.F.F.F.F.F.F.z.F.F.F.z.F.F.F.F.z.F.F.F.F.F.F.F.z.F.F.z.:.:.$.W H S S S YXYXYXYXYX",
+"YXYXYXYXYXYXYXYXJ S S J J ' ' ' W ' { T W { W W W W W W W W W W W W W ' ' T W { T { W W { W W W W W W W W W W W W W W W W W W W W { W J W H S S YXYXYXYXYXYXYXYX"
+};
diff --git a/src/lingot-msg.c b/src/lingot-msg.c
new file mode 100644
index 0000000..8cd8864
--- /dev/null
+++ b/src/lingot-msg.c
@@ -0,0 +1,91 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <pthread.h>
+
+#include "lingot-msg.h"
+
+#define MAX_MESSAGES 5
+
+char message[MAX_MESSAGES][1000];
+message_type_t message_type[MAX_MESSAGES];
+
+int front = 0, rear = 0;
+
+pthread_mutex_t message_queue_mutex = PTHREAD_MUTEX_INITIALIZER;
+
+void lingot_msg_add_error(const char* msg) {
+ lingot_msg_add(msg, ERROR);
+}
+
+void lingot_msg_add_warning(const char* msg) {
+ lingot_msg_add(msg, WARNING);
+}
+
+void lingot_msg_add_info(const char* msg) {
+ lingot_msg_add(msg, INFO);
+}
+
+void lingot_msg_add(const char* msg, message_type_t type) {
+
+ pthread_mutex_lock(&message_queue_mutex);
+ if (front == ((rear + 1) % MAX_MESSAGES)) {
+ perror("The messages array is full!\n");
+ } else {
+ // check if the message is already in the queue
+ int duplicated = 0;
+ int i = front;
+ while (i != rear) {
+ i = (i + 1) % MAX_MESSAGES;
+ if (!strcmp(message[i], msg)) {
+ duplicated = 1;
+ printf("duplicated message: %s\n", msg);
+ break;
+ }
+ }
+
+ if (!duplicated) {
+ rear = ((rear + 1) % MAX_MESSAGES);
+ strcpy(message[rear], msg);
+ message_type[rear] = type;
+ }
+ }
+ pthread_mutex_unlock(&message_queue_mutex);
+}
+
+int lingot_msg_get(char** msg, message_type_t* type) {
+ int result = 0;
+ *msg = NULL;
+
+ pthread_mutex_lock(&message_queue_mutex);
+ if (front != rear) {
+ front = (front + 1) % MAX_MESSAGES;
+ *msg = strdup(message[front]);
+ *type = message_type[front];
+ result = 1;
+ }
+ pthread_mutex_unlock(&message_queue_mutex);
+
+ return result;
+}
diff --git a/src/lingot-msg.h b/src/lingot-msg.h
new file mode 100644
index 0000000..6e28964
--- /dev/null
+++ b/src/lingot-msg.h
@@ -0,0 +1,42 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LINGOT_MESSAGES_H__
+#define __LINGOT_MESSAGES_H__
+
+// asynchronous message handling
+
+// message types
+typedef enum message_type_t {
+ ERROR = 0, WARNING = 1, INFO = 2
+} message_type_t;
+
+// add messages to the queue
+void lingot_msg_add(const char* message, message_type_t type);
+void lingot_msg_add_error(const char* message);
+void lingot_msg_add_warning(const char* message);
+void lingot_msg_add_info(const char* message);
+
+// gets a message from the queue, it returns 0 if no messages are available
+int lingot_msg_get(char** msg, message_type_t* type);
+
+#endif
diff --git a/src/lingot-signal.c b/src/lingot-signal.c
new file mode 100644
index 0000000..b94ac25
--- /dev/null
+++ b/src/lingot-signal.c
@@ -0,0 +1,165 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <math.h>
+
+#include "lingot-signal.h"
+
+/*
+ peak identification functions.
+ */
+
+FLT lingot_signal_get_noise_threshold(LingotConfig* conf, FLT w) {
+ //return 0.5*(1.0 - 0.9*w/M_PI);
+ return pow(10.0, (conf->noise_threshold_db * (1.0 - 0.9 * w / M_PI)) / 10.0);
+ //return conf->noise_threshold_un;
+}
+
+//---------------------------------------------------------------------------
+
+/* returns the index of the maximun of the buffer x of size N */
+void lingot_signal_get_max(FLT *x, int N, int* Mi) {
+ register int i;
+ FLT M;
+
+ M = -1.0;
+ *Mi = -1;
+
+ for (i = 0; i < N; i++) {
+
+ if (x[i] > M) {
+ M = x[i];
+ *Mi = i;
+ }
+ }
+}
+
+//---------------------------------------------------------------------------
+
+int lingot_signal_is_peak(LingotConfig* conf, FLT* x, int index) {
+ register unsigned int j;
+ //static FLT delta_w_FFT = 2.0*M_PI/conf->FFT_SIZE; // resolution in rads
+
+ // a peak must be greater than noise threshold.
+ if (x[index] < conf->noise_threshold_nu)
+ return 0;
+
+ for (j = 0; j < conf->peak_half_width; j++) {
+ if (x[index + j] < x[index + j + 1])
+ return 0;
+ if (x[index - j] < x[index - j - 1])
+ return 0;
+ }
+ return 1;
+}
+
+//---------------------------------------------------------------------------
+
+// search the fundamental peak given the spd and its 2nd derivative
+int lingot_signal_get_fundamental_peak(LingotConfig* conf, FLT *x, FLT* d2x,
+ int N) {
+ register unsigned int i, j, m;
+ int p_index[conf->peak_number];
+
+ // at this moment there is no peaks.
+ for (i = 0; i < conf->peak_number; i++)
+ p_index[i] = -1;
+
+ unsigned int lowest_index = (unsigned int) ceil(conf->min_frequency * (1.0
+ * conf->oversampling / conf->sample_rate) * conf->fft_size);
+
+ if (lowest_index < conf->peak_half_width)
+ lowest_index = conf->peak_half_width;
+
+ // I'll get the PEAK_NUMBER maximum peaks.
+ for (i = lowest_index; i < N - conf->peak_half_width; i++)
+ if (lingot_signal_is_peak(conf, x, i)) {
+
+ // search a place in the maximums buffer, if it doesn't exists, the
+ // lower maximum is candidate to be replaced.
+ m = 0; // first candidate.
+ for (j = 0; j < conf->peak_number; j++) {
+ if (p_index[j] == -1) {
+ m = j; // there is a place.
+ break;
+ }
+
+ if (d2x[p_index[j]] < d2x[p_index[m]])
+ m = j; // search the lowest.
+ }
+
+ if (p_index[m] == -1)
+ p_index[m] = i; // there is a place
+ else if (d2x[i] > d2x[p_index[m]])
+ p_index[m] = i; // if greater
+ }
+
+ FLT maximum = 0.0;
+ int maximum_index = -1;
+
+ // search the maximum peak
+ for (i = 0; i < conf->peak_number; i++)
+ if ((p_index[i] != -1) && (x[p_index[i]] > maximum)) {
+ maximum = x[p_index[i]];
+ maximum_index = p_index[i];
+ }
+
+ if (maximum_index == -1)
+ return N;
+
+ // all peaks much lower than maximum are deleted.
+ for (i = 0; i < conf->peak_number; i++)
+ if ((p_index[i] == -1) || (conf->peak_rejection_relation_nu
+ * x[p_index[i]] < maximum))
+ p_index[i] = N; // there are available places in the buffer.
+
+ // search the lowest maximum index.
+ for (m = 0, j = 0; j < conf->peak_number; j++) {
+ if (p_index[j] < p_index[m])
+ m = j;
+ }
+
+ return p_index[m];
+}
+
+//---------------------------------------------------------------------------
+
+// generates a Hamming window of N samples
+void lingot_signal_window(int N, FLT* out, window_type_t window_type) {
+ register int i;
+ switch (window_type) {
+ case RECTANGULAR:
+ for (i = 0; i < N; i++)
+ out[i] = 1.0;
+ break;
+ case HANNING:
+ for (i = 0; i < N; i++)
+ out[i] = 0.5 * (1 - cos((2.0 * M_PI * i) / (N - 1)));
+ break;
+ case HAMMING:
+ for (i = 0; i < N; i++)
+ out[i] = 0.53836 - 0.46164 * cos((2.0 * M_PI * i) / (N - 1));
+ break;
+ default:
+ break;
+ }
+}
diff --git a/src/lingot-signal.h b/src/lingot-signal.h
new file mode 100644
index 0000000..53c9383
--- /dev/null
+++ b/src/lingot-signal.h
@@ -0,0 +1,48 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LINGOT_SIGNAL_H__
+#define __LINGOT_SIGNAL_H__
+
+/*
+ peak identification functions.
+ */
+
+#include "lingot-defs.h"
+#include "lingot-config.h"
+
+// returns noise threshold at a given frequency w.
+FLT lingot_signal_get_noise_threshold(LingotConfig*, FLT w);
+
+// returns if buffer has a peak at given index
+int lingot_signal_is_peak(LingotConfig*, FLT* buffer, int index);
+
+// returns the maximum index.
+void lingot_signal_get_max(FLT *buffer, int N, int* Mi);
+
+// returns the index of the peak that carries the fundamental freq.
+int lingot_signal_get_fundamental_peak(LingotConfig*, FLT *x, FLT* y, int N);
+
+// generates a Hamming window of N samples
+void lingot_signal_window(int N, FLT* out, window_type_t window_type);
+
+#endif /*__LINGOT_SIGNAL_H__*/
diff --git a/src/lingot.c b/src/lingot.c
new file mode 100644
index 0000000..d383833
--- /dev/null
+++ b/src/lingot.c
@@ -0,0 +1,149 @@
+/*
+ * lingot, a musical instrument tuner.
+ *
+ * Copyright (C) 2004-2011 Ibán Cereijo Graña, Jairo Chapela Martínez.
+ *
+ * This file is part of lingot.
+ *
+ * lingot 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.
+ *
+ * lingot is distributed in the hope that 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 lingot; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <getopt.h>
+
+#include "lingot-defs.h"
+#include "lingot-config.h"
+#include "lingot-gui-mainframe.h"
+#include "lingot-i18n.h"
+
+#include <gtk/gtk.h>
+#include <gdk/gdk.h>
+#include <glib.h>
+
+char CONFIG_FILE_NAME[100];
+
+//void print_card_list(void) {
+// int status;
+// int card = -1; // use -1 to prime the pump of iterating through card list
+// char* longname = NULL;
+// char* shortname = NULL;
+//
+// if ((status = snd_card_next(&card)) < 0) {
+// error("cannot determine card number: %s", snd_strerror(status));
+// return;
+// }
+// if (card < 0) {
+// error("no sound cards found");
+// return;
+// }
+// while (card >= 0) {
+// printf("Card %d:", card);
+// if ((status = snd_card_get_name(card, &shortname)) < 0) {
+// error("cannot determine card shortname: %s", snd_strerror(status));
+// break;
+// }
+// if ((status = snd_card_get_longname(card, &longname)) < 0) {
+// error("cannot determine card longname: %s", snd_strerror(status));
+// break;
+// }
+// printf("\tLONG NAME: %s\n", longname);
+// printf("\tSHORT NAME: %s\n", shortname);
+// if ((status = snd_card_next(&card)) < 0) {
+// error("cannot determine card number: %s", snd_strerror(status));
+// break;
+// }
+// }
+//}
+
+int main(int argc, char *argv[]) {
+
+#ifdef ENABLE_NLS
+ bindtextdomain(GETTEXT_PACKAGE, LINGOT_LOCALEDIR);
+ bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
+ textdomain(GETTEXT_PACKAGE);
+#endif
+
+ // default config file.
+ sprintf(CONFIG_FILE_NAME, "%s/" CONFIG_DIR_NAME DEFAULT_CONFIG_FILE_NAME,
+ getenv("HOME"));
+
+ // TODO: indicate complete config file path
+ if ((argc > 3) || (argc == 2)) {
+ printf("\nusage: lingot [-c config]\n\n");
+ return -1;
+ } else if (argc > 1) {
+ int c;
+ // int digit_optind = 0;
+
+ while (1) {
+ // int this_option_optind = optind ? optind : 1;
+ int option_index = 0;
+ static struct option long_options[] = { { "config", 1, 0, 'c' }, {
+ 0, 0, 0, 0 } };
+
+ c = getopt_long(argc, argv, "c:", long_options, &option_index);
+ if (c == -1)
+ break;
+
+ switch (c) {
+ case 'c':
+ sprintf(CONFIG_FILE_NAME, "%s/%s%s.conf", getenv("HOME"),
+ CONFIG_DIR_NAME, optarg);
+ printf("using config file %s\n", CONFIG_FILE_NAME);
+ break;
+
+ case '?':
+ break;
+
+ default:
+ printf("?? getopt returned character code 0%o ??\n", c);
+ break;
+ }
+ }
+ }
+
+ // if config file doesn't exists, i will create it.
+ FILE* fp;
+ if ((fp = fopen(CONFIG_FILE_NAME, "r")) == NULL) {
+
+ char config_dir[100];
+ sprintf(config_dir, "%s/.lingot/", getenv("HOME"));
+ printf("creating directory %s ...\n", config_dir);
+ mkdir(config_dir, 0777); // creo el directorio.
+ printf("creating file %s ...\n", CONFIG_FILE_NAME);
+
+ // new configuration with default values.
+ LingotConfig* new_conf = lingot_config_new();
+ lingot_config_restore_default_values(new_conf);
+ lingot_config_save(new_conf, CONFIG_FILE_NAME);
+ lingot_config_destroy(new_conf);
+
+ printf("ok\n");
+
+ } else
+ fclose(fp);
+
+// print_card_list();
+
+ lingot_gui_mainframe_create(argc, argv);
+
+ return 0;
+}